Add pivot offset for rotations.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user