This works:
But this won't work:
Anyone got any ideas why this isn't working? ImageRectOverlap isn't supposed to take transparent pixels into account, and even if it did, the image I'm checking against is mostly opaque pixels.
Increasing the width and height of the rectangle I'm testing the image against has no effect, so it is not a bug with rectangles that have a 1x1 size.
I've checked the data, the image width and height are being returned properly in the function. The handle coordinates are in the center of the image as expected. (Note I'm not using the image handle stuff Blitz has, the handle I refer to are the offsets I add to the position of the image.)
I've tried clicking all over the screen to see if maybe something is messed up and I can hit something, but I hit nothing. It is as if the ImageRectOverlap command does not work.
I'm sure I've just made some stupid mistake though, I am tired.
X1 = BOBX#(BOB_MenuItem(Loop)) - BOBWidth(BOB_MenuItem(Loop))/2 Y1 = BOBY#(BOB_MenuItem(Loop)) - BOBHeight(BOB_MenuItem(Loop))/2 X2 = BOBX#(BOB_MenuItem(Loop)) + BOBWidth(BOB_MenuItem(Loop))/2 Y2 = BOBY#(BOB_MenuItem(Loop)) + BOBHeight(BOB_MenuItem(Loop))/2 If (Mouse_X >= X1) And (Mouse_X <= X2) And (Mouse_Y >= Y1) And (Mouse_Y <= Y2)
But this won't work:
If BOB_RectOverlap(BOB_MenuItem(Loop), Mouse_X, Mouse_Y, 1, 1) ; ----------------------------------------------------------------------------------------------------------------------------------- ; This function returns TRUE if the bounding rectangle of a BOB overlaps the specified region of the screen. ; ----------------------------------------------------------------------------------------------------------------------------------- Function BOB_RectOverlap(ThisBOB.BOB, Rect_X, Rext_Y, Rect_Width, Rect_Height) X1 = Floor(ThisBOB\Position_X#-ThisBOB\Handle_X#) Y1 = Floor(ThisBOB\Position_Y#-ThisBOB\Handle_Y#) Return ImageRectOverlap(ThisBOB\Image, X1, Y1, Rect_X, Rect_Y, Rect_Width, Rect_Height) End Function
Anyone got any ideas why this isn't working? ImageRectOverlap isn't supposed to take transparent pixels into account, and even if it did, the image I'm checking against is mostly opaque pixels.
Increasing the width and height of the rectangle I'm testing the image against has no effect, so it is not a bug with rectangles that have a 1x1 size.
I've checked the data, the image width and height are being returned properly in the function. The handle coordinates are in the center of the image as expected. (Note I'm not using the image handle stuff Blitz has, the handle I refer to are the offsets I add to the position of the image.)
I've tried clicking all over the screen to see if maybe something is messed up and I can hit something, but I hit nothing. It is as if the ImageRectOverlap command does not work.
I'm sure I've just made some stupid mistake though, I am tired.