Ulysses
General => Developers Corner => Topic started by: Digital Spit on December 30, 2013, 06:51:04 PM
-
So,
I'm trying to create a hud I created a HUD but! the only problem is how it's spaced on different peoples screens... the height is the same among everyone's screens it's the width that I'm having a hard time understanding, someone mind helping me here?
Here is how everyone sees it:
(http://cloud-4.steampowered.com/ugc/505826534901482884/9ACFDBECFF137F9E9198C446A354E0BB7B46CF89/1024x768.resizedimage)
Here is how I see it:
(http://cloud-3.steampowered.com/ugc/885254803425953034/B120FDDB4D96DFB30A51CE897B9359DBC7896577/1024x768.resizedimage)
How can I make it appear the same on everyone's screen no matter if they are running full screen, window mode or the res they are on?
-
No exact memory off top of my head, however, the ulx motd, and XGUI, are both reasonably dynamic in where they start.
They grab the users original screen res, then do a multiplication to start at a certain percentage into the width of the screen (height too I think).
Then the code is smart enough I think to remain static if screen res is lower than a certain size.
-
JamminR is correct, we base it off percentages. Percentages brings some unique problems as well, but was the simplest for our purposes.
-
So my best bet is to look at how the MOTD is drawn on the players screen and go from there?
-
Why not share the code you're currently using to position it?
-
Try adding some debug functions to your code to print the current coordinates of the hud as well as ScrW() and ScrH().
-
The problem has been fixed!