How can I center names?

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
SLim_Games
Newbie
Posts: 23
Joined: Tue Mar 20, 2018 11:37 am
itch: slim-games
Contact:

How can I center names?

#1 Post by SLim_Games »

Hi,

My problem is:
I have a name input of 9 letters and when I display it I want the name to be in the center of a namebox (the box is just an image).
It fills nice with 9 letters:
renpy.JPG
But if the player chooses a short name it looks like this:
renpytwo.JPG
How can I make the name appear always in the center?
I know that you can center the spoken text with what_xalign=0.5, what_textalign=0.5, what_layout='subtitle' ... but I have no idea how it works with names.

Any help?

-cheers Slim
Play my game (nsfw) for free at: https://www.patreon.com/SLim_Games

SLim_Games
Newbie
Posts: 23
Joined: Tue Mar 20, 2018 11:37 am
itch: slim-games
Contact:

Re: How can I center names?

#2 Post by SLim_Games »

Ok, I found it out.
In case someone wants to do it too:
Go into your gui.rpy file and search for: define gui.name_xalign
Change it to:

Code: Select all

define gui.name_xalign = 0.5
Play my game (nsfw) for free at: https://www.patreon.com/SLim_Games

Post Reply

Who is online

Users browsing this forum: Belgerum, Google [Bot]