How to "hide" an image

BlitzMax Forums/BlitzMax Beginners Area/How to "hide" an image

Newbie(Posted 2007) [#1]
I use drawimage() to display selected components on the screen; how do I "hide" an image? i dont want to "release" it as I need to show it again after something happens, but I need to show it, then hide it while i do other stuff, then show it once more. I wish there was a "hide" image ...


H&K(Posted 2007) [#2]
Well, you know dont you that after a "Flip" (And nominal CLS), you have to redraw the whole screen?
Well, what you do, is dont draw that image.


H&K(Posted 2007) [#3]
Also, after a sudden revelation, if you set the alpha to 0.0 just before you draw the image, it would be invisable. (But I wouldnt recomend this)


Newbie(Posted 2007) [#4]
well, the alpha 0.0 depends on the setblend mode does it not?


H&K(Posted 2007) [#5]
Yes

BUT THAT WAS A JOKE.

(If you dont want an image to be displayed. Dont draw it


xlsior(Posted 2007) [#6]



tonyg(Posted 2007) [#7]
Create a sprite object which has your usual fields (xpos, ypos, xscale, yscale, colour etc) but also a 'ishidden' field. Set ishidden=true and, when you loop through your objects don't draw those with 'ishidden=true'.


Newbie(Posted 2007) [#8]
thanks!


ImaginaryHuman(Posted 2007) [#9]
Have an array of images and a second array that contains duplicate pointers to those images. You set one of the entries in the second array to Null or to an image that has no pixels, when you don't want it to be shown, then when you want to revert back you copy the image handle from the original array.


computercoder(Posted 2007) [#10]
um... ok... :|

I don't think I'd use two arrays. Seems a bit work loaded. However, I agree with having a seperate list of images from the map you plan on drawing.

A simple draw flag is all that's really needed. There are plenty of those examples posted above :)