How should one approach managing different hud menus?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By KijeviGombooc

In my game I want the 3d game world to be present in most (but not all) menus, like settings, gameplay, game-over-menu (but not in shop menu for example).
I was thinking of creating each menu separately then having a “HUD manager” script handle which menu should be active.
Is there a better way to do this?
Also there are ui elements that shoudl be present in mroe than 1 menus, for eample the money.
I feel like putting them all in 1 scene and activating elements (or groups of them) would be a mess.
What is the best way to implement this?

:bust_in_silhouette: Reply From: Magso

I’d approach this by having ‘HUD manager’ as a new scene then parent shared items in a control node. Have all the other menus under control nodes also and reorder them so the ‘shared items’ control node is at the bottom so it will be on top of the other menus, from there you can then toggle their visibility and use if menuexample.visible: to activate them.

And how would you approach connecting them to signals? For example, I have a label that shows coins, that should should be increased whenever “coin picked up” signal is emitted.

KijeviGombooc | 2020-05-25 17:09

The signal would be connected to the coin, reference the HUD manager and add the coin’s value to a variable on the HUD manager.

Magso | 2020-05-25 17:40