Been working on my Game. I finally got about 2-3 hours free to quickly hack a GUI Manager for the game. Oh boy, It works amazing as hell.

I initialize it as:

image

So I can now create HUDs which in-turn consists of Buttons and Basic UI Blocks. I have also added a CanRender() and CanUpdate() to each of them so It is easy to control what elements are to be visible in the HUD at a given time. Also the UIManager controls all the HUDs and plays a key role in rendering only those HUDs which are render-able (HUDs also have their own CanRender() 🙂 ), This way I can have Multiple HUDs faster and cleaner.

This is how the Inheritance is flowing:

image

Wait there is still stuff left!

I have yet to code the Scene and SceneDirector, So for eg:

Settings Scene

  • will have 1 UIManager
  • will have multiple HUDs
  • each HUD will correspond to a Particular Setting say Display, Sound etc.

The SceneDirector will be responsible for loading the Scene “Settings,” this scene will probably inherit from an Interface (IScene) and SettingsScene will have the Click Events and other Related variables (like strings etc) for that Scene only.

Sounds a bit complex but easy to Implement if given a thought.