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.
Hello! I'm having trouble centering text inside the textbox vertically in the newest version of Ren'Py. The instructions say to use 0.5 to center, but it doesn't appear to work if I use yalign, and if I use ypos, it moves it to 0.5 pixels instead of centering it. If I try using only yalign and delete ypos, I get an error. This is what the code looks like:
## The placement of dialogue relative to the textbox. These can be a whole
## number of pixels relative to the left or top side of the textbox, or 0.5 to
## center.
define gui.text_xpos = 300
define gui.text_ypos = 60
define gui.text_yalign = 0.5
## The maximum width of dialogue text, in pixels.
define gui.text_width = 790
## The horizontal alignment of the dialogue text. This can be 0.0 for left-
## aligned, 0.5 for centered, and 1.0 for right-aligned.
define gui.text_xalign = 0.0
This is what the result looks like. I'd like it to be centered vertically, whether it's one line or three lines of text. It currently only looks centered when there are two lines of text. Thank you for any help!
Last edited by shwippie on Mon Oct 03, 2016 3:41 pm, edited 1 time in total.