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.
screen input(prompt):
window:
xalign 0.5 #Centered Across
yalign 0.5 # 75% Down from Top
has vbox
text prompt:
yoffset 5
style "say_dialogue"
xoffset 10
input:
id "input"
style "input"
color "#FFFFFF" # Color of Input Text
yoffset 5
xoffset 10
I've been tweaking it for who knows how long at this point. yalign has been working as intended but xalign just won't do anything. If I set xalign to 0, it will be on the left side of the screen. If I set xalign to 1 and above, it still stays on the left side of the screen.
I'm not sure what could be causing the problem at this point. I've tried commenting out other xaligns in the code to see if it's being overridden maybe, but that doesn't seem to be the case. Any other ideas of what to check would be appreciated.
I don't know if it'll help any, but this is the text I was trying to center in the first place:
screen input(prompt):
window:
xmaximum 400 #this value is in pixels, you may need to change it to match the size of whatever your dialogue box's actual width is
xalign 0.5
yalign 0.5
has vbox
#rest of code....
The value of 400 pixels will probably need to be changed to better fit the actual properties of your dialogue box.
jw2pfd wrote:My best guess is that the window is stretched to be the full width of the screen. You can try adding a xmaximum value to the window like this:
screen input(prompt):
window:
xmaximum 400 #this value is in pixels, you may need to change it to match the size of whatever your dialogue box's actual width is
xalign 0.5
yalign 0.5
has vbox
#rest of code....
The value of 400 pixels will probably need to be changed to better fit the actual properties of your dialogue box.