Table of Contents

Class Drawable

Namespace
AstraEngine.Canvas2D
Assembly
AstraEngine.Canvas2D.dll

Represents a component that can be drawn to a screen. An Entity that is Drawable is required to have a Position2D component. During initialization, if no Position2D is found, a default position is attached.

public abstract class Drawable : Component
Inheritance
Drawable
Derived
Inherited Members

Properties

Position

The Position of attached Entity.

public Position2D Position { get; }

Property Value

Position2D

Methods

Draw(ICanvas2D)

Renders this Drawable.

public abstract void Draw(ICanvas2D renderer)

Parameters

renderer ICanvas2D

The renderer to use

Initialize()

Initializes Position. If the associated Entity has a Position it is used otherwise, initializes to (0, 0).

public override void Initialize()