[SOLVED] Trying to keep the namebox centered even with longer 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
User avatar
Elta
Regular
Posts: 72
Joined: Sun Jun 02, 2019 6:28 pm
Tumblr: limitelta
Deviantart: limitelta
itch: limitelta
Contact:

[SOLVED] Trying to keep the namebox centered even with longer names.

#1 Post by Elta » Sun Sep 15, 2019 10:58 am

So I'm trying to center my name box and it worked.... I used "xpos 0.45" because 0.5 didn't center it.
Image
However if the name is longer then the namebox starts to just grow to the right.
Image
Is there a way to make it stay centered no matter the length of the name?
Thank you for any help! 💗
Last edited by Elta on Sun Sep 15, 2019 11:38 am, edited 2 times in total.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Trying to keep the namebox centered even with longer names.

#2 Post by namastaii » Sun Sep 15, 2019 11:31 am

xpos is more for pixel location (xpos 356) etc
xalign is 0-1 with 0.5 being the center so you'll want to use that instead
you can also use text-align 0.5 for centered text

User avatar
Elta
Regular
Posts: 72
Joined: Sun Jun 02, 2019 6:28 pm
Tumblr: limitelta
Deviantart: limitelta
itch: limitelta
Contact:

Re: Trying to keep the namebox centered even with longer names.

#3 Post by Elta » Sun Sep 15, 2019 11:35 am

namastaii wrote:
Sun Sep 15, 2019 11:31 am
xpos is more for pixel location (xpos 356) etc
xalign is 0-1 with 0.5 being the center so you'll want to use that instead
you can also use text-align 0.5 for centered text
Thank you so much! Now I get what I'm doing wrong and I understand enough to not make the same mistake again! Really appreciate your help! 😄

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: [SOLVED] Trying to keep the namebox centered even with longer names.

#4 Post by namastaii » Sun Sep 15, 2019 11:39 am

No problem :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]