![]() |
Keeping track of images...
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:
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. |
PHP Code:
|
The thing is, it's not that simple. The imaging system I'm using is used for ALL images. GUI background, icons, rupees, numbers.
|
PHP Code:
|
See, that's the thing. I don't really want to categorize them. I want to apply the logic:
if (newimagecount < oldimagecount) hideimgs(newimgcount,oldimagecount); I don't need to hide any certain images, like hearts. I just need to be able to hide images no longer being used(that aren't being drawn). Because the way my system works, the indexes of hearts that are lost would most likely be recycled and used for something like key icons. Right now I'm doing hideimgs(200,imgid) before the script to hide ALL images before they're drawn again. In my past though I have noticed this is taxing and I want to avoid hiding them each time they're redrawn. |
Maybe make some sort of a hash function? Like:
PHP Code:
After that, something could be scripted fr hiding the images and when hideimg() is called, the "title" var would be deleted so you wouldn't need to worry about that ;). Hope that helps. |
Why not something like this?
PHP Code:
|
Zero: Yours confuses me :( I'll have to go over it after I go to bed.
Stefan: I've tried that. hideimg after the showimgs causes it to flicker. It works, but the flickering is very distracting, and I can't imagine having that after every update of a rupee or something. |
Why not just loop through maxhearts instead?
|
Quote:
PHP Code:
EDIT: Here's a simpler alternative if you don't want to deal with hashing: In the onCreated of a "Main"-like system wnpc, put: PHP Code:
PHP Code:
PHP Code:
|
Quote:
Here's a small clipping from the script to show what I'm doing, exactly. PHP Code:
|
Why not an array of what index points to what?
|
Because I don't need to know what points to what. I don't need to hide any specific images, just know WHEN to refresh them. I think the simplest solution is what I'm using now, I guess.
|
Quote:
|
I have done it after. It flickers every time the images are hidden and redrawn.
|
Why not only hide what you need to hide, and change everything else?
|
That's the problem I'm having. I have no idea how to make it hide what I need to hide.
|
You can't really track dynamically indexed images without having some sort of categorization.
No really, you can't. PHP Code:
|
I found a way to do it... I mean, I'm not tracking them, but I got them to hide. It was buggy though, sadly, so I had to drop it.
|
I'm working on some drawing functions for arcs / beizer curves with polygons. Interested?
|
Heh, no thanks. Already explained it in my other thread as to why I don't think I'd take that road. I think it's just simpler to use images.
|
| All times are GMT +2. The time now is 11:47 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.