Moveable

Basic implementation for moveable objects

Members

Functions

_applyTranslation
void _applyTranslation()

Apply translation to the object.

_positionMoved
void _positionMoved(float dx, float dy)

Overloadable method if the position is moved.

_positionReset
void _positionReset(float nx, float ny)

Overloadable method if the position is reset.

getPosition
const(Vector2f) getPosition()

Returns the current position.

move
void move(float x, float y)

Move the current position by x|y.

move
void move(Vector2f vec)

Move the current position by vec.

resetTranslation
void resetTranslation()

Overloadable method to reset the position. The position is set to 0|0.

setPosition
void setPosition(Vector2f vec)

Setting a new position.

setPosition
void setPosition(float x, float y)

Setting a new position.

Properties

position
inout(Vector2f) position [@property getter]

Returns an inout reference to the coordinates. It should be used to set or get the x and y coordinates. If you (re)set the position herewith, it doesn't appear in <b>_positionMoved</b> or <b>_positionReset</b>.

Meta

Authors

rschuett