[Solved] Centering text vertically?
Posted: Mon Oct 03, 2016 3:10 pm
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:
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!

Code: Select all
## 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