Customize UI Scale Ratio
Player Network allows you to change the scale ratio of the LEVEL INFINITE PASS login widget. Follow the instructions in this article to customize the login widget using SetUICustomScale
for your game client.
Currently, the UI scale ratio can only be changed for Unreal Engine on LEVEL INFINITE PASS.
LI PASS UI resolution:
Android, iOS (Landscape): 1334x750
Android, iOS (Portrait): 750x1334
PC, PS5, XSX: 1920x1080
Switch: 1280x720
Background
The scale ratio, a parameter of SetUICustomScale
, is set based on the ratio of the shortest sides of the design resolution of the game and the design resolution of LEVEL INFINITE PASS, then matched to displays of different resolutions according to the DPI curve by Unreal Engine.
Taking the mobile platform as an example, the design resolution of a mobile game is usually 1920x1080, while for LEVEL INFINITE PASS on mobile the design resolution is 1336x750:
By taking the ratio of the shortest sides, the expected scale ratio is 1080/750 = 1.44, and therefore the parameter of SetUICustomScale
is set to be 1.44.
If SetUICustomScale
is not called, LEVEL INFINITE PASS is unable to obtain the design resolution of the game, the reciprocal of the scale value of the design resolution of LEVEL INFINITE PASS on the DPI curve will be equal to the scale ratio.
As such, the expected trend of the DPI curve should be similar to the below image, which is a straight line with a primarily fixed slope. The closer the actual DPI curve of the game is to the expected trend, the closer the expected scale ratio will be to the reciprocal of the scale value (1/750 for mobile platform) on the DPI curve.
Function
UFUNCTION(BlueprintCallable, Category = "LevelInfinite")
static void SetUICustomScale(const float scale);
Parameters
Parameter | Type | Description |
---|---|---|
scale | float | UI scale ratio |
Sample
// set UI custom scale
ULevelInfiniteAPI::SetUICustomScale(1.44f);