Book Image

NGUI for Unity

By : Charles Bernardoff
Book Image

NGUI for Unity

By: Charles Bernardoff

Overview of this book

Table of Contents (14 chapters)

Creating our first widget

We will create our first sprite widget to display our main menu's background window. In order to do that easily, NGUI has a Widget Wizard with a few templates for us.

Widget Wizard

The Widget Wizard can be opened by navigating to NGUI | Open | Widget Wizard. It will look like the following screenshot:

As you can see in the previous screenshot, to create a widget, you require Atlas and Font to be configured. As said in Chapter 1, Getting Started with NGUI, an atlas is a large texture containing the sprites that you need to create your UI. For the rest of this chapter, we will use the default atlas named SciFi Atlas , which is included in the plugin.

Selecting an atlas

Let's select our default SciFi atlas, which contains the necessary sprites, as follows:

  1. In the Project view, navigate to Assets | NGUI | Examples | Atlases | SciFi.

  2. Drag-and-drop the prefab SciFi Atlas.prefab in the Atlas field.

  3. Drag-and-drop the prefab SciFi Font – Header.prefab in the Font field.

We have...