1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-27 10:39:24 +01:00
MLEM/MLEM.Extended/Extensions/CameraExtensions.cs
2019-08-07 01:37:14 +02:00

14 lines
No EOL
453 B
C#

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);
}
}
}