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.
Window texture
Window texture
But the cage only had "Warning: Vicious Lions" on it! Im a programmer! I only listen to errors!
Re: Window texture
setSkin in IGUIEnvironment does allow setting a custom skin. If that is what you mean.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?
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).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.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm