Window texture

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
LordNyson
Posts: 31
Joined: Tue Nov 11, 2008 12:02 pm
Location: Perth, Australia

Window texture

Post by LordNyson »

Hey all,
What I am trying to do is create a dialog screen. Basically I am setting it up so it creates a new window inside the current irrlicht window and sets a bunch of gui elements up, all good yeah?

Problem is I have a custom window skin. Not sure how to go about applying it. I have looked under the device skin and also in the window option but I came up blank.. Is there are way to do this easily in irrlicht?

Also, when using the loadGUI() function, is it possible to retrieve the elements, and save them to a class or something so I can edit them.
But the cage only had "Warning: Vicious Lions" on it! Im a programmer! I only listen to errors!
CuteAlien
Admin
Posts: 10035
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Window texture

Post by CuteAlien »

LordNyson wrote:Hey all,
What I am trying to do is create a dialog screen. Basically I am setting it up so it creates a new window inside the current irrlicht window and sets a bunch of gui elements up, all good yeah?

Problem is I have a custom window skin. Not sure how to go about applying it. I have looked under the device skin and also in the window option but I came up blank.. Is there are way to do this easily in irrlicht?
setSkin in IGUIEnvironment does allow setting a custom skin. If that is what you mean.
LordNyson wrote: Also, when using the loadGUI() function, is it possible to retrieve the elements, and save them to a class or something so I can edit them.
You can locate elements by their ID. Starting from getRootGUIElement in IGUIEnvironment or from the parent given in the loadGui function you can browse through all elements. If you need many dialogs I rather propose patching Irrlicht so you can work with names instead, at least I do that in my projects (see http://www.michaelzeilfelder.de/patches_svn2701.htm - element_name.patch). I might also add that to Irrlicht once I'm more certain that it's a good solution (it has still some warts).

I think a way to put a gui-dialog in a class is having a class which either is an IGUIElement or has one gui-element which is passed as parent to the loadGUI. In my solution I made the load function of my window class virtual and each dialog overwrites the load, calls the basic load and then after that is called the dialog locates all the gui-elements (by name or id) and puts them in variables (that part has to be hardcoded for each dialog, but it's usually just a few lines).
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