Jagguar Game Engine

Loading...
Searching...
No Matches
TransformComponent.hpp
1#ifndef TRANSFORMCOMPONENT_HPP
2#define TRANSFORMCOMPONENT_HPP
3
4#include "TinyMath.hpp"
5#include "Component.hpp"
6#include <string>
7
12 class TransformComponent : public Component {
13 public:
20 TransformComponent(int _x, int _y);
21
25 ~TransformComponent();
26
33 void SetTransform(Vec2D _pos);
34
42 void SetTransform(int _x, int _y);
43
44 void Update(SDL_Event e, int frame, std::vector<std::string> broadcastList) override;
45
46 void Render(SDL_Renderer *ren) override;
47
48 void ShowComponentEditor(bool* showEditor) override;
49
55 Vec2D getPos() const;
56
57 const char* ComponentTypeName() override {return "Transform Component";}
58
59 private:
60 Vec2D position;
61 std::vector<ComponentTag> tags = {ComponentTag::Position};
62};
63
64#endif
Component
Definition: Component.hpp:38
TransformComponent
Definition: TransformComponent.hpp:12
TransformComponent::ShowComponentEditor
void ShowComponentEditor(bool *showEditor) override
Definition: TransformComponent.cpp:44
TransformComponent::~TransformComponent
~TransformComponent()
Definition: TransformComponent.cpp:23
TransformComponent::getPos
Vec2D getPos() const
Definition: TransformComponent.cpp:19
TransformComponent::SetTransform
void SetTransform(Vec2D _pos)
Definition: TransformComponent.cpp:8
TransformComponent::Update
void Update(SDL_Event e, int frame, std::vector< std::string > broadcastList) override
Definition: TransformComponent.cpp:37
TransformComponent::ComponentTypeName
const char * ComponentTypeName() override
Definition: TransformComponent.hpp:57
TransformComponent::Render
void Render(SDL_Renderer *ren) override
Definition: TransformComponent.cpp:41
Vec2D
Definition: TinyMath.hpp:14