Clearing Gui Env or Removing GUI element?

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
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Clearing Gui Env or Removing GUI element?

Post by shurijo »

Hi all,

I'm another Irrlicht developer newbie with an easy question...

I have created an IRR device with GUI elements (all of that works) with events, etc. Now, I want to clear all of the GUI elements, so I can add other GUI items. How can I clear/drop the entire GUI environment or remove an individual element?

I've searched through the API and forum, but this is probably so easy that it isn't mentioned anywhere :D

For example, I can click on checkbox, then I want two buttons to appear. uncheck it then 2 buttons disappear, etc. (I'm not really looking to hide or toggle visibility, just remove.)

Or click a button and all GUI environment is cleared and new GUI environment is created, etc.

thanks,

P.S. Great engine you have here too. I seen the news on gamedev a few days ago and have been messing around with it.
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

for visibility its mButton->setVisible(false);

for removing it, its mButton->remove();

where mButton is the name of your button
The Robomaniac
Project Head / Lead Programmer
Centaur Force
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Thanks.

Is there a way to clear the entire GUI environment, without looping through each element?

I was able to use that information and just loop through each item in the environment. Thanks for the help.
level1

Post by level1 »

remove the topmost element, this will remove the children and children of the children .., avoid removing the root element though.
Post Reply