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

Works together with UIDragCamera script, allowing you to drag a secondary camera while keeping it constrained to a certain area. More...

Inheritance diagram for UIDraggableCamera:

Public Member Functions

bool ConstrainToBounds (bool immediate)
 Constrain the current camera's position to be within the viewable area's bounds. More...
 
void Press (bool isPressed)
 Calculate the bounds of all widgets under this game object. More...
 
void Drag (Vector2 delta)
 Drag event receiver. More...
 
void Scroll (float delta)
 If the object should support the scroll wheel, do it. More...
 

Public Attributes

Transform rootForBounds
 Root object that will be used for drag-limiting bounds. More...
 
Vector2 scale = Vector2.one
 Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction. More...
 
float scrollWheelFactor = 0f
 Effect the scroll wheel will have on the momentum. More...
 
UIDragObject.DragEffect dragEffect = UIDragObject.DragEffect.MomentumAndSpring
 Effect to apply when dragging. More...
 
bool smoothDragStart = true
 Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump"). More...
 
float momentumAmount = 35f
 How much momentum gets applied when the press is released after dragging. More...
 

Properties

Vector2 currentMomentum [get, set]
 Current momentum, exposed just in case it's needed. More...
 

Detailed Description

Works together with UIDragCamera script, allowing you to drag a secondary camera while keeping it constrained to a certain area.

Member Function Documentation

bool UIDraggableCamera.ConstrainToBounds ( bool  immediate)

Constrain the current camera's position to be within the viewable area's bounds.

void UIDraggableCamera.Drag ( Vector2  delta)

Drag event receiver.

void UIDraggableCamera.Press ( bool  isPressed)

Calculate the bounds of all widgets under this game object.

void UIDraggableCamera.Scroll ( float  delta)

If the object should support the scroll wheel, do it.

Member Data Documentation

UIDragObject.DragEffect UIDraggableCamera.dragEffect = UIDragObject.DragEffect.MomentumAndSpring

Effect to apply when dragging.

float UIDraggableCamera.momentumAmount = 35f

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

Transform UIDraggableCamera.rootForBounds

Root object that will be used for drag-limiting bounds.

Vector2 UIDraggableCamera.scale = Vector2.one

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

float UIDraggableCamera.scrollWheelFactor = 0f

Effect the scroll wheel will have on the momentum.

bool UIDraggableCamera.smoothDragStart = true

Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").

Property Documentation

Vector2 UIDraggableCamera.currentMomentum
getset

Current momentum, exposed just in case it's needed.


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