Page 1 of 1

Removing elements from the GUI [Solved]

Posted: Thu Aug 17, 2006 9:36 pm
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:

Posted: Fri Aug 18, 2006 1:00 am
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?

Posted: Fri Aug 18, 2006 10:09 am
by JP
I'll give that a bash, cheers :)

Posted: Fri Aug 18, 2006 10:38 am
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

Posted: Fri Aug 18, 2006 3:19 pm
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!