Fixed Buttons, Added Button events, Added Toggle Buttons, Added Sliders(WIP no graphics), Rework backend #308
|
@ -1,3 +1,3 @@
|
||||||
Name: UI Test
|
Name: UI_Test
|
||||||
ID: 88543249
|
ID: 97161771
|
||||||
Type: 5
|
Type: 5
|
||||||
|
|
|
@ -350,7 +350,7 @@ namespace SHADE
|
||||||
SHSerializationHelper::InitializeComponentFromNode<SHCanvasComponent>(componentsNode, eid);
|
SHSerializationHelper::InitializeComponentFromNode<SHCanvasComponent>(componentsNode, eid);
|
||||||
SHSerializationHelper::InitializeComponentFromNode<SHButtonComponent>(componentsNode, eid);
|
SHSerializationHelper::InitializeComponentFromNode<SHButtonComponent>(componentsNode, eid);
|
||||||
SHSerializationHelper::InitializeComponentFromNode<SHToggleButtonComponent>(componentsNode, eid);
|
SHSerializationHelper::InitializeComponentFromNode<SHToggleButtonComponent>(componentsNode, eid);
|
||||||
SHSerializationHelper::ConvertNodeToComponent<SHTextRenderableComponent>(componentsNode, eid);
|
//SHSerializationHelper::ConvertNodeToComponent<SHTextRenderableComponent>(componentsNode, eid);
|
||||||
SHSerializationHelper::InitializeComponentFromNode<SHTextRenderableComponent>(componentsNode, eid);
|
SHSerializationHelper::InitializeComponentFromNode<SHTextRenderableComponent>(componentsNode, eid);
|
||||||
SHSerializationHelper::InitializeComponentFromNode<SHLightComponent>(componentsNode, eid);
|
SHSerializationHelper::InitializeComponentFromNode<SHLightComponent>(componentsNode, eid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,9 +161,9 @@ namespace SHADE
|
||||||
windowSize = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->windowSize;
|
windowSize = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->windowSize;
|
||||||
mousePos = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->viewportMousePos;
|
mousePos = SHEditorWindowManager::GetEditorWindow<SHEditorViewport>()->viewportMousePos;
|
||||||
//mousePos.y = windowSize.y - mousePos.y;
|
//mousePos.y = windowSize.y - mousePos.y;
|
||||||
SHLOG_INFO("mouse pos: {}, {}", mousePos.x, mousePos.y)
|
//SHLOG_INFO("mouse pos: {}, {}", mousePos.x, mousePos.y)
|
||||||
mousePos /= windowSize;
|
//mousePos /= windowSize;
|
||||||
SHLOG_INFO("mouse pos normalized: {}, {}", mousePos.x, mousePos.y)
|
//SHLOG_INFO("mouse pos normalized: {}, {}", mousePos.x, mousePos.y)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHVec2 camSize{ cameraSystem->GetCameraWidthHeight(0)};
|
SHVec2 camSize{ cameraSystem->GetCameraWidthHeight(0)};
|
||||||
|
@ -172,8 +172,8 @@ namespace SHADE
|
||||||
topExtent = CanvasToScreenPoint(topExtent);
|
topExtent = CanvasToScreenPoint(topExtent);
|
||||||
btmExtent = CanvasToScreenPoint(btmExtent);
|
btmExtent = CanvasToScreenPoint(btmExtent);
|
||||||
//SHLOG_INFO("TopExtent: {}, {} Btm Extent: {}, {}", topExtent.x, topExtent.y, btmExtent.x, btmExtent.y)
|
//SHLOG_INFO("TopExtent: {}, {} Btm Extent: {}, {}", topExtent.x, topExtent.y, btmExtent.x, btmExtent.y)
|
||||||
topExtent /= camSize;
|
//topExtent /= camSize;
|
||||||
btmExtent /= camSize;
|
//btmExtent /= camSize;
|
||||||
|
|
||||||
comp.isClicked = false;
|
comp.isClicked = false;
|
||||||
if (mousePos.x >= topExtent.x && mousePos.x <= btmExtent.x
|
if (mousePos.x >= topExtent.x && mousePos.x <= btmExtent.x
|
||||||
|
|
Loading…
Reference in New Issue