GUI system improvements
GUI system improvements
hi, just comments, questions and suggestions on the gui engine.
questions:
- is the gui system still at beta?
- are its interface definitions set in stone?
- how do you guys custom draw your controls?
comments:
- bug. focus gets lost. sometimes the all the controls become inaccessible like some invisible modal screen is preventing interaction
- pretty limited in skinning. other than changing the colors, fonts, there's no way of customizing its look other than recoding and recompiling the engine
- there are missing sensible methods in interfaces like
button->getState(), button->getFont(), button->getIcon() ... these would have allowed me to draw the button myself
suggestion:
- separate the rendering from the ui logic... or at least allow provide something like RenderListener->onDraw() to allow owner drawn controls
- image based rendering
With the limitations of the gui system, I was thinking of using CEGUI. but it feels too heavy with freetype and pcre. The current system would suit my limited needs if only I could custom draw the controls.
regards
questions:
- is the gui system still at beta?
- are its interface definitions set in stone?
- how do you guys custom draw your controls?
comments:
- bug. focus gets lost. sometimes the all the controls become inaccessible like some invisible modal screen is preventing interaction
- pretty limited in skinning. other than changing the colors, fonts, there's no way of customizing its look other than recoding and recompiling the engine
- there are missing sensible methods in interfaces like
button->getState(), button->getFont(), button->getIcon() ... these would have allowed me to draw the button myself
suggestion:
- separate the rendering from the ui logic... or at least allow provide something like RenderListener->onDraw() to allow owner drawn controls
- image based rendering
With the limitations of the gui system, I was thinking of using CEGUI. but it feels too heavy with freetype and pcre. The current system would suit my limited needs if only I could custom draw the controls.
regards
Re: GUI system improvements
I'd say the GUI is far from being finished, but it is quite workable at present.m4rvin wrote: questions:
- is the gui system still at beta?
- are its interface definitions set in stone?
- how do you guys custom draw your controls?
The interface definitions aren't set in stone, we're open to criticism, suggestions, patches, etc
You can create your own skin to override all kinds of drawing methods.
This was a bug with the listbox and is now fixed in SVN, there's a topic about it somewherem4rvin wrote: comments:
- bug. focus gets lost. sometimes the all the controls become inaccessible like some invisible modal screen is preventing interaction
Simply implement an IGUISkin and pass it to the gui env via setSkin.. I guess it could even be 3D and use it's own scene manager, however, this hasn't been tested - there are some elements that do 2d calls rather than using the skin (IGUIListBox and IGUIContextMenu are examples), and most things draw directly using their font, which is also bad. People have successfully made bitmap skins in the past though, one is posted in the project announcements forumm4rvin wrote: - pretty limited in skinning. other than changing the colors, fonts, there's no way of customizing its look other than recoding and recompiling the engine
getState is isPressed(). I put a lot of the get methods in earlier today. I think I must have missed IGUIButtonm4rvin wrote: - there are missing sensible methods in interfaces like
button->getState(), button->getFont(), button->getIcon() ... these would have allowed me to draw the button myself
edit: I've added a couple more getter methods to IGUIButton, but I think the font stuff should probably be moved to a new base class for text based gui elements - something that allows a font and its colour to be set, and later, possibly size and other options too.
or maybe this should be in IGUIElement to keep it simple (like for example, not all elements need setText) what do other people think?
we would actually need the getState() method to know whether the button is hovered.
bitplane, i read from another thread that you're looking for ideas for the gui system. i suggest you browse through the XUL or XAML references as they are future of GUI systems
one good method for skinning/theming controls is to treat everything as boxes. a button is a box, a text edit is a box, a list item is a box...
each box has a generic theme structure
struct theme_t {
borders,
borderColors
borderStyle
margins,
paddings,
color,
backgroundColors,
backgroundImage,
}
a button could have four themes for the four states
a generic structure would also allow you to define new controls and new themes without having to add a new ENUM_XXX_BORDER_COLOR
good luck

bitplane, i read from another thread that you're looking for ideas for the gui system. i suggest you browse through the XUL or XAML references as they are future of GUI systems
one good method for skinning/theming controls is to treat everything as boxes. a button is a box, a text edit is a box, a list item is a box...
each box has a generic theme structure
struct theme_t {
borders,
borderColors
borderStyle
margins,
paddings,
color,
backgroundColors,
backgroundImage,
}
a button could have four themes for the four states
a generic structure would also allow you to define new controls and new themes without having to add a new ENUM_XXX_BORDER_COLOR
good luck
Game ui's are often hard to create with the usual UI toolkits. Just a few examples where game ui's are often very different from typical applications:
- UI elements have often unusual shapes
- The whole borders stuff is often done with bitmaps to fit in with the background
- gui-elements are often animated
- Speed is very critical. I've already experienced this problem with more complex toolkits, which did for example not care about needing several second to show a complex dialog. In games even half a second can sometimes be way too much
So we should be careful not to look to much on other UI systems, but really concentrate a lot on games. CEGUI, which is certainly a very excellent UI-lib, did for example not concentrate that much about games imho. For that reason i dropped that lib after trying it out and decided to stay with the irrlicht UI, which might offer less features when it comes to themes, but is easier to modify and use and therefore i found it simpler to create gamedialogs with it.
I certainly know that irrlicht is not just used in games. But thats the main target audience. And right now I could for example not name a single game which does use themes.
- UI elements have often unusual shapes
- The whole borders stuff is often done with bitmaps to fit in with the background
- gui-elements are often animated
- Speed is very critical. I've already experienced this problem with more complex toolkits, which did for example not care about needing several second to show a complex dialog. In games even half a second can sometimes be way too much
So we should be careful not to look to much on other UI systems, but really concentrate a lot on games. CEGUI, which is certainly a very excellent UI-lib, did for example not concentrate that much about games imho. For that reason i dropped that lib after trying it out and decided to stay with the irrlicht UI, which might offer less features when it comes to themes, but is easier to modify and use and therefore i found it simpler to create gamedialogs with it.
I certainly know that irrlicht is not just used in games. But thats the main target audience. And right now I could for example not name a single game which does use themes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
yes, but...
on speed and features:
- a game's gui is as important as any feature of the game
- you don't have to sacrifice speed to improve the gui system
on theming:
- any game that uses cegui is infact using a theme to define the look
- irr gui also provides themes with IGUISkin
- the whole point of theming is not provide to players the ability to change the game's theme. but it is there to help developers quickly create custom gui
irr ui:
- the current irr UI is indeed very easy to understand and modify. but right now, in order to use a simple button with a background image, you'd have to create a new control yourself or modify and recompile the engine
- you can create your own IGUISkin implementation... but you can't custom draw a hovered button
on speed and features:
- a game's gui is as important as any feature of the game
- you don't have to sacrifice speed to improve the gui system
on theming:
- any game that uses cegui is infact using a theme to define the look
- irr gui also provides themes with IGUISkin
- the whole point of theming is not provide to players the ability to change the game's theme. but it is there to help developers quickly create custom gui
irr ui:
- the current irr UI is indeed very easy to understand and modify. but right now, in order to use a simple button with a background image, you'd have to create a new control yourself or modify and recompile the engine
- you can create your own IGUISkin implementation... but you can't custom draw a hovered button
@m4rvin:
I agree on both points you did made on speed and features. Still i had already to work with a game ui which traded speed for functionality and well, once you got burned you're just more careful.
As for theming helping developers to quickly create custom gui's - that sounds nice in theory. But for some reason i found it way easier to change the engine code in irrlicht to create a custom gui than to create a new theme in CEGUI. The big problem with themes in CEGUI is not just that they are described in a rather complicated way, but also that you are restricted to the stuff which those themes do offer. Once you have go beyond that you are in trouble. And like I pointed out in my message above game ui's are often very special and neither CE nor your theme layout help there, but they rather hinder doing the mentioned stuff.
I agree on both points you did made on speed and features. Still i had already to work with a game ui which traded speed for functionality and well, once you got burned you're just more careful.
As for theming helping developers to quickly create custom gui's - that sounds nice in theory. But for some reason i found it way easier to change the engine code in irrlicht to create a custom gui than to create a new theme in CEGUI. The big problem with themes in CEGUI is not just that they are described in a rather complicated way, but also that you are restricted to the stuff which those themes do offer. Once you have go beyond that you are in trouble. And like I pointed out in my message above game ui's are often very special and neither CE nor your theme layout help there, but they rather hinder doing the mentioned stuff.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
am I late? yes? oh good that means right on time.
ok check it.
bitplane ROCKS... from what I've seen gui is and has already gone a long way from when I started.. oh btw if you have a good imagination and aren't afraid to build a few gui elements yourself... it's fully functional.
I intend to use a skinned gui based on one of the projects on this forum.
in fact I have made my own skinned gui (images not just rectangles) a "true" skinned gui. and it works pretty good too.
I myself try to help contribute to the gui when I find the time. as you can see under my avatar I've been here quite a while. and I'm known to some as the resident gui master of irrlicht... besides niko,, and the wonderful work others have done also.
but the point is I've been sort of a specialist with it because of several reasons. I think gui should be tip top. my current commercial project is entirely gui based 2d graphics. (not like mario but more like uplink check my website for more information) and so much more but anyways.
be patient a little longer and you may see gui end up with more features then you need. ALSO make sure you check out ALL the examples AND the source to the tools irrlicht comes with. and the svn version of irrlicht might be worth a look also.
check out ALL the gui projects and websites.. my site has links ASWELL as looking at the source to irrlicht itself.
hope that helps.
ok check it.
bitplane ROCKS... from what I've seen gui is and has already gone a long way from when I started.. oh btw if you have a good imagination and aren't afraid to build a few gui elements yourself... it's fully functional.
I intend to use a skinned gui based on one of the projects on this forum.
in fact I have made my own skinned gui (images not just rectangles) a "true" skinned gui. and it works pretty good too.
I myself try to help contribute to the gui when I find the time. as you can see under my avatar I've been here quite a while. and I'm known to some as the resident gui master of irrlicht... besides niko,, and the wonderful work others have done also.
but the point is I've been sort of a specialist with it because of several reasons. I think gui should be tip top. my current commercial project is entirely gui based 2d graphics. (not like mario but more like uplink check my website for more information) and so much more but anyways.
be patient a little longer and you may see gui end up with more features then you need. ALSO make sure you check out ALL the examples AND the source to the tools irrlicht comes with. and the svn version of irrlicht might be worth a look also.
check out ALL the gui projects and websites.. my site has links ASWELL as looking at the source to irrlicht itself.
hope that helps.
-
thespecial1
- Posts: 135
- Joined: Thu Oct 30, 2008 11:56 am
- Location: UK
- Contact:
I think you can already use a sprite for that. But I remember also a feature- or bug-request on the trackers for improving the button states. So yeah - there is room for improvements.thespecial1 wrote:Hi Guys
could we have a hover over image on the GUIButtons maybe
just a thought
Rob
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm