Fix MathUtils.LerpVector2, add cameras.
This commit is contained in:
25
DaggerFramework/Source/SceneGraph/Camera2d.cs
Normal file
25
DaggerFramework/Source/SceneGraph/Camera2d.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace DaggerFramework.SceneGraph;
|
||||
|
||||
public class Camera2d : Entity2d
|
||||
{
|
||||
public Vector2 Offset { get; set; }
|
||||
public float Zoom { get; set; } = 1f;
|
||||
public bool Current
|
||||
{
|
||||
get => _current; set
|
||||
{
|
||||
_current = value;
|
||||
Layer?.UpdateCurrentCamera();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
base.OnStart();
|
||||
Offset = Renderer.WindowSize / 2;
|
||||
}
|
||||
|
||||
private bool _current;
|
||||
}
|
||||
Reference in New Issue
Block a user