Skip to Content
Mastering UI Development with Unity
book

Mastering UI Development with Unity

by Dr. Ashley Godbold
April 2018
Beginner content levelBeginner
468 pages
11h 7m
English
Packt Publishing
Content preview from Mastering UI Development with Unity

Preferred Width and Height

The Preferred Width and Preferred Height properties are a little confusing, because they perform differently depending on the settings you have for the parent's layout group. There is no official Max Width and Max Height setting, despite there being a Min Width and Min Height setting. The Preferred Width and Preferred Height properties, however, can be used to specify the maximum size the child object will achieve, but only if the correct settings on the parent's layout group are selected.

The following diagram contains three Panels with Vertical Layout Group components and various settings. Their children also have various settings for Preferred Height within a Layout Element component:

Layout Element Example ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game Development with Unity for .NET Developers

Game Development with Unity for .NET Developers

Jiadong Chen
Unity UI Cookbook

Unity UI Cookbook

Francesco Sapio

Publisher Resources

ISBN: 9781787125520Supplemental Content