Request: IGUIElement->getChildren() + getElementbyID

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Request: IGUIElement->getChildren() + getElementbyID

Post by saigumi »

I have been doing some serious GUI development and started to notice some inconsistencies with how the IGUIElements behave to the ISceneNodes.

The two biggest that I noticed and would like to have are getChildren and get*byID.

The main reason for this is that I have been creating control sets. An example of which is my character creation stat creator. It's a scrollbar with a textbox for the name, another for the value, and a third for the bonus modifier. All are set as children. When the scrollbar is changed, I mage a call to get it's children, determine which one is which and adjust them accordingly. Usually, it's easy to determine which is which because they are in order on the list as they were put on. Vice versa, if the textbox is changed, it does a getParent() and I set the parent there.

Visual Example:

StatName [----->____] [Value] Modifier
{Static Text}{Scrollbar}{Textbox}{Static Text}

I wrote some functions that were just basically copies from ISceneNode, and replaced it with the IGUIElement equivalent. If you did the same, it would be exactly like the source I created. But if you would need my source to include, let me know.
Crud, how do I do this again?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Right, I did not make big changes to the gui system for a long time. And as you said, IGUIElements should be similar to ISceneNodes. In fact, they are nearly the same, one are in 2d, the other in 3d. Ah, yes, and the 2d-nodes get input and events. I'll refactor the whole system next time. :)
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

I was reading through the API Docs on my PDA on the way to work this morning and smacked my head when I saw scenemanager::setKeyFocus().

I don't have the code to check to see how exactly it works, but I'll play with it tonight as if it really does perform some sort of OnEvent for keypresses on a GUI level instead of on an application OnEvent level, that would be sorta sweet.
Crud, how do I do this again?
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

textbox???

Post by buhatkj »

irrlicht has a text entry gui element?? or did i mistake what you said saigumi??? if it does, what is it called? i never saw that in the docs...did i miss it....wierd!

that would be good though, cuz i wanted to have a chat within the game, so i could use that...
-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

It's not an Irrlicht control. It's a just a staticText element with a border that when you click on it gives you a pipemark "|" cursor and then I funnel keypresses events to it.
Crud, how do I do this again?
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

cool, snippet??

Post by buhatkj »

sounds good :-) suppose i could get a code snippet?
i could really use that :-)
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Post Reply