Transformable

Transformable is an abstract class which enables his child classes to be transformable which means that they have a position, can be scaled and can be rotated. For that purpose an additional Matrix is used (besides the Vector2f and float components) which maps the transformations.

See: Matrix4 See: Vector2f

Members

Functions

getMatrix
const(Matrix4x4) getMatrix()

Returns the current matrix. If any transformations was made, the matrix is updated before

getOrigin
const(Vector2f) getOrigin()

Returns the current origin

getPosition
const(Vector2f) getPosition()

Returns the current position

getRotation
float getRotation()

Returns the current rotation

getRotationCenter
const(Vector2f) getRotationCenter()

Returns the current rotation center

getScale
const(Vector2f) getScale()

Returns the current scaling

move
void move(float x, float y)

Move the position by offset (x, y)

move
void move(const Vector2f offset)

Move the position by offset (x, y)

rotate
void rotate(float rotation)

Inc-/Decrease the rotation. If the rotation is <b>after</b> that not in range of 0 .. 360 it will be set to 0.

scale
void scale(const Vector2f offset)

Inc-/Decrease the scaling

scale
void scale(float offset)

Inc-/Decrease the scaling

setOrigin
void setOrigin(float x, float y)

Sets the origin. The origin is a offset which is added to the position and serves as center position for scaling and rotation.

setOrigin
void setOrigin(const Vector2f origin)

Sets the origin. The origin is a offset which is added to the position and serves as center position for scaling and rotation.

setPosition
void setPosition(float x, float y)

Sets the position

setPosition
void setPosition(const Vector2f pos)

Sets the position

setRotation
void setRotation(float rotation)

Set the rotation angle. If not in range of 0 .. 360 it will be set to 0.

setRotationCenter
void setRotationCenter(float x, float y)

Sets the center position

setRotationCenter
void setRotationCenter(const Vector2f center)

Sets the center of the rotation

setScale
void setScale(float x, float y)

Sets the scaling (for both, x and y)

setScale
void setScale(const Vector2f offset)

Sets the scaling (for both, x and y)

Properties

x
float x [@property getter]

Returns the x coordinate <b>by value</b>

x
float x [@property setter]

Sets a new x coordinate

y
float y [@property getter]

Returns the y coordinate <b>by value</b>

y
float y [@property setter]

Sets a new y coordinate

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)