The transform component is responsible for the position, direction and size of an entity. It is used to move the entity in the game world and to determine its size and position on the screen.
More...
#include <TransformComponent.h>
The transform component is responsible for the position, direction and size of an entity. It is used to move the entity in the game world and to determine its size and position on the screen.
◆ TransformComponent() [1/3]
| TransformComponent::TransformComponent |
( |
float | scale = 1 | ) |
|
|
explicit |
- Attention
- in order to allow an entity to move the stat "speed" must be set in the DataComponent (written exactly like that and set to any positive int value, 0 will lead to no movement, negative numbers to backwards movement)
- Parameters
-
| scale | base value is 1 (32x32px), size gets multiplied with scale |
◆ TransformComponent() [2/3]
| TransformComponent::TransformComponent |
( |
float | x, |
|
|
float | y, |
|
|
float | scale = 1 ) |
- Parameters
-
| x | x coordinate of spawnposition |
| y | y coordinate of spawnposition |
| scale | base value is 1 (32x32px per default), size gets multiplied with scale |
◆ TransformComponent() [3/3]
| TransformComponent::TransformComponent |
( |
float | x, |
|
|
float | y, |
|
|
int | w, |
|
|
int | h, |
|
|
float | scale = 1 ) |
- Parameters
-
| x | x coordinate of spawnposition |
| y | y coordinate of spawnposition |
| w | add custom width |
| h | add custom height |
| scale | base value is 1 (32x32px per default), size gets multiplied with scale |
The documentation for this class was generated from the following files: