How to hide all gui elements?
How to hide all gui elements?
I know about get getChildren(), but I don't know how lists work in Irrlicht
Re: How to hide all gui elements?
You can loop over children like:
Note that when you hide a parent element then all children are hidden as well. So when I need to hide a group of UI elements I often give them a common static-text (without text and border so it's invsible) as parent so I can just hide that one.
Also if you don't want _any_ gui then the simplest is: don't draw it. As long as you don't call IGUIEnvironment::drawAll() the gui isn't rendered.
Code: Select all
irr::core::list<IGUIElement*>& children = guiElement->getChildren();
for (irr::core::list<IGUIElement*>::Iterator it = children.begin(); it != Children.end(); ++it)
{
(*it)->setVisible(false);
}
Also if you don't want _any_ gui then the simplest is: don't draw it. As long as you don't call IGUIEnvironment::drawAll() the gui isn't rendered.
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
Re: How to hide all gui elements?
Thanks for this trick!