Laser alert positioning fix for landscape

This commit is contained in:
Hersi 2021-12-10 03:31:53 +01:00
parent ba0d6a569a
commit 71798b0d33
1 changed files with 11 additions and 18 deletions

View File

@ -10,8 +10,8 @@ local rightAlertTextImage = gfx.CreateSkinImage("gameplay/laser_alert/right/text
local TRANSITION_ALERT_ENTER_THRESHOLD = 0.075;
local TRANSITION_ALERT_LEAVE_THRESHOLD = 0.925;
local LEFT_ALERT_X_POS = 0
local RIGHT_ALERT_X_POS = 1080 - 450*0.5
local LEFT_ALERT_X_OFF = 0
local RIGHT_ALERT_X_OFF = -450*0.5
local ALERT_Y_POS = 1115
@ -31,13 +31,9 @@ local desh = 1920;
local isLandscape = false;
local renderLeftAlert = function()
-- gfx.Translate(LEFT_ALERT_X_POS, ALERT_Y_POS);
-- -- gfx.SkewX(-1*3.14)
-- gfx.Scale(test, 1)
gfx.BeginPath();
gfx.ImageRect(
(LEFT_ALERT_X_POS+450*0.5) + transitionLeftOffsetX,
(LEFT_ALERT_X_OFF+450*0.5) + transitionLeftOffsetX,
ALERT_Y_POS+450*0.5,
450*0.5,
450*0.5,
@ -48,7 +44,7 @@ local renderLeftAlert = function ()
gfx.BeginPath();
gfx.ImageRect(
(LEFT_ALERT_X_POS+450*0.5) + transitionLeftOffsetX,
(LEFT_ALERT_X_OFF+450*0.5) + transitionLeftOffsetX,
ALERT_Y_POS+450*0.5,
450*0.5,
450*0.5,
@ -59,7 +55,7 @@ local renderLeftAlert = function ()
gfx.BeginPath();
gfx.ImageRect(
LEFT_ALERT_X_POS,
LEFT_ALERT_X_OFF,
ALERT_Y_POS,
450*0.5,
450*0.5,
@ -67,13 +63,12 @@ local renderLeftAlert = function ()
transitionLeftOpacity,
0
);
-- gfx.ResetTransform();
end
local renderRightAlert = function()
gfx.BeginPath();
gfx.ImageRect(
RIGHT_ALERT_X_POS + transitionRightOffsetX,
RIGHT_ALERT_X_OFF + transitionRightOffsetX,
ALERT_Y_POS,
450*0.5,
450*0.5,
@ -84,7 +79,7 @@ local renderRightAlert = function ()
gfx.BeginPath();
gfx.ImageRect(
RIGHT_ALERT_X_POS + transitionRightOffsetX,
RIGHT_ALERT_X_OFF + transitionRightOffsetX,
ALERT_Y_POS,
450*0.5,
450*0.5,
@ -95,7 +90,7 @@ local renderRightAlert = function ()
gfx.BeginPath();
gfx.ImageRect(
RIGHT_ALERT_X_POS,
RIGHT_ALERT_X_OFF,
ALERT_Y_POS,
450*0.5,
450*0.5,
@ -183,8 +178,6 @@ local render = function (deltaTime)
ALERT_Y_POS = desh*0.58
end
RIGHT_ALERT_X_POS = -450*0.5
tickTransitions(deltaTime);
gfx.Scale(scale, scale)