Use FlxCollision.pixelPerfectCheck()
to check if any of pixels of a FlxSprite
overlaps the pixels of another FlxSprite
.
FlxCollision.pixelPerfectCheck()
will return true
if it detects an overlap, and false
. if it does not. this is true regardless of the sprite’s hitbox, and works for any scale
, angle
or even scrollFactor
// overlaps will be true if the two objects are overlapping each other
overlaps = FlxCollision.pixelPerfectCheck(spriteA, spriteB);