SpritePixelCollision()
Syntax
Result = SpritePixelCollision(#Sprite1, x1, y1, #Sprite2, x2, y2)Description
Tests to see if the two sprites are overlapping. If not, the result is 0. As x and y parameters the coordinates of the two sprites are needed, the width and height of each sprite does PureBasic know itself.
This routine performs a transparent pixel exact collision check, giving a slower but very accurate result. To optimize the comparison you should always remove as many transparent pixels as possible so that the sprite size is fully used by the sprite (i.e. do not have large transparent borders around the actual image of the sprite).
For a less exactly but very fast collision check use SpriteCollision().
Note: SpritePixelCollision() currently doesn't work with alpha channel (PNG, TIFF), it will be ignored.
Supported OS
All