So I'm currently making a HUD, which is done, but the only issue is that it's not properly centered for all users.
For me its dead even with my screen and some others, while its to the left apposed to being centered for some people as well.
I'm using roundedbox, simpletext and so fourth to make the hud.
I use code like this to place the position:
[code]
ScrW() - 1240
ScrH() - 35
[/code]
ScrH() is no issue. ScrW() as started above is the default main background position, which is all off centered.
I'm stumped and need some help, thanks.
You can't use a constant and expect it to work on all resolutions. You're just shifting it left exactly 1,240 pixels. Where'd you come up with that number? Probably by doing some math outside of lua with your screen values. So do that in-game with dynamic values.
[lua]ScrW() / 2 - ( <width of hud element> / 2 )[/lua]
[QUOTE=BL00DB4TH;40746869]You can't use a constant and expect it to work on all resolutions. You're just shifting it left exactly 1,240 pixels. Where'd you come up with that number? Probably by doing some math outside of lua with your screen values. So do that in-game with dynamic values.
ScrW() / 2 - ( <width of hud element> / 2 )
[/QUOTE]
Alright, that makes more sense. I'll look into that.
Thank you very much.
EDIT: Yes, It's now working.
Once again, thanks for the help.
Sorry, you need to Log In to post a reply to this thread.