SetUIRoot
If you were looking for the method for use with Unreal Engine, see SetUIRoot for Unreal Engine SDK.
Set the root for all LI PASS UIs.
LI PASS UI resolution:
Android, iOS (Landscape): 1334x750
Android, iOS (Portrait): 750x1334
PC, PS5, XSX: 1920x1080
After setting the UI root node, please do not destroy it, otherwise the LI PASS UI interface cannot be mounted and will result in unexpected behavior.
Function definition
public static void SetUIRoot(GameObject root);
Input parameters
Parameter | Type | Description |
---|---|---|
root | GameObject | UI root |
For landscape games on mobile (Android, iOS) platforms, it is recommended to set the canvas resolution to 1334x750 with fixed height and flexible width, as shown in the following image:
For portrait games on mobile (Android, iOS) platforms, it is recommended to set the canvas resolution to 750x1334 with fixed width and flexible height, as shown in the following image:
For games on the PC or console (PS5, XSX) platforms, it is recommended to set the canvas resolution to 1920x1080 with fixed height and flexible width, as shown in the following image:
The default canvas resolution in the editor matches the resolution of the current PC, and the canvas resolution should be set to the recommended values to avoid problems with the display going out of frame.
Code sample
LevelInfinite.SetUIRoot(uiRoot);