Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.39 KB | None | 0 0
  1. public static function isOnScreen(n:FlxObject, leeway:Int = 0, ?Camera:FlxCamera):Bool
  2.     {
  3.         if (Camera == null)
  4.         {
  5.             Camera = FlxG.camera;
  6.         }
  7.         leeway = 0;
  8.         var _point:FlxPoint = new FlxPoint(0, 0);
  9.         n.getScreenPosition(_point, Camera);
  10.         return (_point.x + n.width + leeway > 0) && (_point.x - leeway < Camera.width) && (_point.y + n.height > 0) && (_point.y < Camera.height);
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement