There are no predefined UI objects, as the look and feel of user interfaces varies widely based on the game. Instead, a UI events object generates high level events from mouse and keyboard input that can be used with overlay image and text objects to create custom UI elements. The UI elements can be made resolution independent using the techniques below.
UI elements can be automatically sized for different display resolutions using resolution folders and
the meta position object. Rayve will select the best resolution folder for the current display. The
meta position object will give detail control over resolution independent positioning of UI elements.
A resolution folder ends with ".res", for example "2560.res". The numeric value used in the name is the
horizontal display resolution the assets in the folder are designed for. The asset scale below is the scale
factor for the given resolution based on 1920 resolution. Use this scale factor for sizing images for a
resolution folder. Not all resolution folders have to be created if the resolution is not needed.
The recognized resolution folders are:
1920 - FHD
2560 - QHD
3840 - UHD
5760 - 5K
8192 - 8K
Screen pixel coordinates are based on a 1920x1080 virtual screen. These pixel coordinates will be scaled at runtime based on the current display resolution.
If an image file asset contains multiple images or animation frames, these images should be accessed using coordinates based on the 1920x1080 resolution version of the file. These coordinates will then be scaled according to the current display resolution at runtime.
Create the UHD image file first. The width and height of the UHD image should be powers of 2. The image does not have to be square. If the UHD image file contains multiple images, coordinates of all images in the file should be divisible by 4. Make the the QHD version by scaling the UHD image file by .66667. Make the FHD version by scaling the UHD version by .5f. Round up fractional remainders.