mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 14:08:34 +01:00
14 lines
No EOL
453 B
C#
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);
|
|
}
|
|
|
|
}
|
|
} |