DarkRP HUD fluid positioning?

Hello everyone! I seem to have encountered a bit of a problem. Again.

Im basically attempting to make a HUD for DarkRP in a attempt to learn GLua.

Heres my code:


--Background and header for HUD
	draw.RoundedBox(0, HUDPosX / 2 - 190, HUDPosY / 2 + 216, 400, 210, Color(40,40,40,250))
	draw.RoundedBox(0, HUDPosX / 2 - 187, HUDPosY / 2 + 219, 394, 30, Color(210,210,210,255))
	draw.DrawText("DarkHorizon", "Trebuchet24", HUDPosX / 2, HUDPosY / 2 + 219, Color(0,0,0,255), 1)

	--Drawing Salary
	draw.RoundedBox(0, HUDPosX / 2 - 187, HUDPosY / 2 + 359, 150, 30, Color(210,210,210,255))
	draw.DrawText(salaryValue, "Trebuchet24", HUDPosX / 2 - 116, HUDPosY / 2 + 359, Color(0, 0, 0, 255), 1)

	--Drawing Wallet
	draw.RoundedBox(0,HUDPosX / 2 - 187, HUDPosY / 2 + 393, 394, 30, Color(210,210,210,255))
	draw.SimpleTextOutlined(walletValue, "Trebuchet24", HUDPosX / 2, HUDPosY / 2 + 393, Color(76, 153, 0, 255), 1, 0, 1, Color(0,0,0,255))

Now my problem is that upon making it i was on a lowe resolution. And once i increased my res it was no longer in the same position. So. How do i go about making it fluid?

Thanks in advance

Take a look at this: https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/understanding_hardcoding_of_screensizes.lua.html

It explains how to “hard-code” positions and sizes for a specific resolution, then go back and add a modifier which will then scale it up/down based on the user resolution vs the resolution it was created for.

Thank you very much for this. I now have the fluid HUD i need!

Wow this is actually really useful thank you for sharing

Acecool is useful for once, who’d guess :v: Gotta admit though, you do write good guides.