Modern games and applications often need to support a variety of screen resolutions, especially UI layouts that need to be adaptable. The UI system includes tools for this purpose in unity and can be combined in a number of ways.
In this section we will use a simple case study and observe and compare the different tools under the background. In our case study there are three buttons at the corner of the screen, as shown below, and the goal is to adapt this layout to various resolutions.
In this section we will consider four screen resolutions: IPhone4 Retina Portrait (640 x 960) and IPhone4 Retina Landscape (960 x 640) and iphone 3 Portrait (x 480) and IPh One3 Landscape (480 x 320).
Use anchor points (Anchor) to adapt to different aspect ratios
The default UI element is pinned to the center of the parent rectangle. This means that they begin the calculation of offsets from the center.
If the resolution changes the landscape aspect ratio, the internal button may not even be in the rectangular screen.
One way to keep the buttons on the screen is to change the layout, the position of the buttons with the corners of the respective screens.
Once the buttons are fixed in their respective corners, they remain when changing the resolution of different aspect ratios.
When the screen size changes to a larger or smaller scheme, the buttons will remain fixed in their respective corners. However, because they keep their original size in the specified pixels, they may need a larger or smaller screen scale. This should depend on the size ratio of the screen you want to layout at different resolutions.
Fit screen elements by screen scale
[Unity Ugui] Ugui offers a wide range of different solutions