A collection of components to ensure proper UI scaling for mobile devices.
Developed and tested with Unity 2021.3.3f1 LTS
Designed to work with Portrait mode games.
- Open Package Manager through Window/Package Manager
- Click "+" and choose "Add package from git URL..."
- Insert the URL: https://github.com/Delt06/ui-scaling-toolkit.git?path=Packages/com.deltation.ui-scaling-toolkit
Add the following line to Packages/manifest.json
:
"com.deltation.ui-scaling-toolkit": "https://github.com/Delt06/ui-scaling-toolkit.git?path=Packages/com.deltation.ui-scaling-toolkit",
- Unity UI (uGUI)
- Device Simulator (bundled with Unity)
- Safe Area Canvas Scaler - ensures safe area always has intended height
- Safe Area Settings - extra configuration
- Whether to ignore bottom unsafe area or not
- Extra padding (e.g. to handle banners)
- Safe Area Rect - adjusts anchors (full screen) to exclude unsafe area
Tip: full screen backgrounds and overlays should not be inside a Safe Area Rect to prevent creating holes in unsafe area.
According to a StackOverflow thread, the lowest width to height ratio is 9:19.5.
The package adds a custom device called "Widest Android" to Device Simulator to cover that case.