HUD Painting Support.

M

Messages
2,495
Reaction score
8,546
Points
340
I'm no programmer, but do you not just take the values from ScrW() and ScrH(), put them both in variables and then do everything on the HUD in ratios of that?
 
Messages
312
Reaction score
818
Points
500
Location
Xquality's basement
ScrW and ScrH or it wont work as supposed to when it cones to different resolutions.

There is a full guide about vgui in garrys mods wiki, in the end it will teach you about those values and using the.

//phone
 
Messages
901
Reaction score
2,533
Points
790
Location
Netherlands
Looking at your code, you're not going to need ScrH() an awful lot, except from the bottom bar.

To determine the starting point above the bottom of the screen, you take ScrH(), and subtract the height of your VGUI element, now it's position on the bottom, you can subtract 1 or 2 extra pixels for a little offset.

To determine the position left from the right hand side of your screen, you take ScrW() and subtract the width of your VGUI element, same as for the height.

For the rest, you just use normal positions as you are doing right now.

Basically ScrH() returns the height of your screen in pixels and ScrW() does the same but for the width.
 
Top