From a7e57f3549e2540a574dbf9fd124e4ec2cc67d55 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Mon, 27 Jul 2026 08:02:51 -0400 Subject: [PATCH] style(2048): center grid vertically and space out the header --- apps/2048/main.lua | 17 ++++++++++------- apps/2048/manifest.txt | 2 +- catalog.txt | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/2048/main.lua b/apps/2048/main.lua index 2d25742..b771430 100644 --- a/apps/2048/main.lua +++ b/apps/2048/main.lua @@ -170,18 +170,21 @@ end local function render() local width, height = gui.width(), gui.height() - local top = 86 - local gap = 8 + local headerBottom = 132 + local hintsTop = height - 56 + local gap = 10 local size = math.min( - math.floor((width - 48 - gap * (SIZE - 1)) / SIZE), - math.floor((height - top - 80 - gap * (SIZE - 1)) / SIZE)) + math.floor((width - 32 - gap * (SIZE - 1)) / SIZE), + math.floor((hintsTop - headerBottom - gap * (SIZE - 1)) / SIZE)) local gridWidth = size * SIZE + gap * (SIZE - 1) + local gridHeight = size * SIZE + gap * (SIZE - 1) local startX = math.floor((width - gridWidth) / 2) + local top = headerBottom + math.floor((hintsTop - headerBottom - gridHeight) / 2) gui.clear() - gui.drawCenteredText(FONT_NOTOSANS_16, 16, "2048", COLOR_BLACK, STYLE_BOLD) - gui.drawCenteredText(FONT_SMALL, 46, "Score " .. score .. " Best " .. best, COLOR_BLACK, STYLE_REGULAR) - gui.drawCenteredText(FONT_SMALL, 64, message, COLOR_BLACK, STYLE_REGULAR) + gui.drawCenteredText(FONT_NOTOSANS_16, 24, "2048", COLOR_BLACK, STYLE_BOLD) + gui.drawCenteredText(FONT_NOTOSANS_14, 66, "Score " .. score .. " Best " .. best, COLOR_BLACK, STYLE_BOLD) + gui.drawCenteredText(FONT_SMALL, 100, message, COLOR_BLACK, STYLE_REGULAR) for row = 1, SIZE do for column = 1, SIZE do diff --git a/apps/2048/manifest.txt b/apps/2048/manifest.txt index f1062b8..1c91f52 100644 --- a/apps/2048/manifest.txt +++ b/apps/2048/manifest.txt @@ -1,2 +1,2 @@ XTEINK-MANIFEST|1 -main.lua|6324|da9bc8bbe2153eb8ba85e295dbe5e4ec9f4b0c8df57c2fc3eec5ed2dc185bba1 +main.lua|6518|49329e48f3f670a562c47c551d6e09783591302f4eb7ae0e89033eecb838a115 diff --git a/catalog.txt b/catalog.txt index a78fb67..5a1b243 100644 --- a/catalog.txt +++ b/catalog.txt @@ -1,5 +1,5 @@ XTEINK-CATALOG|1 -2048|Slide and merge tiles to reach 2048|apps/2048/manifest.txt|97|44ea59e862e09bb4ed034fc3fe9c280a13bb814bd6cc16670482bb3e34db0180 +2048|Slide and merge tiles to reach 2048|apps/2048/manifest.txt|97|7cc1eee488186698bf294a649fe850164af23e32aaee1cd86754555e282bce04 AppStore|Install apps from public Xteink repositories|apps/AppStore/manifest.txt|192|2eb608b92de6bdeff4fc8ed447b9319f45c0d79d5d73b14db1ab5a92f91e42d4 BinaryKeyboard|Two-button recursive keyboard experiment|apps/BinaryKeyboard/manifest.txt|97|893867dba0ae2725caca1eb56375c98c4dd00d351134aa129698c51f97e25690 HomeAssistant|Home Assistant status cards|apps/HomeAssistant/manifest.txt|177|b38ca49804444fd383a505ce9c51680ad9b7443950d682ca1b9ef3047bff98a5