From dd8db10e7273fd21e5959c7cc55af337faf779e1 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 28 Sep 2025 16:02:49 -0400 Subject: [PATCH] Minor tweaks to make Android inset area look less awful --- core/src/mindustry/ui/fragments/HudFragment.java | 15 +++++++++++++++ core/src/mindustry/ui/fragments/MenuFragment.java | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index b741a6089a..d0b20fc5a1 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -194,6 +194,21 @@ public class HudFragment{ //.padLeft(dsize * 5 + 4f) to prevent alpha overlap on left }); + //left/right gutter areas + parent.fill((x, y, w, h) -> { + x = 0f; + y = 0f; + w = Core.graphics.getWidth(); + h = Core.graphics.getHeight(); + if(Core.scene.marginLeft > 0){ + paneRight.draw(x, y, Core.scene.marginLeft, h); + } + + if(Core.scene.marginRight > 0){ + paneLeft.draw(x + w - Core.scene.marginRight, y, Core.scene.marginRight, h); + } + }); + //"waiting for players" parent.fill(t -> { t.name = "waiting"; diff --git a/core/src/mindustry/ui/fragments/MenuFragment.java b/core/src/mindustry/ui/fragments/MenuFragment.java index 296f3c5a89..9677a606bb 100644 --- a/core/src/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/mindustry/ui/fragments/MenuFragment.java @@ -66,6 +66,21 @@ public class MenuFragment{ //info icon if(mobile){ + //left/right gutter areas + parent.fill((x, y, w, h) -> { + x = 0f; + y = 0f; + w = Core.graphics.getWidth(); + h = Core.graphics.getHeight(); + if(Core.scene.marginLeft > 0){ + paneRight.draw(x, y, Core.scene.marginLeft, h); + } + + if(Core.scene.marginRight > 0){ + paneLeft.draw(x + w - Core.scene.marginRight, y, Core.scene.marginRight, h); + } + }); + parent.fill(c -> c.bottom().left().button("", new TextButtonStyle(){{ font = Fonts.def; fontColor = Color.white;