Hiding an image

Blitz3D Forums/Blitz3D Beginners Area/Hiding an image

AvestheFox(Posted 2004) [#1]
Last night I took a break from 3D work to experiment with 2D work.. and come to find out.. it's much easier then I thought...

but a problem remains... I made some colision detectors for my smileyface sprite.. so when it colides with some scenery it would stop.. but I cant figure out how to hide the images.. or make them invisible..

help please


soja(Posted 2004) [#2]
erm... don't draw them?


AvestheFox(Posted 2004) [#3]
then what other command allows me to put them there to check collision?

**feels dumb**


767pilot(Posted 2004) [#4]
I usually create a type

ie Type man
field x,y,visible

then set visible to 1

in your collision detection code set the man\visible field to 0 when you want it to disappear

Somewhere in main loop I have drawman() call to a function which looks like this

function drawman()

if man\visible=1 then

drawimage(man,x,y)

else

'any code you want to add here, usually dont require the else bit

end function

And then just set the field back to 1 when you want it to reappear!


AvestheFox(Posted 2004) [#5]
that could work.. but while the markers are invisible.. how do I set their x and y positions?


AvestheFox(Posted 2004) [#6]
I got something to work... but it reqwuired me to hide the colision detectors behind a tiled background


JazzieB(Posted 2004) [#7]
You don't actually need to draw any images for the ImagesCollide() function to work (or any of the other image collision detection functions). Just supply the image handles and the screen co-ordinates.