(Solved)How to center choice text?

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
Ace94
Regular
Posts: 113
Joined: Sat Apr 08, 2017 4:22 pm
Contact:

(Solved)How to center choice text?

#1 Post by Ace94 »

Hi. I was wondering how can I make a text on a multiple choices be centered depending on the other choice'd text?

Like having this choice Investigate be centered instead of aligned to the left, but leave the second choice like it is?
Last edited by Ace94 on Wed Nov 15, 2017 3:57 pm, edited 2 times in total.

Ace94
Regular
Posts: 113
Joined: Sat Apr 08, 2017 4:22 pm
Contact:

Re: (Solved)How to center choice text?

#2 Post by Ace94 »

I figured it out.

I had to add xalign 0.5 in here:

Code: Select all

    vbox:
        for i in items:
            textbutton i.caption action i.action xalign 0.5

Ace94
Regular
Posts: 113
Joined: Sat Apr 08, 2017 4:22 pm
Contact:

Re: (Solved)How to center choice text?

#3 Post by Ace94 »

After further testing this did not work in the long run. Some of the screens have totally different alignments and I don't understand why.

I even used this:

Code: Select all

style choice_vbox:
    xalign 0.5
    xanchor 0.5
    ypos 100

    spacing gui.choice_spacing
xanchor worked but not in combination with me adding xalign in the textbutton in the previous comment.

But some of the choices move even with this in mind. I'm open to any suggestions if someone has any.

edit: So apparently xalign in the style choice_vbox is what caused the issues. I put xanchor on the textbutton and I changed style choice_vbox from xalign and xanchor to xpos 1000 and it did the trick.

Post Reply

Who is online

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