Skip to main content

Set UI Root Node (SetUIRoot)

AndroidiOSWindows
If you're using Unreal Engine, see the SetUIRoot for the Unreal Engine SDK.

Set the root node for all UI interfaces of LI PASS.

note

LI PASS UI design resolutions are:
Android, iOS (landscape): 1334x750
Android, iOS (portrait): 750x1334
PC, PS5, XSX: 1920x1080

caution

After setting the UI root node, do not destroy the node, or the LI PASS UI interface cannot be mounted and unexpected behaviors may occur.

Function definition

public static void SetUIRoot(GameObject root);

Parameter Explanation

ParametersTypeExplanation
rootGameObjectUI Root Node

For mobile platforms (Android, iOS) using landscape games, it is recommended to set the canvas resolution to 1334x750, fixing the height and adapting the width, as shown below:

Image: Landscape resolution setting

For mobile platforms (Android, iOS) using portrait games, it is recommended to set the canvas resolution to 750x1334, fixing the width and adapting the height, as shown below:

Image: Landscape resolution setting

For PC or console platforms (PS5, XSX), it is recommended to set the canvas resolution to 1920x1080, fixing the height and adapting the width, as shown below:

Image: Landscape resolution setting

note

In the editor, the default value of these numbers matches the current PC resolution. To avoid displaying out-of-frame issues, it is advisable that the resolution be set to a recommended value.

Code Example

LevelInfinite.SetUIRoot(uiRoot);