unbork portrait

This commit is contained in:
Hersi 2021-12-02 21:53:30 +01:00
parent 571631a433
commit ee3d8ce3f0
4 changed files with 24 additions and 19 deletions

View File

@ -1,6 +1,9 @@
local bannerBaseImage = gfx.CreateSkinImage("gameplay/banner/base.png", 0)
local desw = 1080
local desh = 1920
local BANNER_W = 1080;
local BANNER_H = 368;
@ -43,6 +46,9 @@ end
local render = function (deltaTime, users, currentUserId)
local resx, resy = game.GetResolution();
local scale = resx / desw
gfx.Scale(scale, scale)
drawScoreboard(users, currentUserId); -- TODO: for now
-- hide if landscape
@ -65,6 +71,8 @@ local render = function (deltaTime, users, currentUserId)
0
);
gfx.ResetTransform()
end
return {

View File

@ -170,36 +170,35 @@ local tickTransitions = function (deltaTime)
end
local render = function (deltaTime)
gfx.Save();
gfx.ResetTransform()
local resx, resy = game.GetResolution();
isLandscape = resx > resy;
local scale = resy / desh
if (isLandscape) then
desw = 1920;
desh = 1080;
ALERT_Y_POS = desh*0.6
else
desw = 1080;
desh = 1920;
ALERT_Y_POS = desh*0.58
end
local scale = resy / desh
RIGHT_ALERT_X_POS = (resx - 450*0.5) / scale
RIGHT_ALERT_X_POS = -450*0.5
tickTransitions(deltaTime);
gfx.Save();
gfx.Scale(scale, scale)
renderLeftAlert();
gfx.ResetTransform()
gfx.Translate(resx, 0)
gfx.Scale(scale, scale)
renderRightAlert();
test = test + deltaTime;
gfx.ResetTransform()
gfx.Restore();
-- gfx.BeginPath();
-- gfx.FontSize(18)
-- gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)

View File

@ -29,15 +29,13 @@ local render = function (deltaTime, score, maxChain)
tickTransitions(deltaTime)
local scale = resy / desh
local x = resx;
local y = isLandscape and 5 or 330;
if (isLandscape) then
gfx.Translate(x, 0);
x = 0
end
local scale = resy / desh
gfx.Scale(scale, scale)
gfx.BeginPath();

View File

@ -54,7 +54,7 @@ local tickTransitions = function (deltaTime)
end
local render = function (deltaTime, score, bestReplay)
gfx.Save();
gfx.ResetTransform()
local resx, resy = game.GetResolution();
isLandscape = resx > resy;