![]() |
positioning for everyone
Hey guys I'm trying to setup a custom HP HUD. I'm having trouble with placement on screen though. I'm using screenheight/width, but when I line it up perfect on my screen, its not perfect for everyone else. How would I go about doing this correctly?
This is a part of what I have: PHP Code:
|
You're trying to get it to show in the bottom right of the screen? That looks about right. Otherwise change the x/y values—you only need the screen's width/height if you're at the right/bottom.
|
How did you decide the values of 200 and 540? If you want it to be exactly in the corner, you'd only have to subtract the height/width of the image itself.
|
1 Attachment(s)
I want it to be at the top right somewhat. Here is a screenshot of what the said code gave me
|
You don't need to use screenheight when you're working from the top, just using a 10 or 20 y value for example will get you what you're looking for.
|
ah, thanks fp :)
|
How would I go about the x axis though, not everybody's screen is the same size...
|
Quote:
|
Thanks guys :)
|
Quote:
screenwidth / 2 - width_of_hpbar / 2 |
Quote:
Quote:
|
Looked centered in the screenie..
|
Quote:
x = (screenwidth - IMG_WIDTH) / 2; That's all :P If you want it to be to the right then wrap that in quotes then + (whatever offset from center). Also make sure to re set values when the screen is resized. |
thanks guys, i wanted it on the left side. But i figured it out from what you guys said.
|
All times are GMT +2. The time now is 05:40 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.