Public Member Functions | List of all members
ime::ITransformable Class Referenceabstract

Interface for transformable entities. More...

#include <ITransformable.h>

Inheritance diagram for ime::ITransformable:
ime::Shape ime::Sprite ime::ui::Widget ime::CircleShape ime::ConvexShape ime::RectangleShape ime::ui::ClickableWidget ime::ui::Label ime::ui::MenuBar ime::ui::Separator ime::ui::Slider ime::ui::SpinControl ime::ui::Tabs ime::ui::TabsContainer ime::ui::WidgetContainer

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

Detailed Description

Interface for transformable entities.

Definition at line 35 of file ITransformable.h.

Constructor & Destructor Documentation

◆ ~ITransformable()

virtual ime::ITransformable::~ITransformable ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getOrigin()

virtual Vector2f ime::ITransformable::getOrigin ( ) const
pure virtual

Get the local origin of the object.

Returns
Local origin of the object

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ getPosition()

virtual Vector2f ime::ITransformable::getPosition ( ) const
pure virtual

Get the position of the object.

Returns
Current position of the object

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ getRotation()

virtual float ime::ITransformable::getRotation ( ) const
pure virtual

Get the orientation of the object, in degrees.

Returns
Current rotation, in degrees

The rotation is always in the range [0, 360]

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ getScale()

virtual Vector2f ime::ITransformable::getScale ( ) const
pure virtual

Get the current scale of the object.

Returns
Current scale of the object

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ move() [1/2]

virtual void ime::ITransformable::move ( const Vector2f offset)
pure virtual

Move the object by a given offset.

Parameters
offsetOffset to apply

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

See also
setPosition

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ move() [2/2]

virtual void ime::ITransformable::move ( float  offsetX,
float  offsetY 
)
pure virtual

Move the object by a given offset.

Parameters
offsetXHorizontal offset
offsetYVertical offset

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

See also
setPosition

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ rotate()

virtual void ime::ITransformable::rotate ( float  angle)
pure virtual

Rotate the object.

Parameters
angleAngle of rotation, in degrees

This function adds to the current rotation of the object, unlike setRotation which overwrites it

See also
setRotation

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ scale() [1/2]

virtual void ime::ITransformable::scale ( const Vector2f offset)
pure virtual

Scale the object by an offset.

Parameters
offsetOffset to apply

This function multiplies the current scale of the object, unlike setScale which overwrites it

See also
setScale

Implemented in ime::Shape, ime::ui::Widget, and ime::Sprite.

◆ scale() [2/2]

virtual void ime::ITransformable::scale ( float  factorX,
float  factorY 
)
pure virtual

Scale the object by an offset.

Parameters
factorXHorizontal scale factor
factorYVertical scale factor

This function multiplies the current scale of the object, unlike setScale which overwrites it

See also
setScale

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ setOrigin() [1/2]

virtual void ime::ITransformable::setOrigin ( const Vector2f origin)
pure virtual

Set the local origin of the object.

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

◆ setOrigin() [2/2]

virtual void ime::ITransformable::setOrigin ( float  x,
float  y 
)
pure virtual

Set the local origin of the object.

Parameters
xX coordinate of the new origin
yY 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.

◆ setPosition() [1/2]

virtual void ime::ITransformable::setPosition ( const Vector2f position)
pure virtual

Set the position of the object.

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

◆ setPosition() [2/2]

virtual void ime::ITransformable::setPosition ( float  x,
float  y 
)
pure virtual

Set the position of the object.

Parameters
xX coordinate of the new position
yY 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.

◆ setRotation()

virtual void ime::ITransformable::setRotation ( float  angle)
pure virtual

Set the orientation of the object.

Parameters
angleNew 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

See also
rotate

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ setScale() [1/2]

virtual void ime::ITransformable::setScale ( const Vector2f scale)
pure virtual

Set the scale factor of the object.

Parameters
scaleNew scale

This function completely overwrites the previous scale

See also
scale

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.

◆ setScale() [2/2]

virtual void ime::ITransformable::setScale ( float  factorX,
float  factorY 
)
pure virtual

Set the scale factors of the object.

Parameters
factorXNew horizontal scale factor
factorYNew vertical scale factor

This function completely overwrites the previous scale

See also
scale

Implemented in ime::Shape, ime::Sprite, and ime::ui::Widget.


The documentation for this class was generated from the following file: