How do I show a character on top of the dialouge box??

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
User avatar
Arctic Tempest
Newbie
Posts: 9
Joined: Thu Sep 27, 2012 7:43 pm
Projects: Gemini:Shadow
Contact:

How do I show a character on top of the dialouge box??

#1 Post by Arctic Tempest » Sun Oct 14, 2012 1:07 am

How can I show my character on top of the dialouge box at the left without covering or interupting the dialouge???
Kinda like this...
Please help!
Attachments
random1.jpg

CheeryMoya
Miko-Class Veteran
Posts: 892
Joined: Sun Jan 01, 2012 4:09 am

Re: How do I show a character on top of the dialouge box??

#2 Post by CheeryMoya » Sun Oct 14, 2012 1:39 am

That's your basic sideimage. If you want one that can change expression and keep one defining block, here's the code I use:

Code: Select all

define p = Character('Protagonist',
                 color="#4169E1",
                 window_left_padding=210,
                 show_side_image=ConditionSwitch(
                 "express == 'sad'", "protagsad.png",
                 "express == 'surprised'", "protagsurprised.png",
                 "express == 'happy'", "protaghappy.png",
                 "express == 'angry'", "protagangry.png",
                 "express == 'blush'", "protagblushing.png",
                 "express == 'normal'", "protagnormal.png", xalign=0.0, yalign=1.0,
        )
    )
Replacing p for the phrase you want to use for your speaker, Protagonist for the name, and protag[expression].png for whatever names your files are. In dialogue, you code it like so:

Code: Select all

$ express = "sad"
p "What a lousy day."
"A box of pizza falls from the sky onto your lap."
$ express = "happy"
p "Whoa! I'm so happy right now!"
And the expression on the sideimage will change accordingly.

P.S. For future questions like these, please ask in the Ren'Py Questions and Announcements board. The Cookbook is for posting up code that can be used by others.

User avatar
Arctic Tempest
Newbie
Posts: 9
Joined: Thu Sep 27, 2012 7:43 pm
Projects: Gemini:Shadow
Contact:

Re: How do I show a character on top of the dialouge box??

#3 Post by Arctic Tempest » Sun Oct 14, 2012 3:31 pm

Thanks so much!
Sorry about posting it here...

User avatar
Cinto
Regular
Posts: 42
Joined: Sat Apr 27, 2013 11:36 pm
Tumblr: geckcellent.tumblr.com
Contact:

Re: How do I show a character on top of the dialouge box??

#4 Post by Cinto » Sun Apr 28, 2013 9:03 pm

A somewhat simpler method I found was this:

Code: Select all

define Cexpression = Character('Character name', window_left_padding=200,
                show_side_image=Image("Character_expression_portrait.png", xalign=0.0, yalign=1.0))
and then just define your character multiple times, each one with a different expression. The window_left_padding and x/yalign can be adjusted based on how big your image is.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot, zyric