From 1b96c6e3c57b9d1dc5fb02cbd24b625d7f7f5b05 Mon Sep 17 00:00:00 2001 From: jaroWMR Date: Wed, 23 Oct 2024 18:44:24 +0200 Subject: moved transform --- src/crepe/api/CMakeLists.txt | 2 ++ src/crepe/api/Transform.cpp | 6 ++++++ src/crepe/api/Transform.h | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/crepe/api/Transform.cpp create mode 100644 src/crepe/api/Transform.h (limited to 'src/crepe/api') 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 -- cgit v1.2.3