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)

The draggable panel

We will now learn how to turn our menu into a draggable window. Let's add the correct component to it and study its parameters, which are as follows:

  1. Select the Panel GameObject.

  2. Rename it as MainMenu.

  3. Attach the Draggable Panel component to it by navigating to Component | NGUI | Interaction.

The MainMenu GameObject now has a UIDraggable Panel component attached to it.


The following are the 13 parameters for setting values in the UIDraggable Panel:

  • Drag Effect: This is the effect used while dragging the panel to have a smoother drag.

  • Restrict Within Panel: This uses the parent panel to restrain the draggable panel within its clipping bounds.

  • Disable Drag If Fits: If the content fits the parent panel's clipping bounds, dragging will be disabled.

  • Smooth Drag Start: This avoids a "jump" effect on drag start.

  • Reposition Clipping: This repositions the Clipping to the Top Left Corner immediately.

  • IOS Drag Emulation: Dragging movement speed is reduced when overpassing the...