Transformable

Basic implementation for transformable objects.

Members

Functions

_applyTranslation
void _applyTranslation()

Apply translation to the object.

calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point.

getCenter
const(Vector2s) getCenter()

Returns the rotation center.

getRotation
short getRotation()

Returns the current rotation.

getScale
float getScale()

Returns the current scale/zoom.

resetTranslation
void resetTranslation()

Reset the translation.

rotate
void rotate(short rotAngle)

Increase/Decrease the rotation.

scale
void scale(float zoom)

Increase/Decrease the scale/zoom.

setCenter
void setCenter(Vector2s center)

Set the rotation center.

setCenter
void setCenter(short x, short y)

Set the rotation center.

setRotation
void setRotation(short rotAngle)

Set a (new) rotation.

setScale
void setScale(float zoom)

Set a new scale.

Inherited Members

From Moveable

_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.

_applyTranslation
void _applyTranslation()

Apply translation to the object.

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.

getPosition
const(Vector2f) getPosition()

Returns the current position.

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>.

move
void move(Vector2f vec)

Move the current position by vec.

move
void move(float x, float y)

Move the current position by x|y.

Meta

Authors

rschuett