PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Intersect when sprite is partly out of screen

Hi, I'm having a problem with Intersect(). When one of the surfaces tested is partly out of screen (to the top or to the left) the Intersect() won't work because you have to pass DWORD (unsigned) values as parameters.
Is there a way of getting around this? Do I have to move the surfaces to a "positive" point and the do the Intersect() there or is there another solution?

/ Lars
One way of doing it: Check for the minimum value of x / y (e.g. min x = -100). Then simply do:

Intersect(x1 - minx, y1 - miny, srf1, rect1, x2 - minx, y2 - miny, srf2, rect2, %point);

//Johan
Thanks, that works fine!
/ Lars