CS4850 Final Project
Loading...
Searching...
No Matches
TransformComponent.hpp
1#pragma once
2#include <SDL2/SDL.h>
3#include <memory>
4#include <string>
5
6#include "Component.hpp"
7
13 TransformComponent(SDL_FRect rectangle);
14
16
17 void Input(float deltaTime) override;
18 void Update(float deltaTime) override;
19 void Render(SDL_Renderer* renderer) override;
20
21 ComponentType GetType() override;
22
28 void SetW(float w);
29
35 void SetH(float h);
36
43 void SetWH(float w, float h);
44
50 float GetW() const;
51
57 float GetH() const;
58
64 void SetX(float x);
65
71 void SetY(float y);
72
79 void SetXY(float x, float y);
80
86 float GetX() const;
87
93 float GetY() const;
94
100 SDL_FRect GetRectangle() const;
101
102 private:
103 SDL_FRect mRectangle;
104};
Base class for all components.
Definition Component.hpp:15
A component that represents a 2D transformation.
Definition TransformComponent.hpp:12
void Input(float deltaTime) override
Handle input.
void SetH(float h)
Set the height of the transformation.
void SetXY(float x, float y)
Set the x and y position of the transformation.
void SetWH(float w, float h)
Set the width and height of the transformation.
ComponentType GetType() override
Get the type of the component.
float GetX() const
Get the x position of the transformation.
void Render(SDL_Renderer *renderer) override
Render the game.
void Update(float deltaTime) override
Update the game state.
void SetX(float x)
Set the x position of the transformation.
SDL_FRect GetRectangle() const
Get the transformation as an SDL_FRect.
void SetY(float y)
Set the y position of the transformation.
void SetW(float w)
Set the width of the transformation.
float GetY() const
Get the y position of the transformation.
float GetW() const
Get the width of the transformation.
float GetH() const
Get the height of the transformation.