diff --git a/MLEM.Extended/Extensions/CameraExtensions.cs b/MLEM.Extended/Extensions/CameraExtensions.cs deleted file mode 100644 index 22252cc..0000000 --- a/MLEM.Extended/Extensions/CameraExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Xna.Framework; -using MonoGame.Extended; -using Camera = MLEM.Cameras.Camera; - -namespace MLEM.Extended.Extensions { - public static class CameraExtensions { - - public static RectangleF GetVisibleRectangle(this Camera camera) { - var start = camera.ToWorldPos(Vector2.Zero); - return new RectangleF(start, camera.ToWorldPos(new Vector2(camera.Viewport.Width, camera.Viewport.Height)) - start); - } - - } -} \ No newline at end of file diff --git a/MLEM/Cameras/Camera.cs b/MLEM/Cameras/Camera.cs index 71c667e..0600c51 100644 --- a/MLEM/Cameras/Camera.cs +++ b/MLEM/Cameras/Camera.cs @@ -2,6 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Extensions; +using MLEM.Misc; namespace MLEM.Cameras { public class Camera { @@ -58,6 +59,11 @@ namespace MLEM.Cameras { return (this.ToWorldPos(Vector2.Zero), this.ToWorldPos(new Vector2(this.Viewport.Width, this.Viewport.Height))); } + public RectangleF GetVisibleRectangle() { + var start = this.ToWorldPos(Vector2.Zero); + return new RectangleF(start, this.ToWorldPos(new Vector2(this.Viewport.Width, this.Viewport.Height)) - start); + } + public void ConstrainWorldBounds(Vector2 min, Vector2 max) { if (this.Position.X < min.X) this.Position.X = min.X;