Class BaseDrawable
Abstract class that represents a drawable object. This can be a Sprite, Text, or any other drawable object.
public abstract class BaseDrawable : IDisposable
- Inheritance
-
BaseDrawable
- Implements
- Derived
- Inherited Members
Properties
Bounds
When updating both the position and size, use this property to update both at the same time. This ensures drawable vertices don't get calculated twice.
public (Vector2, Vector2) Bounds { get; set; }
Property Value
Position
The current position of this drawable object.
public Vector2 Position { get; set; }
Property Value
Rotation
The current rotation of this drawable object. Objects are rotated around their center.
public float Rotation { get; set; }
Property Value
Size
The current size of this drawable object.
public Vector2 Size { get; set; }
Property Value
Methods
Dispose()
Disposes of this drawable object.
public virtual void Dispose()
Draw()
Draws the drawable object with the currently defined position and size.
public virtual void Draw()
Draw(Vector2)
Draws the drawable object with the given position. Updates the current position.
public virtual void Draw(Vector2 position)
Parameters
position
Vector2Position to draw object at.
Draw(Vector2, Vector2)
Draws the drawable object with the given position and size. Updates the current position and size.
public virtual void Draw(Vector2 position, Vector2 size)
Parameters
~BaseDrawable()
Finalizer for the drawable object.
protected ~BaseDrawable()