A component that represents a 2D transformation.
More...
#include <TransformComponent.hpp>
|
|
| TransformComponent (SDL_FRect rectangle) |
| |
| void | Input (float deltaTime) override |
| | Handle input.
|
| |
| void | Update (float deltaTime) override |
| | Update the game state.
|
| |
| void | Render (SDL_Renderer *renderer) override |
| | Render the game.
|
| |
| ComponentType | GetType () override |
| | Get the type of the component.
|
| |
| void | SetW (float w) |
| | Set the width of the transformation.
|
| |
| void | SetH (float h) |
| | Set the height of the transformation.
|
| |
| void | SetWH (float w, float h) |
| | Set the width and height of the transformation.
|
| |
| float | GetW () const |
| | Get the width of the transformation.
|
| |
| float | GetH () const |
| | Get the height of the transformation.
|
| |
| void | SetX (float x) |
| | Set the x position of the transformation.
|
| |
| void | SetY (float y) |
| | Set the y position of the transformation.
|
| |
| void | SetXY (float x, float y) |
| | Set the x and y position of the transformation.
|
| |
| float | GetX () const |
| | Get the x position of the transformation.
|
| |
| float | GetY () const |
| | Get the y position of the transformation.
|
| |
| SDL_FRect | GetRectangle () const |
| | Get the transformation as an SDL_FRect.
|
| |
| void | SetGameEntity (std::shared_ptr< GameEntity > gameEntity) |
| | Set the game entity that the component is attached to.
|
| |
| std::shared_ptr< GameEntity > | GetGameEntity () |
| | Get the game entity that the component is attached to.
|
| |
A component that represents a 2D transformation.
◆ GetH()
| float TransformComponent::GetH |
( |
| ) |
const |
Get the height of the transformation.
- Returns
- float
◆ GetRectangle()
| SDL_FRect TransformComponent::GetRectangle |
( |
| ) |
const |
Get the transformation as an SDL_FRect.
- Returns
- SDL_FRect
◆ GetType()
| ComponentType TransformComponent::GetType |
( |
| ) |
|
|
overridevirtual |
Get the type of the component.
- Returns
- ComponentType
Implements Component.
◆ GetW()
| float TransformComponent::GetW |
( |
| ) |
const |
Get the width of the transformation.
- Returns
- float
◆ GetX()
| float TransformComponent::GetX |
( |
| ) |
const |
Get the x position of the transformation.
- Returns
- float
◆ GetY()
| float TransformComponent::GetY |
( |
| ) |
const |
Get the y position of the transformation.
- Returns
- float
◆ Input()
| void TransformComponent::Input |
( |
float | deltaTime | ) |
|
|
overridevirtual |
Handle input.
- Parameters
-
| deltaTime | Time since last frame |
Reimplemented from Component.
◆ Render()
| void TransformComponent::Render |
( |
SDL_Renderer * | renderer | ) |
|
|
overridevirtual |
Render the game.
- Parameters
-
Reimplemented from Component.
◆ SetH()
| void TransformComponent::SetH |
( |
float | h | ) |
|
Set the height of the transformation.
- Parameters
-
◆ SetW()
| void TransformComponent::SetW |
( |
float | w | ) |
|
Set the width of the transformation.
- Parameters
-
◆ SetWH()
| void TransformComponent::SetWH |
( |
float | w, |
|
|
float | h ) |
Set the width and height of the transformation.
- Parameters
-
◆ SetX()
| void TransformComponent::SetX |
( |
float | x | ) |
|
Set the x position of the transformation.
- Parameters
-
◆ SetXY()
| void TransformComponent::SetXY |
( |
float | x, |
|
|
float | y ) |
Set the x and y position of the transformation.
- Parameters
-
◆ SetY()
| void TransformComponent::SetY |
( |
float | y | ) |
|
Set the y position of the transformation.
- Parameters
-
◆ Update()
| void TransformComponent::Update |
( |
float | deltaTime | ) |
|
|
overridevirtual |
Update the game state.
- Parameters
-
| deltaTime | Time since last frame |
Reimplemented from Component.
The documentation for this struct was generated from the following file: