Removing elements from the GUI [Solved]

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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Removing elements from the GUI [Solved]

Post by JP »

I've got a bit of a problem with my GUI i think. At the moment my GUI has a map of the maze in my game and it displays it fine, but when the level ends and a new one begins the old maze map remains and the new one either isn't there or can't be seen.

At the end of each level i've tried to remove the maze map from the GUI but it doesn't work using remove and removing the root node doesn't work either...

Any ideas? Maybe it's just Jirr being a bit lame :lol:
Last edited by JP on Fri Aug 18, 2006 3:20 pm, edited 1 time in total.
Image Image Image
Gatekeeper
Posts: 31
Joined: Fri Apr 21, 2006 12:00 am
Location: Australia

Post by Gatekeeper »

I'm not using Jirr, just regular Irrlicht 1.0. I've found that you can't remove the root node, you have to remove it's children.

If remove doesn't seem to work, why don't you just set the visible on the window to false? For the new level, just update what's contained in the window (I'm guessing it's some bitmaps and maybe text) and set the window visible to true?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I'll give that a bash, cheers :)
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Nothing seems to work! :cry:

Not got a clue what to do... I output the map of the maze to a jpg file but i know it updates properly to the new one as i've checked the directory whilst playing the second level and even deleted the old map image before outputting the new one, so it's not that, it's that it gets left behind in the GUIEnvironment after the previous level finishes and for some reason remains on top and i guess the new map is hidden underneath it for some reason. I also tried playing around with GUIElement.bringToFront() but that didn't help.

GUIElement.delete() doesn't work either :s
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Solved! The problem was due to the fact that in the first level i loaded radar.jpg, then for the second level i overwrote the radar.jpg file with a new image and then tried to load it again, but the driver.getTexture() method just provided the same map as the previous level due to thinking it was already loaded as it had the same file name, so i solved it by removing the texture from the driver after using it, so when i try and load it a second time it actually reads it from disc again!
Image Image Image
Post Reply