Add pivot offset for rotations.

This commit is contained in:
2023-09-25 18:44:35 +02:00
parent ea2733f594
commit 8aab1132b6
8 changed files with 27 additions and 17 deletions

View File

@@ -1,12 +1,14 @@
using System.Numerics;
using DaggerFramework.Rendering;
namespace DaggerFramework.SceneGraph
{
public abstract class Drawable2d : Entity2d, IDrawable
{
public Vector2 PivotOffset { get; set; }
public void Draw(Renderer renderer)
{
renderer.SetTransform(Position);
renderer.SetTransform(Position, PivotOffset, Rotation);
OnDraw(renderer);
}