This plug-in helps the HUD UI adjusts the UI scale settings of the player
The code below shows the UI plug-in that supports UIScaleManager.
By adding 4 lines like this, your UI can be matched to the screen ratio and UIscale of all clients.
Feature
- Ask the user and save UIScale and AspectRatio.
- API for HUD developers.
Chat Commands
- /setui -- Opens a window that sets the UI size
Configuration
The settings and options can be configured in the UIScaleManager file under the config directory. The use of an editor and validator is recommended to avoid formatting issues and syntax errors.- InitPlayer -- Decide if you want to ask the player the UI scale when the player first enters the game
Stored Data
The plugin data are stored in data/UIScaleManagerPlayerData.json. Deleting this file would wipe all players UIScaleDataLocalization
The default messages are in the UIScaleManager file under the lang/en directory. To add support for another language, create a new language folder (e.g. de for German) if not already created, copy the default language file to the new folder and then customize the messages.API Example
The code below here is the UI plug-in that we basically create.The code below shows the UI plug-in that supports UIScaleManager.
By adding 4 lines like this, your UI can be matched to the screen ratio and UIscale of all clients.