character image on the textbox?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

character image on the textbox?

#1 Post by glithch » Sun Dec 25, 2016 4:48 pm

i know this is a popular question but i cant find any tutorial that looks like it would work with the new version of renpy ://
i would like to have my protagonists sprite on the side of the text box, but only their, and only when they talk.
i need to make a character specific text box for that? do i need to mess up with different files?

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: character image on the textbox?

#2 Post by glithch » Mon Dec 26, 2016 7:18 am

ok i dont know if its the new version or if im messing it up but im using this. https://www.renpy.org/doc/html/side_image.html the invisible character section.
and the code there looks like this
define p = Character("Player", image="player")

image side player happy = "side_player_happy.png"
image side player concerned = "side_player_concerned.png"

label start:

p happy "This is shown with the 'side player happy' image."


my code looks like this

define m = Character('Max', color="#ffffff", image="max")
image side max neutral = ("side_max_neutral.png")
label start:
m neutral ".{w=0.2}.{w=0.2}."

and i get an error that no image tag is associated with the speaking character

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: character image on the textbox?

#3 Post by Divona » Mon Dec 26, 2016 7:38 am

The only way for me to replicate the error is to remove image="max" out of Character(), or define the same character again without the use of image="max". The code you provided above is fine, the problem is likely to be else where in your code.
Completed:
Image

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: character image on the textbox?

#4 Post by glithch » Mon Dec 26, 2016 5:55 pm

Divona wrote:The only way for me to replicate the error is to remove image="max" out of Character(), or define the same character again without the use of image="max". The code you provided above is fine, the problem is likely to be else where in your code.
i ended up doing
define m = Character('Max', color="#ffffff", image= "max")
image side max = "side_max.png"
m ".{w=0.2}.{w=0.2}."

and it works??

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: character image on the textbox?

#5 Post by Divona » Tue Dec 27, 2016 12:28 am

Perhaps misspell the word "neutral" originally?
Completed:
Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: character image on the textbox?

#6 Post by Imperf3kt » Tue Dec 27, 2016 1:40 am

I don't know if using the new GUI makes a difference, as I am still using the old GUI, even though I've updated renpy, so please keep that in mind.
Anyway, renpy still does as expected when I use the following:

$ Eileen = Character(None, show_side_image=Image("images/Eileen_side_image.png", xalign=0.01, yalign=0.99))

This is positioned for a 1280x720 screen, adjust as neccessary using the xalign / yalign variables.

What this does, is every time I define "Eileen" to be speaking, it'll show a "side image" every time only that character speaks.

For example, the following was made with the new GUI:
http://puu.sh/t2eEJ/b97986e43d.png
It's not aligning as expected though...

Code: Select all

## The script of the game goes in this file.

## Declare characters used by this game. The color argument colorizes the name
## of the character.

define e = Character('Eileen')
$ Eileen = Character(None, show_side_image=Image("images/Eileen.png", xalign=0.5, yalign=0.99))

## The game starts here.

label start:

    ## Show a background. This uses a placeholder by default, but you can add a
    ## file (named either "bg room.png" or "bg room.jpg") to the images
    ## directory to show it.

    scene bg room

    ## This shows a character sprite. A placeholder is used, but you can replace
    ## it by adding a file named "eileen happy.png" to the images directory.

    show eileen happy

    ## These display lines of dialogue.

    "Hello, world."

    e "You've created a new Ren'Py game."

    e "Once you add a story, pictures, and music, you can release it to the world!"

    ## This ends the game.

    return
E: Okay, after a few quick tests, it seems the new GUI doesn't function the same way at all. Please disregard the above post.

I have since read through file:///C:/Program%20Files%20(x86)/renpy/renpy-6.99.11-sdk/doc/side_image.html and realised how silly it was for me to comment :p

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], minyan