This commit is contained in:
bryanthaboi
2026-08-20 10:46:27 -04:00
parent c777e85641
commit 25166ff3a1
14 changed files with 253 additions and 9 deletions
+2 -2
View File
@@ -619,8 +619,8 @@ function BattleTransition:grid(w, h)
scale = math.max(1, math.floor(math.min(w / 160, h / 144)))
end
local size = 8 * scale
local ox = math.floor((w - 160 * scale) / 2)
local oy = math.floor((h - 144 * scale) / 2)
local Chrome = require("src.ui.gen2.Chrome")
local ox, oy = Chrome.fitOrigin(w, h, scale)
return size, ox, oy
end
+9
View File
@@ -66,6 +66,15 @@ function Chrome.fitOrigin(winW, winH, scale)
local x, y, w, h = playfieldRect(winW, winH)
return x + math.floor((w - Chrome.SCREEN_W * 8 * scale) / 2),
y + math.floor((h - Chrome.SCREEN_H * 8 * scale) / 2)
- Chrome.positionLift(winW, winH, scale)
end
function Chrome.positionLift(winW, winH, scale)
local ok, ScreenPosition = pcall(require, "src.core.ScreenPosition")
if not ok or ScreenPosition.skinActive(winW, winH) then return 0 end
local _, _, _, h = playfieldRect(winW, winH)
return ScreenPosition.lift(h, Chrome.SCREEN_H * 8 * (scale
or Chrome.fitScale(winW, winH)), ScreenPosition.safeTop())
end
-- A bordered box, tile coords. Leaves the draw color black for text.
+9
View File
@@ -196,6 +196,15 @@ local ROWS = {
return VideoMode.normalize(options.videoMode) == "borderless"
and "FULL" or "WINDOWED"
end },
{ label = "SCREEN POS", key = "screenPos", port = true,
cycle = function(options, delta)
local ScreenPosition = require("src.core.ScreenPosition")
options.screenPos = ScreenPosition.cycle(options.screenPos, delta)
ScreenPosition.setMode(options.screenPos)
end,
text = function(options)
return require("src.core.ScreenPosition").label(options.screenPos)
end },
{ id = "touchControls", label = "TOUCH PAD", port = true,
text = function(options)
local tc = options.touchControls