[SOLVED] Conditional "say" screen position changes

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
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

[SOLVED] Conditional "say" screen position changes

#1 Post by Chiligoat »

Hey everyone!
Hopefully an easy one: I want to change the place where the say screen appears (gui.textbox_yalign, and the gui.dialogue.xpos/ypos), depending on the speaker. For the protagonist, always up top (0). For anyone else, at the bottom (1.0).

But I cannot for the life of me figure out how to make Ren'py grab a variable (preferably just the single letter character-speaking/"who" variable?) and where to put that kind of check? I tried a couple of if conditions in the gui but couldn't make anything work. Is it because they're using a hard "define" instead of a "$"? Am I going about this the wrong way and should just make two separate new styles to try and append?
Last edited by Chiligoat on Sat Sep 21, 2019 7:08 pm, edited 1 time in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: Conditional "say" screen position changes

#2 Post by hell_oh_world »

Chiligoat wrote: Wed Sep 18, 2019 8:16 pm Hey everyone!
Hopefully an easy one: I want to change the place where the say screen appears (gui.textbox_yalign, and the gui.dialogue.xpos/ypos), depending on the speaker. For the protagonist, always up top (0). For anyone else, at the bottom (1.0).

But I cannot for the life of me figure out how to make Ren'py grab a variable (preferably just the single letter character-speaking/"who" variable?) and where to put that kind of check? I tried a couple of if conditions in the gui but couldn't make anything work. Is it because they're using a hard "define" instead of a "$"? Am I going about this the wrong way and should just make two separate new styles to try and append?
I haven't tried this, but this might work:

Code: Select all

define pro = Character("Protagonist", what_ypos=0.0)

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Conditional "say" screen position changes

#3 Post by philat »

Yeah, I'd prob use styles passed to a character rather than a check in the screen (although the latter is possible).

https://renpy.org/doc/html/dialogue.html#Character

Scroll down to Styling Text and Windows.

User avatar
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

Re: Conditional "say" screen position changes

#4 Post by Chiligoat »

@philat, @hell_oh_world: Thanks to both of you! A little bit of reading and fiddling later, I got everything to work out exactly the way I want it, and have some basic style understanding now. For others in the same position: I used "window_yalign" and "what_xpos" to adjust what I needed. Cheers!

Post Reply

Who is online

Users browsing this forum: Ocelot