diff --git a/SHADE_Engine/src/UI/SHButtonComponent.cpp b/SHADE_Engine/src/UI/SHButtonComponent.cpp new file mode 100644 index 00000000..d711d682 --- /dev/null +++ b/SHADE_Engine/src/UI/SHButtonComponent.cpp @@ -0,0 +1,15 @@ +#include "SHpch.h" +#include "SHButtonComponent.h" + + +namespace SHADE +{ + SHButtonComponent::SHButtonComponent() + :size(0.0f), offset(0.0f), isHovered(false) + { + } + + + + +} \ No newline at end of file diff --git a/SHADE_Engine/src/UI/SHButtonComponent.h b/SHADE_Engine/src/UI/SHButtonComponent.h new file mode 100644 index 00000000..e68f354f --- /dev/null +++ b/SHADE_Engine/src/UI/SHButtonComponent.h @@ -0,0 +1,31 @@ +#pragma once + +#include "SH_API.h" +#include "ECS_Base/Components/SHComponent.h" +#include "Math/Vector/SHVec3.h" +#include "Math/Vector/SHVec2.h" + + +namespace SHADE +{ + class SH_API SHButtonComponent final: public SHComponent + { + public: + SHButtonComponent(); + ~SHButtonComponent() = default; + + SHVec2 size; + SHVec2 offset; + + + + private: + + bool isHovered; + + + + }; + + +} \ No newline at end of file diff --git a/SHADE_Engine/src/UI/SHUISystem.cpp b/SHADE_Engine/src/UI/SHUISystem.cpp index d7dfe3c5..44730529 100644 --- a/SHADE_Engine/src/UI/SHUISystem.cpp +++ b/SHADE_Engine/src/UI/SHUISystem.cpp @@ -108,6 +108,10 @@ namespace SHADE } } + void SHUISystem::UpdateButtonComponent(SHButtonComponent& comp) noexcept + { + + } }//end namespace diff --git a/SHADE_Engine/src/UI/SHUISystem.h b/SHADE_Engine/src/UI/SHUISystem.h index 3da7efb3..15b710aa 100644 --- a/SHADE_Engine/src/UI/SHUISystem.h +++ b/SHADE_Engine/src/UI/SHUISystem.h @@ -4,6 +4,7 @@ #include "ECS_Base/System/SHSystem.h" #include "ECS_Base/System/SHSystemRoutine.h" #include "SHUIComponent.h" +#include "SHButtonComponent.h" #include "SHCanvasComponent.h" #include "Scene/SHSceneGraph.h" #include "Scene/SHSceneManager.h" @@ -39,13 +40,22 @@ namespace SHADE friend class UpdateUIMatrixRoutine; + class SH_API UpdateButtonsRoutine final: public SHSystemRoutine + { + public: + UpdateButtonsRoutine() : SHSystemRoutine("Update Buttons Routine", true) {}; + virtual void Execute(double dt) noexcept override final; + }; + friend class UpdateButtonsRoutine; + + void Init(); void Exit(); private: void UpdateUIComponent(SHUIComponent& comp) noexcept; - + void UpdateButtonComponent(SHButtonComponent& comp) noexcept;