Can shed any light on this please? Below is some code that just tests for a collision. For the purpose of this test two images are tested at exactly the same position - so there should always be a collision. However on my PC if I have the SetClsColor set to 2,2,2 then there is no collision. If I change it to 5,5,5 then there is a collision? If I don't put the SetClsColor line in at all then there is no collision.
What on earth has SetClsColor got to do with the return from the ImagesCollide() function?
Any explanations would be gratefully received.
What on earth has SetClsColor got to do with the return from the ImagesCollide() function?
Any explanations would be gratefully received.
Graphics 640,480 Setclscolor 5,5,5 'Setclscolor 2,2,2 ' create a circle test image Local image=CreateImage(64,64,1,DYNAMICIMAGE|MASKEDIMAGE) Cls ; DrawOval 0,0,64,64 ; GrabImage image,0,0 midhandleimage(image) ' create a single pixel dummy image dummyCursorImage=CreateImage(1,1,1,DYNAMICIMAGE|MASKEDIMAGE) Plot 0,0 ; GrabImage dummyCursorImage,0,0 Repeat Cls 'mx=MouseX() ; my=MouseY() ' draw the circle image DrawImage image,200,100 ' test for collision against dummy image result=ImagesCollide(image,200,100,0 , dummyCursorImage,200,100,0) DrawText "Collision = "+Mid$("NO YES",result*4,3) , 10,10 Flip FlushMem Until KeyHit(KEY_ESCAPE) End