Forum
HUD Question
Created 26th November 2012 @ 21:39
Add A Reply Pages: 1
Created a few HUDs the last weeks, and got a question.
If I download Garm3nHUD I can play with 4:3 and 16:9 without changing anything.
I created my HUD in 4:3 and as I played it with 16:9 it looked shit :D
Anyone know how I can create a HUD that works for all resolutions?
Last edited by Jonte,
The VGUI grid has a constant 480 units on the y-axis, though the units on the x-axis vary depending on the aspect ratio:
[VGUI units on the x-axis] : 480 = [x-resolution] : [y-resolution]
You can use r and c prefixes to make the HUD work on every aspect ratio. r aligns elements from the right side or, if used on ypos, from the bottom – c does the same with center. Theoretically, you never have to use r or c on ypos attributes because of the constant height, i.e. ypos r180 and ypos 300 is the same.
Quoted from broesel
The VGUI grid has a constant 480 units on the y-axis, though the units on the x-axis vary depending on the aspect ratio:
[VGUI units on the x-axis] : 480 = [x-resolution] : [y-resolution]
You can use r and c prefixes to make the HUD work on every aspect ratio. r aligns elements from the right side or, if used on ypos, from the bottom – c does the same with center. Theoretically, you never have to use r or c on ypos attributes because of the constant height, i.e. ypos r180 and ypos 300 is the same.
Thanks for helping me :)
Quoted from broesel
*check it up there*
It’s pretty much that really :p
Just remember that you need to use the correct prefix for positioning varying on where you want to position it(‘c’ if you want something to come from the center and ‘r’ if you want something to come from the opposite side of the screen, if you get what I mean), also remember to use the correct “textAlignment” on text entities (like east for AmmoInClip and west for Ammoinreserve) so that text doesn’t overlap
Last edited by quartz,
Add A Reply Pages: 1