Book Image

Learning NGUI for Unity

By : Charles Bernardoff (EURO)
Book Image

Learning NGUI for Unity

By: Charles Bernardoff (EURO)

Overview of this book

Table of Contents (17 chapters)
Learning NGUI for Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The adaptive UI


The adaptive UI solution is the one that we have chosen for this book. It's the simplest way to handle multiple resolutions and aspect ratios. The idea is to set your UI root's Scaling Style to Constrained, with both the Height and Width component's Fit option checked for a 1920 x 1080 resolution.

With this configuration, our entire UI will always be scaled up or down to fit the device's screen, and all the widgets will remain visible regardless of the resolution and aspect ratio.

This is the best way to easily and rapidly have a cross-platform adaptive UI. You will lose the pixel-perfect size of your widgets since they are scaled to fit the screen, hence you might have less crisp sprites on certain resolutions.

By creating all your sprites considering a screen of a 1920 x 1080 full HD resolution, you will have a perfect display on devices with the latter resolution, and it will still look good on smaller screens.