Ren'Py: Hamburger Quick Menu (implementation)


Since I got asked about the hamburger for the quick menu buttons, I'm sharing my code here. As it's not so long ago that I've started learning Ren'Py, I can't guarantee that it is the best way to implement this. I mainly pieced it together from different topics on Ren'Py forums on how to implement a GUI with extra screen popping out. The logic can be used for any type of screen element.

The edits are done in screens.rpy, and mainly consist of four parts:

[1] Add boolean variable to remember the state of the hamburger (whether it is open or closed). Do this at the start of script.

[2] Editing the existing screen quick_menu()

[3] Add a new screen with the content in the hamburger, in this case: the quick buttons. I called this screen quick_buttons().

[4] style definitions for the buttons








Files

TheSnowpersonDemo-1.0.1-mac.zip 142 MB
Jan 03, 2022
TheSnowpersonDemo-1.0.1-linux.tar.bz2 148 MB
Jan 03, 2022
TheSnowpersonDemo-1.0.1-win.zip 159 MB
Jan 03, 2022

Get The Snowperson [Demo, Winter VN Jam 2021]

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

Hi, I'm using the code for something similar to this. But I'd like to hide it during certain scenes. Is there any way to hide it manually as needed?

Do you mean force-shrink the menu hamburger at certain story moments (f.e. CGs)? quick_menu_is_open is a newly added Ren'Py variable, so you should be able to easily control its value in Ren'Py scripts where you want it to happen.

Force shrink hamburger:

$ quick_menu_is_open = False

Force open hamburger:

$ quick_menu_is_open = True 

---

Or if you mean hiding everything that has to do with quick menu buttons.

The big button's visibility is controlled by the quick_menu variable (I kept the same name as Ren'Py's default), and right now the 6 quick buttons are separate from this. This is my first project and it's been ages, but I've now rechecked and notice that it is a bit of oversight to not write the following check in screen quick_buttons() in the following way:

if quick_menu_is_open and quick_menu:

 By applying this change, then you can use these following statements.

Force hide quick buttons:

$ quick_menu = False

Force show quick buttons:

$ quick_menu = True