From d9c1664f66a90301f7faf699711fc17539690cfe Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Fri, 26 Nov 2021 20:56:56 +0100 Subject: [PATCH] / critline landscape scaling --- scripts/gameplay/crit_line.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/gameplay/crit_line.lua b/scripts/gameplay/crit_line.lua index 250976f..b8f435f 100644 --- a/scripts/gameplay/crit_line.lua +++ b/scripts/gameplay/crit_line.lua @@ -8,10 +8,22 @@ local CRITBAR_H = 348 local scale; +local isLandscape = false; + local setUpTransforms = function (x,y,rotation) - local resx, resy = game.GetResolution() - local desw = 1080 - local desh = 1920 + local resx, resy = game.GetResolution(); + isLandscape = resx > resy; + + local desw, desh; + + if (isLandscape) then + desw = 1920; + desh = 1080; + else + desw = 1080; + desh = 1920; + end + scale = resx / desw gfx.Translate(x, y)