In my game, I have a panelA that has checkboxes to toggle panels in panelA’s parent. It also has a Leave button which needs to make a call to the scene manager that only PanelA’s parent is aware of.
I’ve thought of:
- Making a listener just for this
- Have the parent make the PanelA and make its children so it has
access to them and can receive action events from them
Neither of these feel that clean. Would there be a better way?
My game uses a gui system that I made. Sending events up to the parent wouldn’t work because the parent does not know which gui components it’s looking to handle.
Thanks
It’s a bit hard to know without knowing the design of your system, but basically you don’t want to change checkboxes in the panel, but you want to change the state and have those checkboxes reflect the state.
Say you want to check a box for Vertical Blanking in your main-panel. Do do not want to do this
instead you want this
and in your “main panel”
Uhm.. very pseudocody, but hopefully you get the idea 🙂