aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorjaroWMR <jarorutjes07@gmail.com>2024-10-23 18:44:24 +0200
committerjaroWMR <jarorutjes07@gmail.com>2024-10-23 18:44:24 +0200
commit1b96c6e3c57b9d1dc5fb02cbd24b625d7f7f5b05 (patch)
tree2dfb9cbaf7cfc80ae5ab5536419af0e19994908f /src/crepe/api
parent0d2491e8619ec9012381ed3e39e85e37e0cb7765 (diff)
moved transform
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/CMakeLists.txt2
-rw-r--r--src/crepe/api/Transform.cpp6
-rw-r--r--src/crepe/api/Transform.h22
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