Here is what i do first
draw.RoundedBox
[lua]
draw.RoundedBox( number cornerRadius, number x, number y, number width, number height, table color)
[/lua]
[lua]draw.RoundedBox(0, 500, 800, 200, 500, Color(255,255,255) ) [/lua]
[lua]draw.RoundedBox(0, ScrW()(500/1920), ScrW()(800/1920), ScrW()(200/1920), ScrW()(500/1920), Color(255,255,255) ) [/lua]
NEVER USE ScrH(), else players using a 4:3 screen/resolution will have a … well look like a bad photoshop.
Oh, and be careful, if you want to also add Triple monitor support, your lines will quickly look like that :
[lua]
draw.BoxRotated(GryMod.EyeFinityScrW()-(GryMod.EyeFinityScrW()(269/1920))+ ((GryMod.EyeFinityScrW()(40/1920))-(math.MapSimple(math.Min(LocalPlayer():GetNWInt(“GryEnergy”),20 ), 20, (GryMod.EyeFinityScrW()(40/1920)))))+ GryModXDistance:GetInt() + GryModXDistance2:GetInt(),ScrH()-(GryMod.EyeFinityScrW()(133/1920)), math.MapSimple(math.Min(LocalPlayer():GetNWInt(“GryEnergy”),20 ), 20, (GryMod.EyeFinityScrW()*(40/1920))),(GryMod.EyeFinityScrW()/84), Color(20,150,230,alpha_ch[1]), 3.5)
[/lua]
Yes, this is one line.
You will maybe make your own drawing function, so you can code without changing your code, i’m thing about something like
[lua]local function draw_RoundedBox( cornerRadius, x, y, width,height, color)
return draw.RoundedBox( ScrW()(cornerRadius/1920), ScrW()(x/1920), ScrW()(y/1920), ScrW()(width/1920), ScrW()*(height/1920), color)
end
[/lua]
(Did not test)
Or maybe
at the top of your file :
[lua]
local draw = draw
local draw_RoundedBox = draw.RoundedBox
function draw.RoundedBox(( cornerRadius, x, y, width,height, color)
return draw_RoundedBox( ScrW()(cornerRadius/1920), ScrW()(x/1920), ScrW()(y/1920), ScrW()(width/1920), ScrW()*(height/1920), color)
end
[/lua]
So you can update an old code with that
(did not test)