choice buttons minimmumY Spacing is posible?
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.
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.
- johandark
- Veteran
- Posts: 355
- Joined: Sat Apr 30, 2016 11:04 am
- Completed: Wild Guards, In Dreams
- Projects: Pact with a witch
- Deviantart: johandarkweb
- Location: Barcelona
- Contact:
choice buttons minimmumY Spacing is posible?
Is the a posibility to put higher the choice buttons so it doesn´t go over the text below? Like a minimmum Y where questions can´t go lower...
Also would be nice to have the ability of space between questions would be variable depending on the space available... I don´t know if it´s possible...
Thanks!
Re: choice buttons minimmumY Spacing is posible?
It's definitelly possible. If you use a new gui, then in gui.rpy find this line
If you use legacy theme, then you need to modify choice screen a bit: in screens.rpy find the part anout choice screen
https://www.renpy.org/doc/html/python.h ... statement
Code: Select all
## The spacing between menu choices.
define gui.choice_spacing = 22
Code: Select all
screen choice(items):
window:
style "menu_window"
xalign 0.5
yalign 0.5
vbox:
style "menu"
spacing 2 # <--- change the number to some variable, and don't forget to set it using define statement
etc.
Re: choice buttons minimmumY Spacing is posible?
You can change the Y position of the choice section by changing "ypos" in the "choice screen" section of screens.rpy:
To get dynamic spacing, you can remove the 'spacing gui.choice_spacing' line from the section above, and instead specify the spacing in this section (this section is just above the previous section):
Although obviously you'll want to work out a better value, the formula I've used is just to demonstrate that it works.
Code: Select all
style choice_vbox:
xalign 0.5
ypos 275 # change this, a lower number will place it higher on the screen
yanchor 0.5 # you can also change this if you want to position from the top of the box, rather than the middle
spacing gui.choice_spacing # REMOVE THIS LINE
Code: Select all
screen choice(items):
style_prefix "choice"
$ space = 50 / len(items) # calculate spacing depending on the number of items
vbox spacing space: # specify that spacing when creating the vbox
for i in items:
textbutton i.caption action i.action
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], RandomHuman64