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)

Text input


Now we will learn how to add a text input to create a nickname box. Perform the following steps to do so:

  1. Select the Panel GameObject and create a new child with Alt + Shift + N. Then rename this new child as Nickname. It will be our nickname box container.

  2. Navigate to NGUI | Open | Widget Wizard.

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

    2. Drag the SciFi Font – Normal prefab into the Font field.

    3. Select the Input template.

    4. Set Sprite (Dark) as the Background parameter.

  3. With the Nickname GameObject selected, click on the Add To button.

A new widget named Input has been added to the scene.

Parameters

An Input GameObject has been created. Let's look at its Inspector parameters:

  • Input Label: This is the text label that is to be used for this input.

  • Inactive Color: This is the text color while the text is not selected.

  • Active Color: This is the text color while the text is being edited.

  • Default Text: This is either Blank or with the label's default text. Blank will...