Transformable

Base class for Drawables containing code for rotation, scaling and translation around an origin.

Members

Functions

move
void move(vec2 amount)

Moves this with the specified amount relatively.

rotate
void rotate(float amount)

Rotates this around origin with the specified amount relatively.

scale
void scale(vec2 amount)

Scales this around origin with the specified amount relatively.

Properties

origin
vec2 origin [@property setter]

Sets the origin position of this transform.

origin
vec2 origin [@property getter]

Gets the origin position of this transform.

position
vec2 position [@property setter]

Sets the position of this transform.

position
vec2 position [@property getter]

Gets the position of this transform.

rotation
float rotation [@property getter]

Gets the rotation of this transform.

rotation
float rotation [@property setter]

Sets the rotation of this transform.

scaling
vec2 scaling [@property setter]

Sets the scaling of this transform.

scaling
vec2 scaling [@property getter]

Gets the scaling of this transform.

transform
mat4 transform [@property getter]

Calculates the transformation matrix when needed and returns it.

Meta