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

Introduction to 3D user interface


Until now, we've created 2D user interface elements and flat widgets viewed with an orthographic camera, on which the z axis has no influence.

3D user interface elements are viewed with perspectives taken into account, which means that the z axis makes widgets feel "farther away" or "closer to" the camera. Rotation can also be applied, which will make them look like they are a part of the 3D environment.

In this section, we will create 3D user interface elements. First, we need to explain what the 3D UI Root is, and then create one.

The 3D UI Root

It's interesting to separate our 2D and 3D layers in order to make sure you can easily hide or show one of them by simply enabling/disabling the camera that renders them.

Indeed, consider we have UI Root to hold the 2D UI and another to hold the 3D UI exclusively. If we need to hide the 2D UI and show a 3D pause menu, we can simply perform the following steps:

  1. Disable the 2D UI Root that holds and renders the in-game...