diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.h b/SHADE_Engine/src/Camera/SHCameraSystem.h index fc6e9166..9c8157f4 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.h +++ b/SHADE_Engine/src/Camera/SHCameraSystem.h @@ -37,8 +37,6 @@ namespace SHADE void Exit (void); - friend class EditorCameraUpdate; - class SH_API CameraSystemUpdate final: public SHSystemRoutine { public: diff --git a/SHADE_Engine/src/UI/SHCanvasComponent.cpp b/SHADE_Engine/src/UI/SHCanvasComponent.cpp new file mode 100644 index 00000000..4c9ea360 --- /dev/null +++ b/SHADE_Engine/src/UI/SHCanvasComponent.cpp @@ -0,0 +1,55 @@ +#include "SHpch.h" + +#include "SHCanvasComponent.h" + +namespace SHADE +{ + + SHCanvasComponent::SHCanvasComponent() + :width(1),height(1), dirtyMatrix(false) + { + + } + + void SHCanvasComponent::SetCanvasSize(CanvasSizeType width, CanvasSizeType height) noexcept + { + this->width = width; + this->height = height; + } + + void SHCanvasComponent::SetCanvasWidth(CanvasSizeType val) noexcept + { + width = val; + } + + void SHCanvasComponent::SetCanvasHeight(CanvasSizeType val) noexcept + { + height = val; + } + + + SHCanvasComponent::CanvasSizeType const SHCanvasComponent::GetCanvasWidth() const noexcept + { + return width; + } + + SHCanvasComponent::CanvasSizeType const SHCanvasComponent::GetCanvasHeight() const noexcept + { + return height; + } + +} + + +RTTR_REGISTRATION +{ + using namespace SHADE; + using namespace rttr; + + registration::class_("Canvas Component") + .property("Canvas Width", &SHCanvasComponent::GetCanvasWidth, &SHCanvasComponent::SetCanvasWidth) + .property("Canvas Height", &SHCanvasComponent::GetCanvasHeight, &SHCanvasComponent::SetCanvasHeight) + ; + + +} diff --git a/SHADE_Engine/src/UI/SHCanvasComponent.h b/SHADE_Engine/src/UI/SHCanvasComponent.h index 2e9a54f1..63d8c2c4 100644 --- a/SHADE_Engine/src/UI/SHCanvasComponent.h +++ b/SHADE_Engine/src/UI/SHCanvasComponent.h @@ -1,7 +1,10 @@ #pragma once +#include + #include "SH_API.h" #include "ECS_Base/Components/SHComponent.h" +#include "Math/SHMatrix.h" namespace SHADE @@ -13,6 +16,9 @@ namespace SHADE public: + friend class SHUISystem; + + SHCanvasComponent(); ~SHCanvasComponent() = default; @@ -26,9 +32,11 @@ namespace SHADE private: CanvasSizeType width; CanvasSizeType height; - - + bool dirtyMatrix; + SHMatrix modelToCanvasMatrix; + + RTTR_ENABLE() }; diff --git a/SHADE_Engine/src/UI/SHUIComponent.cpp b/SHADE_Engine/src/UI/SHUIComponent.cpp new file mode 100644 index 00000000..66522947 --- /dev/null +++ b/SHADE_Engine/src/UI/SHUIComponent.cpp @@ -0,0 +1,20 @@ +#include "SHpch.h" +#include "SHUIComponent.h" + + + +namespace SHADE +{ + + SHUIComponent::SHUIComponent() + { + + } + + + SHMatrix const& SHUIComponent::GetMatrix()const noexcept + { + return LocalToCanvasMatrix; + } + +} \ No newline at end of file diff --git a/SHADE_Engine/src/UI/SHUIComponent.h b/SHADE_Engine/src/UI/SHUIComponent.h new file mode 100644 index 00000000..70a667e8 --- /dev/null +++ b/SHADE_Engine/src/UI/SHUIComponent.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include "SH_API.h" +#include "ECS_Base/Components/SHComponent.h" +#include "Math/SHMatrix.h" + + +namespace SHADE +{ + class SH_API SHUIComponent final: public SHComponent + { + public: + friend class SHUISystem; + + SHUIComponent(); + ~SHUIComponent() = default; + + SHMatrix const& GetMatrix() const noexcept; + + + private: + SHMatrix LocalToCanvasMatrix; + + + + RTTR_ENABLE() + } + + +} \ No newline at end of file