Character Avatars in Dialogue Box?

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
squiggs

Character Avatars in Dialogue Box?

#1 Post by squiggs » Fri May 29, 2009 12:11 am

I know that some games have a character avatar nestled inside or overlapping the dialogue box (usually when that character is speaking) rather than just displaying that character's name or having a full length image behind. Is this possible to do in Ren'Py? (I've tried to do it with just normal images, but the image always appears behind the dialogue window.)

Thanks for any help!

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Character Avatars in Dialogue Box?

#2 Post by DaFool » Fri May 29, 2009 12:30 am

Code: Select all

    $ i = Character('Me', color="#9999c0", window_right_padding=180, show_side_image=Image("mesmile.png", xalign=1.0, yalign=1.0))
That's right-aligned. I think left-aligned would be xalign=0. There should be more examples of show side image on the wiki.

squiggs

Re: Character Avatars in Dialogue Box?

#3 Post by squiggs » Fri May 29, 2009 1:22 am

Hey, thanks so much for your help! :)

Is there a way to make that image persistent no matter who is speaking? Or is that a whole different ball of wax?

Thanks again; that was one problem that has been bugging me for a while, and I really appreciate the help with it!

Guest

Re: Character Avatars in Dialogue Box?

#4 Post by Guest » Fri May 29, 2009 5:19 am

uh, just use the same image everytime? >_<
This method does tie the image to the particular character.

Why would you need an image that goes on top of the textbox all the time? Unless you want textbox quick menus, there's a Cookbook entry for that.

User avatar
Tomoko
Regular
Posts: 37
Joined: Tue Mar 24, 2009 6:07 pm
Location: Germany, somewhere in NRW
Contact:

Re: Character Avatars in Dialogue Box?

#5 Post by Tomoko » Fri May 29, 2009 8:43 am

I have a question on this:

There is just one image per person with the posted code, right?
But often there are several expression(=images) for the same character. How do I do this then?

Guest

Re: Character Avatars in Dialogue Box?

#6 Post by Guest » Fri May 29, 2009 9:06 am

Make a separate Character for each expression

i
ismile
imad
iangry

and use separate expression image for each

squiggs

Re: Character Avatars in Dialogue Box?

#7 Post by squiggs » Fri May 29, 2009 2:11 pm

Thanks, Tomoko; I was actually beginning to wonder the same thing.

As to why I was thinking about persistent avatars, the reason was because I am experimenting with some game feedback where the avatar would respond to things being said by characters displayed via the 'normal', behind the dialogue box, standing pose. (Man, I hope that made sense).

Thanks again for the help.

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Character Avatars in Dialogue Box?

#8 Post by Jake » Fri May 29, 2009 3:19 pm

Tomoko wrote: There is just one image per person with the posted code, right?
But often there are several expression(=images) for the same character. How do I do this then?
As it goes, when I was first learning Ren'Py I wrote a solution to this, which maintains a character's clothing and expressions statefully in the same class as the Character definition, because I was frustrated by exactly the same thing.

I was learning Python as I went and it hasn't been tested for about three years, so it might not even work any more, but if you're interested in having a look, it's here:

RPY file that includes new class
Programmer's reference
Demo project (with bonus old-Eileen sprite!)
Server error: user 'Jake' not found

User avatar
Tomoko
Regular
Posts: 37
Joined: Tue Mar 24, 2009 6:07 pm
Location: Germany, somewhere in NRW
Contact:

Re: Character Avatars in Dialogue Box?

#9 Post by Tomoko » Sat May 30, 2009 3:15 am

oh great! Just awesome! Will download it straightaway. Thank you. The thing with the clothing is great too. I think I am gonna test it for sure! ^__^

User avatar
Tomoko
Regular
Posts: 37
Joined: Tue Mar 24, 2009 6:07 pm
Location: Germany, somewhere in NRW
Contact:

Re: Character Avatars in Dialogue Box?

#10 Post by Tomoko » Mon Jun 01, 2009 9:54 am

Sorry for doublepost.

Do you mind to tell me with which Renpy Version I can have that demo run? I have the latest, but the programme doesn't want to execute it. I think that would help me to understand it XD

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Character Avatars in Dialogue Box?

#11 Post by Jake » Mon Jun 01, 2009 10:22 am

Tomoko wrote:Do you mind to tell me with which Renpy Version I can have that demo run? I have the latest, but the programme doesn't want to execute it. I think that would help me to understand it XD
Whatever was the current version approximately three years ago - I did have a quick go myself the other night, but now I look at the errors I'm getting vague memories of PyTom changing the way Character was implemented and me thinking at the time that it would probably break this... :/
Server error: user 'Jake' not found

User avatar
Tomoko
Regular
Posts: 37
Joined: Tue Mar 24, 2009 6:07 pm
Location: Germany, somewhere in NRW
Contact:

Re: Character Avatars in Dialogue Box?

#12 Post by Tomoko » Tue Jun 02, 2009 7:05 am

Well I guess it's okay then XD. I surely can learn just with this code to get the idea with the actual renpy version. Thanks alot again :)!But its surely quite difficult to differ from clothes, age and expression of each person.

Post Reply

Who is online

Users browsing this forum: Google [Bot]