Dropdown menu code?
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.
Dropdown menu code?
Has anyone written a collapsible dropdown menu system you wouldn't mind sharing? For example: Edit > Text > Font > Size > 12
I've only found two snippets of possible dropdown code and they're not working correctly (even after messing with them).
viewtopic.php?t=26883
viewtopic.php?t=48981
From all the threads I've read in my search, it seems like this would be useful to a lot of people!
I've only found two snippets of possible dropdown code and they're not working correctly (even after messing with them).
viewtopic.php?t=26883
viewtopic.php?t=48981
From all the threads I've read in my search, it seems like this would be useful to a lot of people!
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Dropdown menu code?
eath wrote: ↑Tue Jul 21, 2020 9:46 amHas anyone written a collapsible dropdown menu system you wouldn't mind sharing? For example: Edit > Text > Font > Size > 12
I've only found two snippets of possible dropdown code and they're not working correctly (even after messing with them).
viewtopic.php?t=26883
viewtopic.php?t=48981
From all the threads I've read in my search, it seems like this would be useful to a lot of people!
You can make a simple dropdown menu like this.
Code: Select all
default closed=True
screen drop():
vbox:
frame:
if closed:
textbutton "Menu" action SetVariable("closed", False)
elif closed==False:
textbutton "Menu" action SetVariable("closed", True)
if closed==False:
frame:
vbox:
text "text1"
text "text2"
text "text3"
text "text4"
text "text5"
Re: Dropdown menu code?
Per K Grok wrote: ↑Tue Jul 21, 2020 12:56 pm
You can make a simple dropdown menu like this.
Code: Select all
default closed=True screen drop(): vbox: frame: if closed: textbutton "Menu" action SetVariable("closed", False) elif closed==False: textbutton "Menu" action SetVariable("closed", True) if closed==False: frame: vbox: text "text1" text "text2" text "text3" text "text4" text "text5"
Thank you Per K Grok! I'm going to see if I can dynamically populate the buttons using an ordereddict and post it here.
One question: if there's another menu a few pixels south of this, is there a way to "push" it down further temporarily while this menu is open?
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Dropdown menu code?
If you add a frame below the dropdown frame like this. The lower frame will move along with the dropdown frame.eath wrote: ↑Tue Jul 21, 2020 3:42 pm
----
Thank you Per K Grok! I'm going to see if I can dynamically populate the buttons using an ordereddict and post it here.
One question: if there's another menu a few pixels south of this, is there a way to "push" it down further temporarily while this menu is open?
Code: Select all
screen drop():
vbox:
frame:
if closed:
textbutton "Menu" action SetVariable("closed", False)
elif closed==False:
textbutton "Menu" action SetVariable("closed", True)
if closed==False:
frame:
vbox:
text "text1"
text "text2"
text "text3"
text "text4"
text "text5"
frame:
vbox:
text "textA"
text "textS"
text "textD"
text "textF"
text "textG"
Who is online
Users browsing this forum: Bing [Bot], span4ev