Uses a bitwise mask to determine which sprite categories this sprite can collide with. Sprites are assigned categories using SetSpriteCategoryBits. There are 16 categories, each represented by a single bit in the "mask" parameter, a value of 1 for a bit represents that this sprite will collide with sprites from that category and 0 that it will not collide with that category, regardless of which category this sprite itself belongs to. By default all sprites belong to category 1 (0x0001 the rightmost bit) and collide with all categories (0xffff).

When the sprite is not setup for physics this test will only apply to the base shape at shapeID 1.

By default this sets all shapes to the same value, you can set this value on a per shape basis by specifying a shapeID value greater than 0. Shape IDs start at 1 for the first shape, with shapeID 0 meaning apply it to all shapes.


SetSpriteCollideBits( iSpriteIndex, mask )

SetSpriteCollideBits( iSpriteIndex, mask, shapeID )