Hello fellow Renpy users.
I have 2 questions concerning the menu choices buttons.
When the choices appear the buttons are placed by default around the center of the window.
1.How can we change the placement of menu buttons?
like with the attached picture i want the menu buttons to appear on the characters head instead of in-front.
2.How to shrink the buttons length?
Right now it is a very long blue box, if one wants it to be shorter or the same fit as the text inside.
Positioning in game menu buttons
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.
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Positioning in game menu buttons
use screen choice in screens.rpy file:
https://www.renpy.org/doc/html/screen_s ... tml#choice
Code: Select all
screen choice:
window:
style "menu_window"
xalign 0.5 ##<< to change the placement of menu
yalign 0.5 ##<<
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
xysize(300,10) ##<<add this for changing the size of buttons
text caption style "menu_choice"
else:
text caption style "menu_caption"
Re: Positioning in game menu buttons
IrinaLazareva wrote:use screen choice in screens.rpy file:
https://www.renpy.org/doc/html/screen_s ... tml#choiceCode: Select all
screen choice: window: style "menu_window" xalign 0.5 ##<< to change the placement of menu yalign 0.5 ##<< vbox: style "menu" spacing 2 for caption, action, chosen in items: if action: button: action action style "menu_choice_button" xysize(300,10) ##<<add this for changing the size of buttons text caption style "menu_choice" else: text caption style "menu_caption"
Thank you friend.
it works i can widen and shorten the buttons also.
but all the other menu buttons show up in that position, how can i do it for this particular menu only. leaving the others in default position?
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Positioning in game menu buttons
jadeon12 wrote: but all the other menu buttons show up in that position, how can i do it for this particular menu only. leaving the others in default position?
I supose that there is simpler decision...
anyway, in screens.rpy:
Code: Select all
screen choice:
window:
style "menu_window"
if gala:
xalign 0.9 ##<< special menu
yalign 0.5 ##<< special menu
else:
xalign 0.5 ##<< simple menu
yalign 0.5 ##<< simple menu
#....
Code: Select all
define gala = False
label start:
menu:
"this is a simple menu"
"choise 1":
pass
"choise 2":
pass
$ gala = True
menu:
"and that is the special menu"
"choise 3":
pass
"choise 4":
pass
$ gala = False
menu:
"a simple menu, again"
"choise 5":
pass
"choise 6":
pass