O'Reilly logo

NGUI for Unity by Charles Bernardoff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Buttons

With NGUI, buttons are easy to create and configure.

Let's create our first one by performing the following steps:

  1. Select the Panel GameObject.
  2. Create a new child with Alt + Shift + N and perform the following steps:
    1. Rename it as Buttons. It will be our buttons container.
  3. Navigate to NGUI | Open | Widget Wizard and perform the following steps:
    1. Select the Button Template.
    2. For the Background field, select the sprite named Button.
  4. With the Buttons GameObject selected, click on the Add To button.

A button has just been created and centered on the screen. If you look at the Hierarchy view, you will see that a button is composed of a container GameObject named Button and two children: a Background sprite and Label. That's how NGUI works; templates are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required