Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function isOnScreen(n:FlxObject, leeway:Int = 0, ?Camera:FlxCamera):Bool
- {
- if (Camera == null)
- {
- Camera = FlxG.camera;
- }
- leeway = 0;
- var _point:FlxPoint = new FlxPoint(0, 0);
- n.getScreenPosition(_point, Camera);
- return (_point.x + n.width + leeway > 0) && (_point.x - leeway < Camera.width) && (_point.y + n.height > 0) && (_point.y < Camera.height);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement