+ scaling to bars component

This commit is contained in:
FajsiEx 2021-08-07 21:13:56 +02:00
parent 5090219976
commit d525a24900
1 changed files with 13 additions and 2 deletions

View File

@ -8,6 +8,11 @@ local TOP_BAR_LINE_WIDTH = 48
local BOTTOM_BAR_HEIGTH = 128 local BOTTOM_BAR_HEIGTH = 128
local resx, resy = game.GetResolution();
local desw = 1080;
local desh = 1920;
local scale = 1;
local titleText = 'MODE SELECT' local titleText = 'MODE SELECT'
local titleWidth = 250 local titleWidth = 250
@ -31,7 +36,12 @@ local set = function (title)
end end
function resetLayoutInformation()
resx, resy = game.GetResolution()
desw = 1080
desh = 1920
scale = resx / desw
end
local drawLine = function(fx,fy,tx,ty,width,cr,cg,cb,ca) local drawLine = function(fx,fy,tx,ty,width,cr,cg,cb,ca)
gfx.Save() gfx.Save()
@ -117,7 +127,8 @@ end
local draw = function () local draw = function ()
gfx.Save() gfx.Save()
resx, resy = game.GetResolution(); resetLayoutInformation()
gfx.Scale(scale, scale)
-- Draw top background -- Draw top background
gfx.BeginPath(); gfx.BeginPath();