x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 
x
To those who participated in the Highlander Season 32 (Summer 2024), please fill out this Feedback Form for the current & next Highlander seasons!

Forum

HUD Question

Created 26th November 2012 @ 21:39

Add A Reply Pages: 1

Jonte

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,

broesel

LAME

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.

Jonte

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 :)

quartz

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