public override bool onScreen(FlxCamera camera = null)
{
if (camera == null)
{
camera = FlxG.camera;
}
getScreenXY(_tagPoint, camera);
_tagPoint.X = _tagPoint.X - Offset.X;
_tagPoint.Y = _tagPoint.Y - Offset.Y;
/*
if (((angle == 0) || (_bakedRotation > 0)) && (scale.x == 1) && (scale.y == 1))
return ((_point.x + frameWidth > 0) && (_point.x < Camera.width) && (_point.y + frameHeight > 0) && (_point.y < Camera.height));
*/
float halfWidth = FrameWidth / 2;
float halfHeight = FrameHeight / 2;
float absScaleX = (Scale.X > 0) ? Scale.X : -Scale.X;
float absScaleY = (Scale.Y > 0) ? Scale.Y : -Scale.Y;
float radius = (float)Math.Sqrt((halfWidth * halfWidth) + (halfHeight * halfHeight)) * ((absScaleX >= absScaleY) ? absScaleX : absScaleY);
_tagPoint.X = _tagPoint.X + halfWidth;
_tagPoint.Y = _tagPoint.Y + halfHeight;
return ((_tagPoint.X + radius > 0) && (_tagPoint.X - radius < camera.Width) && (_tagPoint.Y + radius > 0) && (_tagPoint.Y - radius < camera.Height));
}