Hey,
I've been speculating about the resolution for awhile now, but still can't figure out if this works for other players that have a different screen resolution then me.
I'm having it about the resolution for the draw.Roundedboxes and Draw.Simpletext.
I currently have the following screen resolution: 1920 x 1080
I now use this code:
draw.RoundedBox( 0, ScrW() * 0.373, ScrH() * 0.920, 460, 40, Color( 105,105,105, 150 ))
Thanks in advance!
You may want to scale the size of the box too. Currently you're only scaling the position.
For me it's in the bottom-middle. How would I scale the box too? Same idea or?
Same as the position. That way it will be on the same spot, same size at every resolution. Also, you should use surface.DrawRect if you don't want do draw a box with rounded corners.
You can use this code to auto-scale on all resolutions.
local w = 1920
local h = 1080
local function scaleX(sw)
return ScrW() * ((sw or0) / w)
end
local function scaleH(sh)
return ScrH() * ((sh or0) / h)
end
w and h are your local resolution.
So does it now auto-scale everything? Don't I have to put the Roundedboxes etc. in the function or?
Sorry, you need to Log In to post a reply to this thread.