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.
screen about():
tag menu
use game_menu(_("About"), scroll="viewport"):
style_prefix "about"
vbox:
label "[config.name!t] v.[config.version!t]\n" xalign 0.5
if gui.about:
text "[gui.about!t]\n" xalign 0.5
text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]") xalign 0.5
I also tried replacing the 'xalign 0.5' with 'at truecenter' or just' center' but that didn't work either. It showed up at the right side of the screen.
I also want to center the text overall
like here
but I couldn't find any solution.
Is there even a way to center text in the about section? I'm pretty sure there is I just don't know how.
xalign is always relative to the container.
Here you have label and text inside a vbox. So your xalign 0.5 probably is working Ok: centering the elements inside the vbox. The vbox is not centered in its container. What is the vbox container? The vbox is inside another screen (see the "use"). So you need to go to the game_menu screen and see what container is the vbox in, and maybe what container is that container in... And so on.
Hm, ok, i was bit rushy, this code will work if external container take up screen area (either fixed or have xfill True) and not just big enough to contain this vbox.
Hm, ok, i was bit rushy, this code will work if external container take up screen area (either fixed or have xfill True) and not just big enough to contain this vbox.
vbox:
xfill True ## make vbox take all available horizontal space
text "left"
text "center" xalign 0.5 ## can be other value, not just in 0.0-1.0 range
text "right" xalign 1.0
Also if you have large text and want to center every line of this text it is: