mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-05-29 11:33:37 +02:00
14 lines
448 B
C#
14 lines
448 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 GetVisibleArea(this Camera camera) {
|
|
var start = camera.ToWorldPos(Vector2.Zero);
|
|
return new RectangleF(start, camera.ToWorldPos(new Vector2(camera.Viewport.Width, camera.Viewport.Height) - start));
|
|
}
|
|
|
|
}
|
|
} |