Button border question
Button border question
Can I add a border with a certain thickness around the button when it is clicked using Irrlicht?
You can, but it's some work. You need to create a custom skin class for that. So derive your own class from IGUISkin. You can in the functions there just call the functions of the default skin. Except those 2:
draw3DButtonPaneStandard for unclicked button and draw3DButtonPanePressed for the clicked button. Those 2 functions are used for drawing the button borders.
draw3DButtonPaneStandard for unclicked button and draw3DButtonPanePressed for the clicked button. Those 2 functions are used for drawing the button borders.
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
Apply the skin to the GUI Environment and check if the button that is drawn is your button. If so call your own methods, otherwise call the default skin's ones.
Maybe this would be a nice feature request: Applying skins to single elements instead of the whole gui.
Maybe this would be a nice feature request: Applying skins to single elements instead of the whole gui.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
I don't see much of usability here, as most GUI's use the same skins for every element, and it looks good.Sylence wrote: Maybe this would be a nice feature request: Applying skins to single elements instead of the whole gui.
Maybe you have something special in mind?
Working on game: Marrbles (Currently stopped).
Applying skins to IGUIElement would often make sense. The reason I don't do that so far is (once more) serialization. Skins would have to be serialized - and same as with other stuff (Fonts, particle-setting, ...) this means we need a decision how to continue there (blowing up the interface with more and more factories or going toward some base class are probably the 2 major candidates).
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