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.
I have an area on screen where I plan to show the player's total money (iu, for interstellar unit), the number appears inside a screen with the background hidden to show the graphic beneath, but the number increases justified to the left and I'd like it justified to the right. Does justifying text in a screen simply not work when there's only one line of text? Also, un-hashing the last bit of code does not solve the problem. Not a super big problem, but it's annoying. Please help?
Is the vbox resizing or are there other items in that vbox to lock its width? Maybe use the area (xpos, ypos, width, height) style on the vbox.
Anyway:
screen default_moneyscreen():
default iu = 100
zorder 101
frame:
background None
xalign 0.138 ypos 8
vbox:
text "{size=25}[iu: 5d]{/size}": # format pad
color "#ebf5e5"
xalign 1.0 # align the right edge of the text to the right side of the vbox
xanchor 1.0
textbutton "+10" action SetScreenVariable(name='iu', value=iu+10)
textbutton "-10" action SetScreenVariable(name='iu', value=iu-10)
textbutton "+1000" action SetScreenVariable(name='iu', value=iu+1000)
textbutton "-1000" action SetScreenVariable(name='iu', value=iu-1000)
Probably best to set a width to the vbox and use xanchor and xalign.
Note: You can use format inside [] ( the : 5d means make the integer 5 characters wide, padded with spaces, :06d would zero pad to 6 digits). Probably more useful for zeros than spaces unless using monospaced fonts