gui customisation

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

gui customisation

Post by REDDemon »

Is it possible making irrlicht gui elements specifyng only the few images needed for

1) corner
2) edges
3)background

in a way like that:

Image

in wich every gui element is a background image surrounded by 4 edges images (opportunely rotated) and by 4 corner images (also corners are rotated)

i tried to search and i found only the chance to change the background. i'm not sure how skin works
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, that's not possible so far.
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
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You'd need to make your own IGUISkin. It's not that hard to do, but would involve quite a bit of typing!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I think it even then it would be hard as we don't have a real definition of "borders" for all gui-elements.
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
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

You could make your own element and have it make the background image and then add your own border images around it, make the borders childs of the background then when/if you move it you just move the background and all the borders should follow it.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

CuteAlien wrote:I think it even then it would be hard as we don't have a real definition of "borders" for all gui-elements.
Ah yes, good point. Decorations around the edges would not be clickable, which would break a lot of things. Insets would work for most element types though
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

yup i tried to create a custom skin but i have always artifacts. I think for now it will be faster creating every gui elements manually. (it is easy in gimp jsut a multiple copy for making corner and edges with a repeating pattern.)

setting every corner images coordinates can be a little slower :)

thanks much for suggestions. if i have success with the skin i'll post its code, but i have others priorities now. (just i hope i won't have to change something in the gui now that is almost all created with gimp O_O)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
elfuz
Posts: 14
Joined: Wed Oct 13, 2010 10:20 am

Post by elfuz »

if you'd really want it for every gui element, you could modify the engine's gui->drawall function. It could for example do element->drawborder and then element->draw.

The drawborder function you'd need to insert in the guielement as well.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

The draw functions in the skin take a pointer to the current GUI element, so you can just put all that stuff in the skin and treat elements differently depending on getType().
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply