• HUD Positioning.
    5 replies, posted
Hello, I am having trouble with positioning my HUD so it works for 800x600 and 1920x1080 and for 1280x720. I want a custom chat box and I downloaded one off garrysmord.org as example (Since I am new in doing this) I searched everywhere but cannot find the answer I am looking for. How do make the HUD so it doesnt go out of screen when you are at a lower resolution? On 1900x600 this works fine: [lua] local x, y = ScrW() * 0.005, ScrH() * 0.55 draw.RoundedBox(5, x, y, 550, 250, Color(25, 25, 25, 255))[/lua] But when I switch to any other resolution it just messes up (Obviously) Does anyone have a calculation for me so it will stay in the position I want it to be?
Mind showing us a screenshot of how does it look messed up?
Huh, positioning looks fine. What other resolutions are you having trouble with?
For example if i turn to 800x600 it goes out of my screen, the conversion I made was done on 1900x600 >1900x600 [url=http://www.pandabeer1337.nl/upload/1337696571761.png] Link![/url] > 800x600 [IMG]http://www.pandabeer1337.nl/upload/1337696525043.png[/IMG]
[code]local x, y = ScrW() * 0.005, ScrH() * 0.55 draw.RoundedBox(5, x, y, 550, 250, Color(25, 25, 25, 255))[/code] This code [B]cannot[/B] produce that, [B]unless[/B] you set [i]x[/i] and [i]y[/i] only once.
oh wait.. I set the X and Y outside of my hudpaint so it would call only once, at the 1900x600.... sorry xD
Sorry, you need to Log In to post a reply to this thread.