VGUI Scaling and Docking

For some reason, I can’t get this to work properly for anyone on lower screen resolutions everything else works fine just one part of the hud doesn’t. if someone could tell me what im doing wrong it would be a big help. here is the part that is messing up
-snip-

Instead of using pixel values, use percentages. That way 2% on one resolution is 2% on another.

How would I go about using percentages, never used them before?

What do you mean by it doesn’t work on low resolutions?

Do you know how percentage works?

That 50% = 1/2 = 0.5, 25% = 1/4 = 0.25, etc…

You could scale your VGUI by using percentage as Aeternal said. If you use ScrH() * 0.5 that would get a number that’s 50% or half of the players screen. If you used ScrH() * 0.25 you would get a number that’s 25% of someones screen or 1/4.

Basically the percentage divided by 100 gets you the decimal value of the percentage which you can multiply with a value to get it’s percentage. For example to get 50%: 50 / 100 = 0.5.

Ok I’ll give it a shot :stuck_out_tongue: I have used percentages before just wasn’t sure if I was to do it that way before as I had really been told never to use static numbers for scaling. Also, it doesn’t make sense as the rest of my code does scale and it all works the same way :confused: