[Unity Ugui] Ugui offers a wide range of different solutions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.