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

Displaying large textures


Adding large textures such as backgrounds to the atlas isn't a good idea; you'll waste space on your atlas and won't gain performance since backgrounds aren't usually used very often.

A simple way to display large textures is to use the UITexture component.

The UITexture component

Let's use the UITexture component to display a background for our menu:

  1. Select our UI Root GameObject.

    • Hit Alt + Shift + N to create a new empty child GameObject.

  2. Select UI Root | GameObject., which is empty and new.

    • Rename it to Background.

  3. Click the Add Component button in the Inspector view.

  4. Type texture with your keyboard to search for components.

  5. Select NGUI Texture and hit Enter or click on it with your mouse.

We've attached the UITexture component to our Background GameObject. We can now review its parameters before we configure it.

Parameters

The newly added UITexture component has the following eight parameters:

  1. Texture: This is the texture file to display.

  2. Material: This is the material...