I'm using a 'progressive indexing' sort of image display for my GUI. Basically, I've created custom functions for displaying images, and create an index var that increases every time it's called. This lets me easily show images without having to worrying about placing a free index on it.
Pseudo-code:
PHP Code:
//#CLIENTSIDE
function onCreated() {
imgid=200;
for (i=0;i<player.fullhearts;i++) imgshow(crap);
}
function imgshow(paramstuff) {
showimg(imgid,imgcrap);
imgid++;
}
Would display images for each of the player hearts. Problem is, because it is a HUD, it is displaying a lot of dynamic statistics. Hearts lower, rupees decline and so on. This creates a problem I have with if, say, my player hearts lower, the hearts don't disappear because I haven't hidden them. Because I am using a system where images won't always have the same index, I'm having a hard time figuring out how to hide images that are no longer needed.
Any idea how to fix this? I figure I'm going to have to find a way to compare the last number of images being displayed with the next amount of images to be displayed, but I'm having a problem figuring out how to do that because the only way to do that would be to 'predict' how many images are going to be displayed next.