Ren'py - tabs in menus

bobby bates

New Member
Sep 16, 2018
14
2
Hello,

I have tried doing a few searches online but I think im not using the correct keywords to get what I want. Does anyone know how to achive tabs in menus like the screen shot below from a game called melody?

Capture1.PNG

I really like this tab feature and would like to build one my self. If anyone can point me in the right direction I would be most grateful.

Regards
Bobby
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,498
7,099
There are several different ways of doing it.

One of the easiest is to have a separate screen for each "tab". Position the "tab name" list across the top using an hbox. For the tabs NOT corresponding to the current screen, put in a textbutton that does a "Show" of the screen for that tab. For the tab that DOES correspond to the current screen, put in just a text, but style it the same way the text buttons are (for font and size) and then color it. You can do this individually on each screen, or else have the menu be in a sub-screen that you "use". (Pass in a parameter so that the sub-screen knows which tab is active.)

Have all the screens "tag"ged with the same value. That way, when you Show a new screen, it replaces the previous one instead of showing it on top of the current screen.

Then, in the body of each screen, code whatever you need.

This is basically the way the Save/Load/Preferences/etc stuff works - they all use the same menu and layout, so it looks like you're only replacing the non-menu parts, but, in fact, each one is a completely different screen in Ren'py.