I don’t have to make two separate scripts that talk to each other by passing messages
script shared state exists and largely makes this not needed. why is this not possible here?
Is there any significant disadvantage I haven’t thought of here, or does anyone else do this in their projects?
the biggest benefit gui has right now is that you can do it all in code with next to no setup, which makes it realistically the only option for some applications (eg, dynamic code which generates dynamic UI). Currently, you cannot attach components to GOs which have already been created*, nor can you create prototypes at runtime*, nor make copies of a GO without a factory either*. In order to replicate the behavior of new_box_node or new_text_node, you have to separately create GOs with relevant properties (eg, a sprite or label) before compilation and make.
there’s also render convenience, GUIs are always drawn on top of everything else and will always remain locked to the screenspace and you won’t have to mess with render scripts to get the same behavior
i guess there’s also gui.pick_node, too, which is a very nice function to have to use for interactions that i don’t think there’s an equivelent for that with GOs without making your own function
other miscellaneous reasons for using GUI:
- pivots, which are useful for laying out components.
- gui has clipping modes, which can only be done with shaders in sprites*
- setting textures during runtime is far easier in gui than go (niche applications).
*to my knowlege, this may not be true,