Hide Image but allow collisions?

BlitzPlus Forums/BlitzPlus Programming/Hide Image but allow collisions?

QuickSilva(Posted 2003) [#1]
Hi all,

Is it possible to hide an image but still generate collisions from it as in Blitz 3D when you can set an entities alpha to full so that it is invisible but still able to cause collisions?

Thanks,
Jason.


SoggyP(Posted 2003) [#2]
Hi Jason,

Yes, all you do is use the co-ordinates it SHOULD be at for the collision command, but just don't DrawImage ;0)

Later,

Jes


Myke-P(Posted 2003) [#3]
Yeah, that got me originally. "ImagesCollide" and "ImagesOverlap" do not require the images to have been 'physically' drawn on the screen at all.

They say; "Hypothetically, y'know, *if* these two images were drawn at x1,y1,x2,y2 then, y'know, would they have touched?"

Because, of course, y'know like, Blitz is a bit of a hollywood bimbo at heart. :)


WolRon(Posted 2003) [#4]
Also, you can do this if it suits your situation:

You can create an image that has a visible part, an invisible part, and a transparent part.

Huh? invisible is not transparent?

Lets assume the background for your game is black (for simplicity).
Create the image with the visible portions whatever color you wish and the invisible portions with the color black (0, 0, 0). Set the transparent portions to almost black (1, 1, 1) (or any color you wish as long as you know exactly which).
In your program, set the mask color for the color 1, 1, 1 (or whatever color you chose earlier)
When you check for a collision with ImagesCollide, the invisible portions (0, 0, 0) will collide but the transparent portions (1, 1, 1) will not and the player will not be able see either.


QuickSilva(Posted 2003) [#5]
Thanks, that`s just what I needed to know.

All the best,
Jason.