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.
-
johandark
- Veteran
- Posts: 346
- Joined: Sat Apr 30, 2016 11:04 am
- Completed: Wild Guards, In Dreams
- Projects: Pact with a witch
- Deviantart: johandarkweb
- Location: Barcelona
-
Contact:
#1
Post
by johandark » Fri Jul 28, 2017 11:43 am
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!
-
johandark
- Veteran
- Posts: 346
- Joined: Sat Apr 30, 2016 11:04 am
- Completed: Wild Guards, In Dreams
- Projects: Pact with a witch
- Deviantart: johandarkweb
- Location: Barcelona
-
Contact:
#2
Post
by johandark » Tue Aug 01, 2017 4:32 pm
Is it not possible? :S
-
Alex
- Lemma-Class Veteran
- Posts: 2981
- Joined: Fri Dec 11, 2009 5:25 pm
-
Contact:
#3
Post
by Alex » Tue Aug 01, 2017 5:36 pm
It's definitelly possible. If you use a new gui, then in gui.rpy find this line
Code: Select all
## The spacing between menu choices.
define gui.choice_spacing = 22
If you use legacy theme, then you need to modify choice screen a bit: in screens.rpy find the part anout choice screen
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.
https://www.renpy.org/doc/html/python.h ... statement
-
carrot
- Regular
- Posts: 28
- Joined: Fri Jul 28, 2017 7:43 am
-
Contact:
#4
Post
by carrot » Tue Aug 01, 2017 5:39 pm
You can change the Y position of the choice section by changing "ypos" in the "choice screen" section of screens.rpy:
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
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):
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
Although obviously you'll want to work out a better value, the formula I've used is just to demonstrate that it works.
Users browsing this forum: Bing [Bot]