I want to do collision detection between two display objects, a Bitmap and a mc.
However i only want to test collision between the non transparent pixels.
How would i do this?
See, ive got a sprite sheet, and i animate the character perfectly like so:
(The “NinjaSpriteSheets” is an mc in my timeline with only a png in it)
// Get the sprite sheet movie clip. //
var spriteSheet:NinjaSpriteSheets=new NinjaSpriteSheets();
// Go to the selected characters frame. //
spriteSheet.gotoAndStop ( Character);
// Setup the bitmap data.//
var currentSprite:BitmapData = new BitmapData(spriteSheet.width, spriteSheet.height, true, 0x00000000);
// The coordinates of the rectangle
var yCoordinate=GetActionIndex()*80;
var xCoordinate=CurrentFrame*80;
// the clipping rectangle.//
var rect:Rectangle = new Rectangle(xCoordinate,yCoordinate,80,80);
// draw the sprite to our bitmap. //
currentSprite.draw (spriteSheet,null,null,null,rect);
// Position the bitmap so the sprite is properly aligned.//
_Bitmap.x=-(xCoordinate+40);
_Bitmap.y=-(yCoordinate+80);
// Set the bitmap data to the current sprite.//
_Bitmap.bitmapData=currentSprite;
The “_Bitmap” Bitmap is already a child in my mc. I want to check if its solid pixels hits those of another mc.
How would i do so?