Is there a way to relocate menu choices on a per screen basis?
Yes.
By default, when you use
menu:
it uses the
screen choice():
as defined within the
screens.rpy
file.
But you can override things for specific
menu:
statements to use a different screen or to pass parameters to the
choices
screen. (for example, you could pass it a set of coordinates for where you want the menu to appear, but let those default to the current location if you don't specify them).
I'm only going to describe the "use a different screen" solution though, as I think it's simpler when you're just starting out.
So first, I create my "alternative" choices menu. I'm going with the imaginatively named
alt_choice
.
Python:
screen alt_choice(items):
style_prefix "alt_choice"
vbox:
for i in items:
if i.action:
if i.kwargs and i.kwargs.get( "enabled" ) is False:
textbutton i.caption action NullAction() sensitive False
else:
textbutton i.caption action i.action
else:
textbutton i.caption
style alt_choice_vbox is vbox
style alt_choice_button is button
style alt_choice_button_text is button_text
style alt_choice_vbox:
xalign 0.1
ypos 270
yanchor 0.5
spacing gui.choice_spacing
style alt_choice_button is default:
properties gui.button_properties("alt_choice_button")
style alt_choice_button_text is default:
properties gui.button_text_properties("alt_choice_button")
All I have done is copy the existing
screen choice():
and alter the
xalign
for the
vbox
to be 0.1 instead of 0.5. This means the menu choices appear nearer the left edge of the screen rather than in the middle. You, of course, could alter it in any way you like.
Edit: Actually, it's not exactly the same as the "normal" choices screen. But you get the idea.
Now... when I want to use this alternative menu, I just need to code things to say "use THIS menu screen, instead of the normal one".
Python:
menu (screen="alt_choice"):
"Option 1":
"You picked option 1."
"Option 2":
"You picked option 2."
"Option 3":
"You picked option 3."
return
There's a whole lot of new things you need to learn about
You must be registered to see the links
in order to customize things. But this is the basics on how to start.