What conditions have to be met for ImagesCollide ?

BlitzMax Forums/BlitzMax Beginners Area/What conditions have to be met for ImagesCollide ?

Abomination(Posted 2006) [#1]
What conditions have to be met for ImagesCollide to work?
I want a DummyMouseImage of one pixel to check collision with a number of images.
If I test this in a little testprog. it works fine.
But in my program it doesn't.
Strange thing is; when I change the size of the mouseimage to 5X5 it DOES work.
Now what thing can I have set different, so it doesn't work with the smaller Image?


Abomination(Posted 2006) [#2]
aah... the problem "in this case" was setscale.
It also scales the Mouseimage when checking for colliding.
pffft.


tonyg(Posted 2006) [#3]
Can't you use colliderect for checking image-to-mouse?


GfK(Posted 2006) [#4]
I'm using Abomination's method too, simply because the docs for CollideRect do not make any sense (the CollideMask and WriteMask params).

[edit] In fact, I'll start a new thread...


Dreamora(Posted 2006) [#5]
CollideRect works similar to CollideImage just with a rect instead of a full image test.


Abomination(Posted 2006) [#6]
@tonyg: Same as Gfk + I assumed ImagesCollide works the same as in B3D. Well, not quiet. But at least I got it working... so far.
I just wonder what other pitfalls I may encounter?
Would colliderect be a better tool to do the job? No idea how to tackle it...
@Dreamora: I gues we also don't know how CollideImage works. ;)


GfK(Posted 2006) [#7]
I just did a speed comparison of ImagesCollide vs CollideRect, and found ImagesCollide appears to be slightly faster anyway.

[edit] Actually, strike that. Been playing with my code for most of the day and CollideRect seems to be significantly faster.


Grey Alien(Posted 2006) [#8]
clearly you only need to use images collide if you need pixel perfect collision detection. Depends on the game type as often CollideRect is totally fine.