Entity

Constructors

this
this()

Members

Functions

addTag
void addTag(int tag)
attach
void attach(Entity entity)

Makes the passed entity a child of this entity

attach
void attach(Collider2D collider)
attach
void attach(AudioSource source)
detach
void detach(Entity entity)

Detach a child entity or the parent entity

detach
void detach(Collider2D collider)
detach
void detach(AudioSource source)
draw
void draw(RenderTarget renderTarget, Matrix transform)

Called every draw tick (skipped if update loop is behind)

getLocalTransformMatrix
Matrix getLocalTransformMatrix()
getWorldPosition
Vector3 getWorldPosition()
getWorldRotation
Quaternion getWorldRotation()
getWorldScale
Vector3 getWorldScale()
getWorldTransformMatrix
Matrix getWorldTransformMatrix()
hasTag
bool hasTag(int tag)
onCollision2D
void onCollision2D(Collider2D collider, Collider2D other)
onCollisionEnter2D
void onCollisionEnter2D(Collider2D collider, Collider2D other)
onCollisionExit2D
void onCollisionExit2D(Collider2D collider, Collider2D other)
removeTag
void removeTag(int tag)
setup
void setup()

Called when first attached to a scene

start
void start()

Called when attached to a scene

update
void update()

Called every update tick

Properties

game
Game game [@property getter]

Shortcut for scene.game

input
Input input [@property getter]

Shortcut for scene.game.input

parent
Entity parent [@property getter]
scene
Scene scene [@property getter]

Variables

friction
float friction;

Velocity is multiplied by (1 - friction) every tick

position
Vector3 position;
rotation
Quaternion rotation;
scale
Vector3 scale;
velocity
Vector3 velocity;

Meta