Book Image

NGUI for Unity

By : Charles Bernardoff (EURO)
Book Image

NGUI for Unity

By: Charles Bernardoff (EURO)

Overview of this book

Table of Contents (14 chapters)

Labels


Labels are used to display text on the screen with a specific font as shown in the following screenshot:

Let's create a label widget with the following steps:

  1. Select the Panel GameObject.

  2. Navigate to NGUI | Open | Widget Wizard.

  3. Select the Label template.

  4. We have already selected a font; it will be used for this label.

  5. Click on the Add To button.

A new label has been added to the panel and placed at the center of the screen.

Parameters

With Label selected, the UILabel parameters are shown in the Inspector view. They are as follows:

  • Text: This is a large textbox that lets you type the text to be displayed.

  • Overflow: This offers four different behaviors for the widget when the text is larger than the label's Dimensions. The four behaviors are as follows:

    • Shrink Content: This shrinks the text in order to fit

    • Clamp Content: This ensures overflow will never happen

    • Resize Freely: This resizes to display all the content and overflow

    • Resize Height: This resizes height only—column style

  • Encoding: This...