Button border question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

Button border question

Post by wsw1231 »

Can I add a border with a certain thickness around the button when it is clicked using Irrlicht?
CuteAlien
Admin
Posts: 9718
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

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.
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
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

Post by wsw1231 »

how to apply the skin to the IGUIButton?
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

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.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Sylence wrote: Maybe this would be a nice feature request: Applying skins to single elements instead of the whole gui.
I don't see much of usability here, as most GUI's use the same skins for every element, and it looks good.
Maybe you have something special in mind? :D
Working on game: Marrbles (Currently stopped).
CuteAlien
Admin
Posts: 9718
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

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
Post Reply