fixed GUI scaling issues

This commit is contained in:
Turanszki Janos
2020-05-05 22:45:31 +01:00
parent 4a11d6a202
commit 5c4e80a515
9 changed files with 244 additions and 170 deletions
+2
View File
@@ -140,6 +140,8 @@ CameraWindow::CameraWindow(EditorComponent* editor) : GUI(&editor->GetGUI())
cameraWindow->Translate(XMFLOAT3((float)wiRenderer::GetDevice()->GetScreenWidth() - 720, 100, 0));
cameraWindow->SetVisible(false);
ResetCam();
}
+190 -150
View File
File diff suppressed because it is too large Load Diff
+37 -2
View File
@@ -63,9 +63,44 @@ public:
std::unique_ptr<LayerWindow> layerWnd;
std::unique_ptr<NameWindow> nameWnd;
Editor* main = nullptr;
Editor* main = nullptr;
wiCheckBox* cinemaModeCheckBox = nullptr;
wiButton* rendererWnd_Toggle = nullptr;
wiButton* postprocessWnd_Toggle = nullptr;
wiButton* paintToolWnd_Toggle = nullptr;
wiButton* weatherWnd_Toggle = nullptr;
wiButton* objectWnd_Toggle = nullptr;
wiButton* meshWnd_Toggle = nullptr;
wiButton* materialWnd_Toggle = nullptr;
wiButton* cameraWnd_Toggle = nullptr;
wiButton* envProbeWnd_Toggle = nullptr;
wiButton* decalWnd_Toggle = nullptr;
wiButton* soundWnd_Toggle = nullptr;
wiButton* lightWnd_Toggle = nullptr;
wiButton* animWnd_Toggle = nullptr;
wiButton* emitterWnd_Toggle = nullptr;
wiButton* hairWnd_Toggle = nullptr;
wiButton* forceFieldWnd_Toggle = nullptr;
wiButton* springWnd_Toggle = nullptr;
wiButton* ikWnd_Toggle = nullptr;
wiButton* transformWnd_Toggle = nullptr;
wiButton* layerWnd_Toggle = nullptr;
wiButton* nameWnd_Toggle = nullptr;
wiCheckBox* translatorCheckBox = nullptr;
wiCheckBox* isScalatorCheckBox = nullptr;
wiCheckBox* isRotatorCheckBox = nullptr;
wiCheckBox* isTranslatorCheckBox = nullptr;
wiButton* saveButton = nullptr;
wiButton* modelButton = nullptr;
wiButton* scriptButton = nullptr;
wiButton* shaderButton = nullptr;
wiButton* clearButton = nullptr;
wiButton* helpButton = nullptr;
wiButton* exitButton = nullptr;
wiCheckBox* profilerEnabledCheckBox = nullptr;
wiCheckBox* physicsEnabledCheckBox = nullptr;
wiCheckBox* cinemaModeCheckBox = nullptr;
wiComboBox* renderPathComboBox = nullptr;
wiTreeList* sceneGraphView = nullptr;
std::unordered_set<wiECS::Entity> scenegraphview_added_items;
+1 -1
View File
@@ -25,7 +25,7 @@ public:
wiScene::TransformComponent transform;
std::list<wiScene::PickResult> selected;
bool enabled = true;
bool enabled = false;
enum TRANSLATOR_STATE
{
+11 -5
View File
@@ -23,21 +23,24 @@ void Tests::Initialize()
ActivatePath(&renderer);
}
void TestsRenderer::ResizeBuffers()
{
__super::ResizeBuffers();
float screenW = wiRenderer::GetDevice()->GetScreenWidth();
float screenH = wiRenderer::GetDevice()->GetScreenHeight();
label->SetPos(XMFLOAT2(screenW / 2.f - label->scale.x / 2.f, screenH * 0.95f));
}
void TestsRenderer::Load()
{
setSSREnabled(false);
setReflectionsEnabled(true);
setFXAAEnabled(false);
float screenW = wiRenderer::GetDevice()->GetScreenWidth();
float screenH = wiRenderer::GetDevice()->GetScreenHeight();
wiLabel* label = new wiLabel("Label1");
label = new wiLabel("Label1");
label->SetText("Wicked Engine Test Framework");
label->font.params.h_align = WIFALIGN_CENTER;
label->SetSize(XMFLOAT2(240,20));
label->SetPos(XMFLOAT2(screenW / 2.f - label->scale.x / 2.f, screenH*0.95f));
GetGUI().AddWidget(label);
static wiAudio::Sound sound;
@@ -132,6 +135,9 @@ void TestsRenderer::Load()
transform.UpdateTransform();
wiRenderer::GetCamera().TransformCamera(transform);
float screenW = wiRenderer::GetDevice()->GetScreenWidth();
float screenH = wiRenderer::GetDevice()->GetScreenHeight();
// Based on combobox selection, start the appropriate test:
switch (args.iValue)
{
+2
View File
@@ -4,11 +4,13 @@
class TestsRenderer : public RenderPath3D_Deferred
{
wiLabel* label = nullptr;
wiComboBox* testSelector = nullptr;
wiECS::Entity ik_entity = wiECS::INVALID_ENTITY;
public:
void Load() override;
void Update(float dt) override;
void ResizeBuffers() override;
void RunJobSystemTest();
void RunFontTest();
-10
View File
@@ -76,16 +76,6 @@ void wiGUI::Update(float dt)
return;
}
XMFLOAT2 size_screen = XMFLOAT2((float)wiRenderer::GetDevice()->GetScreenWidth(), (float)wiRenderer::GetDevice()->GetScreenHeight());
if (size_design.x == 0 || size_design.y == 0)
{
size_design = size_screen;
}
scale_local.x = size_screen.x / size_design.x;
scale_local.y = size_screen.y / size_design.y;
SetDirty();
UpdateTransform();
XMFLOAT4 _p = wiInput::GetPointer();
pointerpos.x = _p.x;
pointerpos.y = _p.y;
-1
View File
@@ -29,7 +29,6 @@ private:
bool focus = false;
bool visible = true;
XMFLOAT2 pointerpos = XMFLOAT2(0, 0);
XMFLOAT2 size_design = XMFLOAT2(0, 0);
public:
~wiGUI();
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 41;
// minor bug fixes, alterations, refactors, updates
const int revision = 0;
const int revision = 1;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);