SFML community forums
Help => General => Topic started by: Resethel on July 24, 2015, 08:51:15 pm
-
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 :)
-
It's a rather abstract topic and I'm not sure you explained your idea well enough for others to understand it in-depth.
-
If you would like to use an existing library, SFGUI is an option:
http://sfgui.sfml-dev.de/
-
Here's a quick in dirty setup I threw together a bit ago. It relies heavily on sfml, you might be able to use it as base to get working on your message passing thing you were talking about. https://bitbucket.org/Verrazano/sassy