SDL Utility
Transformable.hpp
Go to the documentation of this file.
1
7
#pragma once
8
9
#include "
structures/Vector2.hpp
"
10
11
SDLU_BEGIN
20
class
Transformable
21
{
22
public
:
26
Transformable
();
27
31
virtual
~Transformable
();
32
38
Vector2f
GetPosition
();
39
45
void
SetPosition
(
const
Vector2f
&
position
);
46
53
void
SetPosition
(
float
x,
float
y);
54
60
void
Move
(
const
Vector2f
&
position
);
61
68
void
Move
(
float
x,
float
y);
69
70
76
Vector2f
GetOrigin
();
77
83
void
SetOrigin
(
const
Vector2f
&
origin
);
84
91
void
SetOrigin
(
float
x,
float
y);
92
98
Vector2f
GetScale
();
99
105
void
SetScale
(
const
Vector2f
&
scale
);
106
113
void
SetScale
(
float
x,
float
y);
114
120
void
Scale
(
const
Vector2f
&
scale
);
121
128
void
Scale
(
float
x,
float
y);
129
135
float
GetRotation
();
136
142
void
SetRotation
(
float
angle);
143
149
void
Rotate
(
float
angle);
150
151
protected
:
152
Vector2f
position
;
153
Vector2f
origin
;
154
Vector2f
scale
;
155
float
rotation
;
156
};
157
SDLU_END
SDLU_BEGIN
#define SDLU_BEGIN
Definition:
Util.hpp:32
Vector2.hpp
Provides a structure for simple vector calculations.
Transformable
A class that stores locational information.
Definition:
Transformable.hpp:21
Transformable::SetOrigin
void SetOrigin(const Vector2f &origin)
Sets a new local origin.
Transformable::SetPosition
void SetPosition(const Vector2f &position)
Sets a new position.
Transformable::Scale
void Scale(const Vector2f &scale)
Scales the object by some amount.
Transformable::SetPosition
void SetPosition(float x, float y)
Sets a new position.
Transformable::Move
void Move(float x, float y)
Adds to the current position.
Transformable::position
Vector2f position
Position of the object.
Definition:
Transformable.hpp:152
Transformable::GetRotation
float GetRotation()
Gets the current rotation.
Transformable::Move
void Move(const Vector2f &position)
Adds to the current position.
Transformable::GetPosition
Vector2f GetPosition()
Returns the position of the object.
Transformable::scale
Vector2f scale
Scale of the object.
Definition:
Transformable.hpp:154
Transformable::GetScale
Vector2f GetScale()
Gets the current scale of the object.
Transformable::SetRotation
void SetRotation(float angle)
Sets a new rotation.
Transformable::SetScale
void SetScale(const Vector2f &scale)
Sets a new scale.
Transformable::SetOrigin
void SetOrigin(float x, float y)
Sets a new local origin.
Transformable::SetScale
void SetScale(float x, float y)
Sets a new scale.
Transformable::Scale
void Scale(float x, float y)
Scales the object by some amount.
Transformable::rotation
float rotation
Rotation of the object (in degrees)
Definition:
Transformable.hpp:155
Transformable::origin
Vector2f origin
Offset of the top-left corner from the position.
Definition:
Transformable.hpp:153
Transformable::Transformable
Transformable()
Default constructur.
Transformable::GetOrigin
Vector2f GetOrigin()
Gets the current local origin.
Transformable::Rotate
void Rotate(float angle)
Rotates by some amount.
Transformable::~Transformable
virtual ~Transformable()
Deconstructor.
Vector2< float >
include
graphics
drawable
Transformable.hpp
Generated by
1.9.1