Draw Rounded Box Problem

Hi there everybody so I am having a problem with a bit of coding. I have drawn rounded box’s on my screen to make a HUD. But whenever I change my screen resolution the box does not stay where I want it. How do I fix this?

And also I am on the game mode DarkRP and I have disabled the default hud but the sandbox hud is still here how do I remove that.

Ex. 1776 x 1000 Before changing screen resolution: https://gyazo.com/6d769a68dec807710c7b6a7284064995

Ex. After lowering resolution: https://gyazo.com/8eff4a134a73fff391f7e810ed7a96b6

i gochu holmes. 1 sec.

im pretty sure he talks about it in this video. this guy makes good tutorials btw.

its when he talks about ScrW and ScrH.

Ok Thanks let me check that out.

[editline]26th August 2016[/editline]

He really never goes in depth on ScrW() and ScrH() He just mentions the size of 1920x1080…

ah ok. here ill give you some of my code.


	local frame = vgui.Create("DFrame")
	frame:SetSize(160,500)
	frame:SetVisible(true)
	frame:SetTitle( "Interaction Menu" )
	frame:SetDraggable( true )
	frame:SetSizable( true )
	frame:SetPos (ScrW, ScrH)
	frame:ShowCloseButton( false )
	frame.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

[editline]27th August 2016[/editline]

its taking the screen width/screen height and its adding/subtracting a certain amount, so if you want to center it you do something like i want this box to start at ScrW() // 2 or something idk i just woke up. it divides in 2 so that it goes to the middle of whatever your screen width is, so no matter what your resolution is, it will draw it in the middle. someone will elaborate more on this. i just dont feel like it.