diff options
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/crepe/api/Transform.cpp | 6 | ||||
-rw-r--r-- | src/crepe/api/Transform.h | 22 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/crepe/api/CMakeLists.txt b/src/crepe/api/CMakeLists.txt index 465ba46..ef01594 100644 --- a/src/crepe/api/CMakeLists.txt +++ b/src/crepe/api/CMakeLists.txt @@ -7,6 +7,7 @@ target_sources(crepe PUBLIC Sprite.cpp Force.cpp ParticleEmitter.cpp + Transform.cpp ) target_sources(crepe PUBLIC FILE_SET HEADERS FILES @@ -19,5 +20,6 @@ target_sources(crepe PUBLIC FILE_SET HEADERS FILES Sprite.h Force.h ParticleEmitter.h + Transform.h ) diff --git a/src/crepe/api/Transform.cpp b/src/crepe/api/Transform.cpp new file mode 100644 index 0000000..2c39523 --- /dev/null +++ b/src/crepe/api/Transform.cpp @@ -0,0 +1,6 @@ +#include "Transform.h" + +using namespace crepe; + +Transform::Transform(uint32_t gameObjectId,Position position, int rotation, int scale) + : Component(gameObjectId), postion(postion), rotation(rotation), scale(scale) {} diff --git a/src/crepe/api/Transform.h b/src/crepe/api/Transform.h new file mode 100644 index 0000000..3e8d142 --- /dev/null +++ b/src/crepe/api/Transform.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Component.h" + +namespace crepe { + +struct Position +{ + int x; + int y; +}; + + +class Transform : public Component { +public: + Transform(uint32_t gameObjectId,Position position, int rotation, int scale); + Position postion; + int rotation; + int scale; +}; + +} // namespace crepe |