+ landscape support to chain numbers

This commit is contained in:
FajsiEx 2021-11-25 19:42:46 +01:00
parent 8283ccfb1f
commit d2c6a48465
1 changed files with 21 additions and 1 deletions

View File

@ -4,6 +4,8 @@ local chainLabel = gfx.CreateSkinImage("gameplay/chain/label.png", 0)
local desw = 1080;
local desh = 1920;
local isLandscape = false;
local transitionShakeScale = 0;
local transitionShakePosOffset = 0;
local shakeTimer = 0;
@ -63,6 +65,19 @@ local onNewCombo = function ()
end
local render = function (deltaTime, comboState, combo, critLineCenterX, critLineCenterY)
gfx.Save();
local resx, resy = game.GetResolution();
isLandscape = resx > resy;
if (isLandscape) then
desw = 1920;
desh = 1080;
else
desw = 1080;
desh = 1920;
end
tickTransitions(deltaTime)
if shakeTimer > 0 then
@ -73,8 +88,13 @@ local render = function (deltaTime, comboState, combo, critLineCenterX, critLine
if combo == 0 then return end
local bottomOffsetMultiplier = 0.333;
if (isLandscape) then
bottomOffsetMultiplier = 0.25
end
local posx = desw / 2 + transitionShakePosOffset;
local posy = desh - 640 + transitionShakePosOffset;
local posy = desh - (desh*bottomOffsetMultiplier) + transitionShakePosOffset;
local chainNumbers = chainNumbersReg --regular
if comboState == 2 then