Interface for transformable entities. More...
#include <ITransformable.h>
Public Member Functions | |
virtual void | setPosition (float x, float y)=0 |
Set the position of the object. More... | |
virtual void | setPosition (const Vector2f &position)=0 |
Set the position of the object. More... | |
virtual Vector2f | getPosition () const =0 |
Get the position of the object. More... | |
virtual void | setRotation (float angle)=0 |
Set the orientation of the object. More... | |
virtual void | rotate (float angle)=0 |
Rotate the object. More... | |
virtual float | getRotation () const =0 |
Get the orientation of the object, in degrees. More... | |
virtual void | setScale (float factorX, float factorY)=0 |
Set the scale factors of the object. More... | |
virtual void | setScale (const Vector2f &scale)=0 |
Set the scale factor of the object. More... | |
virtual void | scale (float factorX, float factorY)=0 |
Scale the object by an offset. More... | |
virtual void | scale (const Vector2f &offset)=0 |
Scale the object by an offset. More... | |
virtual Vector2f | getScale () const =0 |
Get the current scale of the object. More... | |
virtual void | setOrigin (float x, float y)=0 |
Set the local origin of the object. More... | |
virtual void | setOrigin (const Vector2f &origin)=0 |
Set the local origin of the object. More... | |
virtual Vector2f | getOrigin () const =0 |
Get the local origin of the object. More... | |
virtual void | move (float offsetX, float offsetY)=0 |
Move the object by a given offset. More... | |
virtual void | move (const Vector2f &offset)=0 |
Move the object by a given offset. More... | |
virtual | ~ITransformable ()=default |
Destructor. More... | |
Interface for transformable entities.
Definition at line 35 of file ITransformable.h.
|
virtualdefault |
Destructor.
|
pure virtual |
Get the local origin of the object.
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Get the position of the object.
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Get the orientation of the object, in degrees.
The rotation is always in the range [0, 360]
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Get the current scale of the object.
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Move the object by a given offset.
offset | Offset to apply |
This function adds to the current position of the object, unlike setPosition which overwrites it
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Move the object by a given offset.
offsetX | Horizontal offset |
offsetY | Vertical offset |
This function adds to the current position of the object, unlike setPosition which overwrites it
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Rotate the object.
angle | Angle of rotation, in degrees |
This function adds to the current rotation of the object, unlike setRotation which overwrites it
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Scale the object by an offset.
offset | Offset to apply |
This function multiplies the current scale of the object, unlike setScale which overwrites it
Implemented in ime::Shape, ime::ui::Widget, and ime::Sprite.
|
pure virtual |
Scale the object by an offset.
factorX | Horizontal scale factor |
factorY | Vertical scale factor |
This function multiplies the current scale of the object, unlike setScale which overwrites it
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the local origin of the object.
origin | New origin |
The origin of an object defines the center point for all transformations (position, scale, rotation). 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)
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the local origin of the object.
x | X coordinate of the new origin |
y | Y coordinate of the new origin |
The origin of an object defines the center point for all transformations (position, scale, rotation). 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)
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the position of the object.
position | New position |
This function completely overwrites the previous position. See the move function to apply an offset based on the previous position instead. The default position of a transformable object is (0, 0).
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the position of the object.
x | X coordinate of the new position |
y | Y coordinate of the new position |
This function completely overwrites the previous position. See the move function to apply an offset based on the previous position instead. The default position of a transformable object is (0, 0).
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the orientation of the object.
angle | New rotation, in degrees |
This function completely overwrites the previous rotation. See the rotate function to add an angle based on the previous rotation instead. The default rotation of a transformable object is 0
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the scale factor of the object.
scale | New scale |
This function completely overwrites the previous scale
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.
|
pure virtual |
Set the scale factors of the object.
factorX | New horizontal scale factor |
factorY | New vertical scale factor |
This function completely overwrites the previous scale
Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.