SFML community forums

Help => General => Topic started by: Bocaj on July 21, 2012, 12:20:54 am

Title: GUI Building
Post by: Bocaj on July 21, 2012, 12:20:54 am
How do most SFML users build a GUI?  Do they use some external GUI library, like Qt, or just use shapes and text, and wait for the user to click on them?
Title: Re: GUI Building
Post by: eXpl0it3r on July 21, 2012, 12:28:07 am
It completly depends on the size and needs for a GUI.
Qt is a good solution, if you don't want elements overlay the rendering section (e.g. no in game GUI). If you have just a few buttons then you most likely will write a small class on your own, otherwise if you want to use quite a few diffrent things (labels, buttons, slider, windows, etc.) then you most likly want to take a look at librarys explcitly build for SFML, like SFGUI  (http://sfgui.sfml-dev.de/)or TGUI (http://en.sfml-dev.org/forums/index.php?topic=7023.0), or use some more generic libraries like libRocket (http://librocket.com/) or GWEN (https://code.google.com/p/gwen/), for which you'll have to write your own little SFML renderer (except GWEN has one already). :)
Title: Re: GUI Building
Post by: Bocaj on July 21, 2012, 01:31:55 am
If I were to make my own GUI system, should I use shapes and text for labels, buttons, slider, windows, etc.?  Or is there some better way?
Title: Re: GUI Building
Post by: eXpl0it3r on July 21, 2012, 02:00:58 am
That's completly up to you. 'Good' and 'bad' are defined only by you. ;)
The BREW renderer of SFGUI uses only shapes, lines and texts for rendering their GUI. This of course has its downside that you can't have nicely polished GUI elements. So use whatever makes more sense to you and is easier to implement while still fitting your needs. :)