Added UI and Canvas to editor #223
|
@ -18,6 +18,8 @@
|
||||||
#include "Physics/Interface/SHColliderComponent.h"
|
#include "Physics/Interface/SHColliderComponent.h"
|
||||||
#include "Camera/SHCameraComponent.h"
|
#include "Camera/SHCameraComponent.h"
|
||||||
#include "Camera/SHCameraArmComponent.h"
|
#include "Camera/SHCameraArmComponent.h"
|
||||||
|
#include "UI/SHUIComponent.h"
|
||||||
|
#include "UI/SHCanvasComponent.h"
|
||||||
#include "SHEditorComponentView.h"
|
#include "SHEditorComponentView.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
|
@ -132,6 +134,14 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
DrawComponent(cameraArmComponent);
|
DrawComponent(cameraArmComponent);
|
||||||
}
|
}
|
||||||
|
if (auto canvasComponent= SHComponentManager::GetComponent_s<SHCanvasComponent>(eid))
|
||||||
|
{
|
||||||
|
DrawComponent(canvasComponent);
|
||||||
|
}
|
||||||
|
if (auto uiComponent = SHComponentManager::GetComponent_s<SHUIComponent>(eid))
|
||||||
|
{
|
||||||
|
DrawComponent(uiComponent);
|
||||||
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
// Render Scripts
|
// Render Scripts
|
||||||
SHScriptEngine* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
|
SHScriptEngine* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
|
||||||
|
@ -143,6 +153,7 @@ namespace SHADE
|
||||||
DrawAddComponentButton<SHCameraComponent>(eid);
|
DrawAddComponentButton<SHCameraComponent>(eid);
|
||||||
DrawAddComponentButton<SHCameraArmComponent>(eid);
|
DrawAddComponentButton<SHCameraArmComponent>(eid);
|
||||||
DrawAddComponentButton<SHLightComponent>(eid);
|
DrawAddComponentButton<SHLightComponent>(eid);
|
||||||
|
DrawAddComponentButton<SHCanvasComponent>(eid);
|
||||||
|
|
||||||
// Components that require Transforms
|
// Components that require Transforms
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,16 @@ namespace SHADE
|
||||||
return localToCanvasMatrix;
|
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 SHADE;
|
||||||
using namespace rttr;
|
using namespace rttr;
|
||||||
|
|
||||||
registration::class_<SHUIComponent>("Canvas Component")
|
registration::class_<SHUIComponent>("UI Component")
|
||||||
|
.property("Canvas ID", &SHUIComponent::GetCanvasID, &SHUIComponent::SetCanvasID)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@ namespace SHADE
|
||||||
~SHUIComponent() = default;
|
~SHUIComponent() = default;
|
||||||
|
|
||||||
SHMatrix const& GetMatrix() const noexcept;
|
SHMatrix const& GetMatrix() const noexcept;
|
||||||
|
EntityID GetCanvasID() const noexcept;
|
||||||
|
void SetCanvasID(EntityID id) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SHMatrix localToCanvasMatrix;
|
SHMatrix localToCanvasMatrix;
|
||||||
|
|
Loading…
Reference in New Issue