mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-22 21:46:51 +02:00
CLOSES #1603
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user