From 2fdb95b6c4f61b8d58d3c4ac71a52f6df1ad54bc Mon Sep 17 00:00:00 2001 From: SweetId <2630750+SweetId@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:44:50 +0530 Subject: [PATCH] draw camera info on top of the screen, not above --- src/NazaraEditor/Editor/UI/MainWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NazaraEditor/Editor/UI/MainWindow.cpp b/src/NazaraEditor/Editor/UI/MainWindow.cpp index e4f8c9b..d67b27c 100644 --- a/src/NazaraEditor/Editor/UI/MainWindow.cpp +++ b/src/NazaraEditor/Editor/UI/MainWindow.cpp @@ -16,16 +16,20 @@ namespace NzEditor if (ImGui::Begin("MainWindow")) { + auto pos = ImGui::GetCursorPos(); + ImGui::Image(GetApplication()->GetEngineTexture()); + ImGui::SetCursorPos(pos); // everything else will be drawn on top of the texture + auto cam = GetApplication()->GetMainCamera(); auto& camcomponent = cam.get(); auto& transform = cam.get(); auto desiredRotation = camcomponent.GetOrientation(); auto rotation = transform.GetRotation().ToEulerAngles(); + ImGui::Text("Camera position: %.2f %.2f %.2f", transform.GetPosition().x, transform.GetPosition().y, transform.GetPosition().z); ImGui::Text("Camera rotation: %.2f %.2f %.2f", rotation.roll.value, rotation.pitch.value, rotation.yaw.value); - ImGui::Image(GetApplication()->GetEngineTexture()); ImGui::End(); } }