Added UI functionality to the Graphics System #232

Merged
Xenosas1337 merged 40 commits from UI_Integration into main 2022-11-20 15:43:34 +08:00
3 changed files with 25 additions and 2 deletions
Showing only changes of commit 09249cf9e8 - Show all commits

View File

@ -18,6 +18,8 @@
#include "Physics/Interface/SHColliderComponent.h"
#include "Camera/SHCameraComponent.h"
#include "Camera/SHCameraArmComponent.h"
#include "UI/SHUIComponent.h"
#include "UI/SHCanvasComponent.h"
#include "SHEditorComponentView.h"
namespace SHADE
@ -132,6 +134,14 @@ namespace SHADE
{
DrawComponent(cameraArmComponent);
}
if (auto canvasComponent= SHComponentManager::GetComponent_s<SHCanvasComponent>(eid))
{
DrawComponent(canvasComponent);
}
if (auto uiComponent = SHComponentManager::GetComponent_s<SHUIComponent>(eid))
{
DrawComponent(uiComponent);
}
ImGui::Separator();
// Render Scripts
SHScriptEngine* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
@ -143,6 +153,7 @@ namespace SHADE
DrawAddComponentButton<SHCameraComponent>(eid);
DrawAddComponentButton<SHCameraArmComponent>(eid);
DrawAddComponentButton<SHLightComponent>(eid);
DrawAddComponentButton<SHCanvasComponent>(eid);
// Components that require Transforms

View File

@ -17,6 +17,16 @@ namespace SHADE
return localToCanvasMatrix;
}
EntityID SHUIComponent::GetCanvasID() const noexcept
{
return canvasID;
}
void SHUIComponent::SetCanvasID(EntityID id) noexcept
{
(void)id;
}
}
@ -25,7 +35,8 @@ RTTR_REGISTRATION
using namespace SHADE;
using namespace rttr;
registration::class_<SHUIComponent>("Canvas Component")
registration::class_<SHUIComponent>("UI Component")
.property("Canvas ID", &SHUIComponent::GetCanvasID, &SHUIComponent::SetCanvasID)
;

View File

@ -18,7 +18,8 @@ namespace SHADE
~SHUIComponent() = default;
SHMatrix const& GetMatrix() const noexcept;
EntityID GetCanvasID() const noexcept;
void SetCanvasID(EntityID id) noexcept;
private:
SHMatrix localToCanvasMatrix;