Added Buttons, Added Canvas Scaling matrix, Added Serialization of buttons and camera arm #250
|
@ -0,0 +1,15 @@
|
|||
#include "SHpch.h"
|
||||
#include "SHButtonComponent.h"
|
||||
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
SHButtonComponent::SHButtonComponent()
|
||||
:size(0.0f), offset(0.0f), isHovered(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
|
@ -108,6 +108,10 @@ namespace SHADE
|
|||
}
|
||||
}
|
||||
|
||||
void SHUISystem::UpdateButtonComponent(SHButtonComponent& comp) noexcept
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}//end namespace
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue