How to align text to the right in a vbox?

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

How to align text to the right in a vbox?

#1 Post by henvu50 »

How do I right align text like this in a vbox?

Image

Code: Select all

            vbox:
                xpos 100
                ypos 100

		# how do I right align the following text in the picture?
                text "Joe:"
                text "Bob:"
                text "Kathy:"
                text "Kate:"
                text "Larry:"

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How to align text to the right in a vbox?

#2 Post by henvu50 »

n/m, here is solution:

Code: Select all

            vbox:
                xpos 100
                ypos 100

		# how do I right align the following text in the picture?
                text "Joe:" xalign 1.0
                text "Bob:" xalign 1.0
                text "Kathy:" xalign 1.0
                text "Kate:" xalign 1.0
                text "Larry:" xalign 1.0
Is there a better way to do the align for all the items in a vbox instead of spamming xalign 1.0 to the right of each text?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to align text to the right in a vbox?

#3 Post by Imperf3kt »

You can create a style which contaings the xalign, and make the text use that style
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]