How to setup tradtional Menu/Game Scenes #582
Replies: 1 comment
-
You're right that plugin is a sort of root controller, but in Fyrox it is more like a container for global application state. Every plugin has access to the default UI instance ( Also, the latest (nightly from GitHub) Fyrox contains UI scenes, that can be edited in the editor. These are essentially a container for a bunch of widgets, that can be saved/loaded, but they're also a completely different entity and does not overlap with standard game scenes and widgets cannot have scripts on them. I planned a tutorial about the UI and I'll start writing it as soon as I'll finish rewriting the FPS tutorial (probably a day more needed). Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I'm confused about how to make the traditional Menu/Game Scene setup. With other tools, like Godot, I can make a Menu Scene with its own UI. Then I could have a button like "New Game" which sends a message to the root controller, which will unload the Menu Scene and load the Game Scene (which also has its own UI).
The Fyrox "Plugin" feels like it should be the root controller, but that means the Menu/Game Scenes will need to be a "ScriptTrait", which is a problem because there is no "on_ui_message" method on ScriptTrait. The Fyrox tutorials all have you building your UI elements on the Plugin struct. So that means the Menu and Game "Scenes" actually need to be a Plugin, that way they can have their own UI and methods. The problem I have though, is how would you now handle loading/unloading these plugins? It seems like this was not the intended design. If so, that's a problem, because ScriptTraits can't have their own UI elements, which would not make any sense for a true Scene.
Beta Was this translation helpful? Give feedback.
All reactions