Hello everyone,
I've reached, in a recent project, the point where I must develop a HUD/GUI.
So I was wondering, how to correctly implement it?
Right now the solution I'm trying to build is:
- Creating a base class from which each widget like buttons, sliders (and so on) will inherit
- Creating a HUD/GUI class which will contain all the widget currently displayed, create them and draw them
- The HUD/GUI class could handle the widgets' informations, I mean when I click on a button, the information will be sent to the HUD/GUI container class which will perform an action according to the message received
But I guess there are plenty of flaws by this method. So I thought that the HUD could be build as a single class with a vertex array, but I have no clue how to handle the "widgets" this way...
So I was wondering, is my first idea good and how can I improve it?Is the second method better? or should I process in a totally other way?
Anyway, thanks a lot for hearing my request