GetCollisionPoly The return value is null if no collision polygon was created in the constructor. To create the collision polygon, pass CREATE_COLLISION_POLY to the extraFlags parameter in the constructor. Examples // Load a Bitmap and create a collision polygon //
Bitmap bmp( "mybmp.png", CREATE_COLLISION_POLY ); // Get the collision polygon of the Bitmap // Poly *collisionPolygon = bmp.GetCollisionPoly(); // Test collision between two Bitmaps // Bitmap bmp2( ..., CREATE_COLLISION_POLY ); if( bmp.GetCollisionPoly()->Collides( *bmp2.GetCollisionPoly(), ... )) { // Collision! } Other functions of the class Bitmap
Questions about GetCollisionPoly? Click here. |