Steam avatar image, simpletext not working on all resolutions

Hey, i just made steam avatar work with the following code

local Avatar = vgui.Create( "AvatarImage", Panel )
Avatar:SetSize( 84,84 )
Avatar:SetPos( 35,830 )
Avatar:SetPlayer( LocalPlayer(), 64 )
AvatarShouldDraw = 0

i also added to the end of it this draw.roundedbox

draw.RoundedBox( 6, 31, 822, 92, 99, mainbgcolor)

but it seems that it’s position on other resolutions than my resolution (1920x1080) are poor. They aren’t where they should be, or aren’t appearing at all.
Same happens with for example this code

elseif client:IsUserGroup("Moderator") then draw.SimpleText("Moderator", "DarkRPPublicHUD2", 40,1043, Color( 255,255,255,255 ) )

which has draw.roundedbox and it doesn’t position good on other resolutions too:

draw.RoundedBox( 6, 10, 1042, 175, 26, mainbgcolor)

You have to change the font size based on the resolution.

If you meant the font “DarkRPPublicHUD2”, it isn’t by that because there’s other texts using the same font in the code, and they are good in other resolutions.

You should probably do your positionings using ScrW() and ScrH() instead.

Thanks, i got help from a friend for that ScrW() thing and it works now.