What conditions have to be met for ImagesCollide ?
BlitzMax Forums/BlitzMax Beginners Area/What conditions have to be met for ImagesCollide ?
| ||
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? |
| ||
aah... the problem "in this case" was setscale. It also scales the Mouseimage when checking for colliding. pffft. |
| ||
Can't you use colliderect for checking image-to-mouse? |
| ||
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... |
| ||
CollideRect works similar to CollideImage just with a rect instead of a full image test. |
| ||
@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. ;) |
| ||
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. |
| ||
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. |