mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-22 21:46:51 +02:00
screen position fixes for gen 2
This commit is contained in:
@@ -838,8 +838,7 @@ function BoxMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -972,8 +972,7 @@ function CardFlip:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -313,8 +313,7 @@ function CenterPcMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -180,8 +180,7 @@ function ContestMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -108,8 +108,7 @@ function CopyrightSplash:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -845,8 +845,7 @@ function Credits:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -267,8 +267,7 @@ function DecorationMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ local EggHatchAnim = {}
|
|||||||
EggHatchAnim.__index = EggHatchAnim
|
EggHatchAnim.__index = EggHatchAnim
|
||||||
EggHatchAnim.isOpaque = true
|
EggHatchAnim.isOpaque = true
|
||||||
|
|
||||||
local SCREEN_W, SCREEN_H = 160, 144
|
|
||||||
|
|
||||||
-- Hatch_UpdateFrontpicBGMapCenter is called twice with different hlcoords:
|
-- Hatch_UpdateFrontpicBGMapCenter is called twice with different hlcoords:
|
||||||
-- the egg sits at (7,4) and the hatchling at (6,3). Both are `lb bc, 7, 7`
|
-- the egg sits at (7,4) and the hatchling at (6,3). Both are `lb bc, 7, 7`
|
||||||
-- PlaceGraphic boxes, and the pic inside that box has already been padded to
|
-- PlaceGraphic boxes, and the pic inside that box has already been padded to
|
||||||
@@ -446,8 +444,7 @@ function EggHatchAnim:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ local EvolutionAnim = {}
|
|||||||
EvolutionAnim.__index = EvolutionAnim
|
EvolutionAnim.__index = EvolutionAnim
|
||||||
EvolutionAnim.isOpaque = true
|
EvolutionAnim.isOpaque = true
|
||||||
|
|
||||||
local SCREEN_W, SCREEN_H = 160, 144
|
|
||||||
|
|
||||||
-- PrepMonFrontpic's box: hlcoord 7, 2, `lb bc, 7, 7`.
|
-- PrepMonFrontpic's box: hlcoord 7, 2, `lb bc, 7, 7`.
|
||||||
local PIC_TILE_X, PIC_TILE_Y, PIC_TILES = 7, 2, 7
|
local PIC_TILE_X, PIC_TILE_Y, PIC_TILES = 7, 2, 7
|
||||||
|
|
||||||
@@ -573,8 +571,7 @@ function EvolutionAnim:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -372,8 +372,7 @@ function GameFreakPresents:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -1033,8 +1033,7 @@ function GoldSilverIntro:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -657,8 +657,7 @@ function HallOfFame:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -592,8 +592,7 @@ function ItemPcMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -341,8 +341,7 @@ function MailCompose:drawWidescreen(winW, winH)
|
|||||||
G.setColor(1, 1, 1, 1)
|
G.setColor(1, 1, 1, 1)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -94,8 +94,7 @@ function MailRead:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -218,8 +218,7 @@ function MainMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -225,8 +225,7 @@ function NamePick:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -466,8 +466,7 @@ function OptionsMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -1027,8 +1027,7 @@ function PackMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -849,8 +849,7 @@ function PartyMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -453,8 +453,7 @@ function PcMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -1462,8 +1462,7 @@ function PokedexMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -560,8 +560,7 @@ function PrizeMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -228,8 +228,7 @@ function SaveMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -1535,8 +1535,7 @@ function SlotMachine:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -1175,8 +1175,7 @@ function SummaryMenu:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ local TradeAnimView = {}
|
|||||||
TradeAnimView.__index = TradeAnimView
|
TradeAnimView.__index = TradeAnimView
|
||||||
TradeAnimView.isOpaque = true
|
TradeAnimView.isOpaque = true
|
||||||
|
|
||||||
local SCREEN_W, SCREEN_H = 160, 144
|
|
||||||
|
|
||||||
-- PlaceGraphic's box and the stats panel's Textbox, in tiles.
|
-- PlaceGraphic's box and the stats panel's Textbox, in tiles.
|
||||||
local PIC_TILE_X, PIC_TILE_Y, PIC_TILES = 7, 2, 7
|
local PIC_TILE_X, PIC_TILE_Y, PIC_TILES = 7, 2, 7
|
||||||
local PANEL_X, PANEL_Y = 3, 0
|
local PANEL_X, PANEL_Y = 3, 0
|
||||||
@@ -876,8 +874,7 @@ function TradeAnimView:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - SCREEN_W * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - SCREEN_H * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -437,8 +437,7 @@ function TrainerCard:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -580,8 +580,7 @@ function UnownPuzzle:drawWidescreen(winW, winH)
|
|||||||
G.rectangle("fill", 0, 0, winW, winH)
|
G.rectangle("fill", 0, 0, winW, winH)
|
||||||
local scale = Chrome.fitScale(winW, winH)
|
local scale = Chrome.fitScale(winW, winH)
|
||||||
G.push()
|
G.push()
|
||||||
G.translate(math.floor((winW - 160 * scale) / 2),
|
G.translate(Chrome.fitOrigin(winW, winH, scale))
|
||||||
math.floor((winH - 144 * scale) / 2))
|
|
||||||
G.scale(scale, scale)
|
G.scale(scale, scale)
|
||||||
self:drawPanel()
|
self:drawPanel()
|
||||||
G.pop()
|
G.pop()
|
||||||
|
|||||||
@@ -110,4 +110,21 @@ eq(sy, cy2, "with a skin the Gold origin ignores the mode")
|
|||||||
TouchSkin.setActive(nil)
|
TouchSkin.setActive(nil)
|
||||||
ScreenPosition.setMode("center")
|
ScreenPosition.setMode("center")
|
||||||
|
|
||||||
|
-- A hand-rolled centre in drawWidescreen skips the lift and the playfield
|
||||||
|
-- rect that Chrome.fitOrigin carries.
|
||||||
|
local listing = assert(io.popen('grep -rln "drawWidescreen" src/ui/gen2'))
|
||||||
|
local offenders = {}
|
||||||
|
for path in listing:lines() do
|
||||||
|
local f = assert(io.open(path, "r"))
|
||||||
|
local body = f:read("*a")
|
||||||
|
f:close()
|
||||||
|
if body:find("winH %- %d+ %* scale")
|
||||||
|
or body:find("winH %- SCREEN_H %* scale") then
|
||||||
|
offenders[#offenders + 1] = path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
listing:close()
|
||||||
|
check(#offenders == 0, "no Gold screen centres its widescreen panel by hand: "
|
||||||
|
.. table.concat(offenders, " "))
|
||||||
|
|
||||||
T.finish("screen_position")
|
T.finish("screen_position")
|
||||||
|
|||||||
Reference in New Issue
Block a user