scaling hud

Hello guys, This situation is really frustrating i’ve been trying to make a global hud TEST but i’m not even able to make a global text U_U…

When i use 1360x768 Screen Resolution, this looks perfect

But when i change it to 1600x900 for example, the text fuck up … for some reason

Here is the code :frowning: any way of how i can make it global ? Thanks.



surface.CreateFont( "CustomHUDFont", {
 font = "Arial",
 size = 15,
 weight = 800,
} )

function DrawHUD()
    surface.SetDrawColor(255, 255, 255, 255)
    surface.DrawOutlinedRect(5, 5, ScrW() * 0.2, 50)
    draw.SimpleTextOutlined("Test", "CustomHUDFont", ScrW() * 0.1323529411764706, ScrH() * 0.0455729166666667, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM, 1, Color(0, 0, 0, 255))
end
hook.Add("HUDPaint", "DrawHUD", DrawHUD)