# dsfml.graphics.transformable

- interface
__Transformable__; - Decomposed transform defined by a position, a rotation, and a scale.

This interface is provided for convenience, on top of Transform.

**Authors:**

Laurent Gomila, Jeremy DeHaan

**See Also:**

**http:**

//www.sfml-dev.org/documentation/2.0/classsf_1_1Transformable.php#details

- abstract @property Vector2f
__origin__(Vector2f*newOrigin*); - The local
__origin__of the object.

The__origin__of an object defines the center point for all transformations (position, scale, ratation).

The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default__origin__of a transformable object is (0, 0).

- abstract const @property Vector2f
__origin__(); - The local
__origin__of the object.

The__origin__of an object defines the center point for all transformations (position, scale, ratation).

The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default__origin__of a transformable object is (0, 0).

- abstract @property Vector2f
__position__(Vector2f*newPosition*); - The
__position__of the object. The default is (0, 0).

- abstract const @property Vector2f
__position__(); - The
__position__of the object. The default is (0, 0).

- abstract @property float
__rotation__(float*newRotation*); - The orientation of the object, in degrees. The default is 0 degrees.

- abstract const @property float
__rotation__(); - The orientation of the object, in degrees. The default is 0 degrees.

- abstract @property Vector2f
__scale__(Vector2f*newScale*); - The
__scale__factors of the object. The default is (1, 1).

- abstract const @property Vector2f
__scale__(); - The
__scale__factors of the object. The default is (1, 1).

- abstract const(Transform)
__getTransform__(); - Get the inverse of the combined transform of the object.

**Returns:**

Inverse of the combined transformations applied to the object.

- abstract const(Transform)
__getInverseTransform__(); - Get the combined transform of the object.

**Returns:**

Transform combining the position/rotation/scale/origin of the object.

- abstract void
__move__(Vector2f*offset*); - Move the object by a given
*offset*.

This function adds to the current position of the object, unlike the position property which overwrites it.

**Params:**

Vector2f *offset*The *offset*.

- abstract @property Vector2f
- template
__NormalTransformable__() - Decomposed transform defined by a position, a rotation, and a scale.

This template is provided for convenience, on top of Transformable (and Transform).

Transform, as a low-level class, offers a great level of flexibility but it is not always convenient to manage. Indeed, one can easily combine any kind of operation, such as a translation followed by a rotation followed by a scaling, but once the result transform is built, there's no way to go backward and, let's say, change only the rotation without modifying the translation and scaling.

The entire transform must be recomputed, which means that you need to retrieve the initial translation and scale factors as well, and combine them the same way you did before updating the rotation. This is a tedious operation, and it requires to store all the individual components of the final transform.

That's exactly what Transformable was written for: it hides these variables and the composed transform behind an easy to use interface. You can set or get any of the individual components without worrying about the others. It also provides the composed transform (as a Transform), and keeps it up-to-date.

**Authors:**

Laurent Gomila, Jeremy DeHaan

**See Also:**

**http:**

//www.sfml-dev.org/documentation/2.0/classsf_1_1Transformable.php#details

- Vector2f
__origin__(Vector2f*newOrigin*); - The local
__origin__of the object.

The__origin__of an object defines the center point for all transformations (position, scale, ratation).

The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default__origin__of a transformable object is (0, 0).

- const Vector2f
__origin__(); - The local
__origin__of the object.

The__origin__of an object defines the center point for all transformations (position, scale, ratation).

The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default__origin__of a transformable object is (0, 0).

- Vector2f
__position__(Vector2f*newPosition*); - The
__position__of the object. The default is (0, 0).

- const Vector2f
__position__(); - The
__position__of the object. The default is (0, 0).

- float
__rotation__(float*newRotation*); - The orientation of the object, in degrees. The default is 0 degrees.

- const float
__rotation__(); - The orientation of the object, in degrees. The default is 0 degrees.

- Vector2f
__scale__(Vector2f*newScale*); - The
__scale__factors of the object. The default is (1, 1).

- const Vector2f
__scale__(); - The
__scale__factors of the object. The default is (1, 1).

- const(Transform)
__getInverseTransform__(); - Get the inverse of the combined transform of the object.

**Returns:**

Inverse of the combined transformations applied to the object.

- const(Transform)
__getTransform__(); - Get the combined transform of the object.

**Returns:**

Transform combining the position/rotation/scale/origin of the object.

- void
__move__(Vector2f*offset*); - Move the object by a given
*offset*.

This function adds to the current position of the object, unlike the position property which overwrites it.

**Params:**

Vector2f *offset*The *offset*.

- Vector2f