• Advertisement
Sign in to follow this  

Removing objects from gui

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to adapt JavaCoolDude's GUI to my project, and I'm wondering if any of you would be able to shed some light on a specific topic. I would like to remove some elements from the interface after a specific event occurs. I can use element->setVisible(false) to hide it, but it is still there, just not being rendered. I can use element->setParent(NULL), but the object is still in whatever sort of manager is keeping track of all the elements. What would be the best way to completely remove a UI element from the scene? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I use a GUI-manager that handles all elements.
In its update-loop I check if it's marked (mouse-over-element) and if it's dying.
If it's dying, it gets removed from the list.

But before the update loop gets it's hand on the elements, the dying element removes all it's children so the GUI-manager has less to process.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement