NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIDragObject Class Reference

Allows dragging of the specified target object by mouse or touch, optionally limiting it to be within the UIPanel's clipped rectangle. More...

Inheritance diagram for UIDragObject:

Public Types

enum  DragEffect { DragEffect.None, DragEffect.Momentum, DragEffect.MomentumAndSpring }
 

Public Member Functions

void CancelMovement ()
 Cancel all movement. More...
 
void CancelSpring ()
 Cancel the spring movement. More...
 

Public Attributes

Transform target
 Target object that will be dragged. More...
 
Vector3 scrollMomentum = Vector3.zero
 Momentum added from the mouse scroll wheel. More...
 
bool restrictWithinPanel = false
 Whether the dragging will be restricted to be within the parent panel's bounds. More...
 
UIRect contentRect = null
 Rectangle to be used as the draggable object's bounds. If none specified, all widgets' bounds get added up. More...
 
DragEffect dragEffect = DragEffect.MomentumAndSpring
 Effect to apply when dragging. More...
 
float momentumAmount = 35f
 How much momentum gets applied when the press is released after dragging. More...
 

Protected Attributes

Vector3 scale = new Vector3(1f, 1f, 0f)
 

Properties

Vector3 dragMovement [get, set]
 Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction. More...
 

Detailed Description

Allows dragging of the specified target object by mouse or touch, optionally limiting it to be within the UIPanel's clipped rectangle.

Member Enumeration Documentation

Enumerator
None 
Momentum 
MomentumAndSpring 

Member Function Documentation

void UIDragObject.CancelMovement ( )

Cancel all movement.

void UIDragObject.CancelSpring ( )

Cancel the spring movement.

Member Data Documentation

UIRect UIDragObject.contentRect = null

Rectangle to be used as the draggable object's bounds. If none specified, all widgets' bounds get added up.

DragEffect UIDragObject.dragEffect = DragEffect.MomentumAndSpring

Effect to apply when dragging.

float UIDragObject.momentumAmount = 35f

How much momentum gets applied when the press is released after dragging.

bool UIDragObject.restrictWithinPanel = false

Whether the dragging will be restricted to be within the parent panel's bounds.

Vector3 UIDragObject.scale = new Vector3(1f, 1f, 0f)
protected
Vector3 UIDragObject.scrollMomentum = Vector3.zero

Momentum added from the mouse scroll wheel.

Transform UIDragObject.target

Target object that will be dragged.

Property Documentation

Vector3 UIDragObject.dragMovement
getset

Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction.


The documentation for this class was generated from the following file: