unbork portrait
This commit is contained in:
parent
571631a433
commit
ee3d8ce3f0
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
x = 0
|
||||
|
||||
local scale = resy / desh
|
||||
gfx.Scale(scale, scale)
|
||||
|
||||
gfx.BeginPath();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue