Game Development Reference
In-Depth Information
Other UI Considerations
Other UI considerations include support for multiple resolutions, localizations, UI
middleware, and the user experience.
Supporting Multiple Resolutions
For PC games, it's rather common to have a wide range of screen resolutions—the
most popular for new monitors is 1920×1080, but other common resolutions still
see use, such as 1680×1050. This means that the total number of pixels the user in-
terface has to play with can vary from monitor to monitor. But supporting multiple
resolutions isn't only in the realm of computer games. For example, both the Xbox
360 and PS3 require games to support traditional CRT televisions in addition to
widescreen ones (though the Xbox One and PS4 do not support older televisions,
so games for these platforms may not have to worry about more than one resolu-
tion).
One way to support multiple resolutions is to avoid using specific pixel locations,
which are known as absolute coordinates . An example of an absolute coordinate
would be (1900, 1000), or the precise pixel that a UI element is drawn at. The
problem with using this type of coordinate is that if the monitor is only running at
1680×1050, a UI element at (1900, 1000) would be completely off the screen.
The solution to this type of problem is to instead use relative coordinates , or co-
ordinates that are relative to something else. For example, if you want something
in the bottom-right corner of the screen, you might place an element at (-100,
-100) relative to the bottom-right corner. This means that the element would be
placedat(1820,980)ona1920×1080screen,whereasitwouldbeplacedat(1580,
950) on a 1680×1050 screen (as illustrated in Figure 10.9 ).
Search WWH ::




Custom Search