Table of Contents

Class BaseDrawable

Namespace
Axolotl2D.Drawable
Assembly
Axolotl2D.dll

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

(Vector2, Vector2)

Position

The current position of this drawable object.

public Vector2 Position { get; set; }

Property Value

Vector2

Rotation

The current rotation of this drawable object. Objects are rotated around their center.

public float Rotation { get; set; }

Property Value

float

Size

The current size of this drawable object.

public Vector2 Size { get; set; }

Property Value

Vector2

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 Vector2

Position 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

position Vector2

Position to draw at

size Vector2

Size to draw at

~BaseDrawable()

Finalizer for the drawable object.

protected ~BaseDrawable()