Tabbed gui - multiple .gui files, layers, clone?

I am looking at building the classic “character” screen that will have multiple tabs for the stats, inventory, and equipment. Currently I am using a parent gui (character_screen.gui) and then a .gui for each of the tabs to which I init with a msg.post("/url", "disable) except for the first entry tab.

The character_screen.gui contains the main screen with the buttons for the tabs and each tab has a corresponding gui that I cycle through and enable/disable based on the button that is clicked.

Is this the appropriate way to handle this tabbed gui? I want to compartmentalize the different screens so that the code can be minimal per (could always build modules to make it manageable).

Is there a performance hit for multi gui files that are enabled/disabled?

Each gui scene will result in at least a separate draw call. You will also have one gui script per scene and depending on the content it could also affect performance.

In general this shouldn’t be a problem for something like a character screen. There really isn’t much going on that could tank performance. Be wary of drawcalls and make sure to use layers to keep them in check.

So layers is the preferred way for most guis that have multiple views to it to reduce the draw cycles.

Thanks

No, layers are used to group nodes (within a gui) of the same type and with same kind of settings to batch the draw calls. Check the gui docs for more info!