Detailed Description

An input pointer. These trigger touch events and mouse events. There's one set of pointers for the overall project (InputPointer.All). If there's a pointer on the screen at all times (i.e. desktops) then the set is always at least 1 in size.

Inheritance diagram for PowerUI.InputPointer:
PowerUI.CameraPointer PowerUI.MousePointer PowerUI.TouchPointer PowerUI.FingerPointer PowerUI.StylusPointer

Public Member Functions

 InputPointer ()
 
void Add ()
 Adds this pointer to the available set so it'll get updated. More...
 
float GetMinDragDistance ()
 Finds the minimum drag distance. Always greater than zero. More...
 
virtual bool Relocate (out UnityEngine.Vector2 delta)
 Update ScreenX/ScreenY. More...
 
void SetButton (int unityButtonID)
 Sets ButtonID mapping from the Unity ID to the W3C ones. More...
 
void Click (int unityButtonID)
 Clicks this pointer - same as SetPressure(1). More...
 
void Release (int unityButtonID)
 Releases this pointer - same as SetPressure(0). More...
 
IEventTarget ResolveTarget ()
 Attempts to resolve LatestHit to an event target. Prefers to use Input.TargetResolver but falls back searching for a script on the gameobject which implements it. Will search up the hierarchy too. More...
 
void SetPressure (float v)
 Sets the pressure level. More...
 

Public Attributes

const int DRAG_UNKNOWN =0
 Not tested if a pointer is in the dragging state yet. More...
 
const int DRAG_NOT_AVAILABLE =1
 Tried to drag something that isn't actually draggable. More...
 
const int DRAGGING =2
 Dragging something. More...
 
const int SELECTING =4
 Selecting something. More...
 
bool StillAlive =true
 Used by pointers that don't stick around (fingers and styluses). They're marked as still alive until they don't show up in the touch set anymore. It's always unfortunate that we have to do things like this; the underlying API's are event based but Unity would rather we poll instead. More...
 
int ID =-1
 A unique ID for this pointer. More...
 
bool FireTouchEvents
 True if this pointer should fire touch events. More...
 
float ScreenX
 The current X coordinate on the screen. More...
 
float ScreenY
 The current Y coordinate on the screen. More...
 
float DocumentX
 The current X coordinate on the document that ActiveOver is in. More...
 
float DocumentY
 The current Y coordinate on the document that ActiveOver is in. More...
 
int DragStatus =DRAG_UNKNOWN
 The current drag status. See e.g. DRAG_UNKNOWN. More...
 
float DownDocumentX
 The X coordinate when the pointer went down (clicked). More...
 
float DownDocumentY
 The Y coordinate when the pointer went down (clicked). More...
 
bool Removed
 This occurs with touch pointers. They get marked as removed when the finger is no longer on the screen. More...
 
float MinDragDistance
 The current minimum drag distance. More...
 
Element ActiveUpdating
 Used by e.g. dragging. The element that is "pressed" can be different from the one being actually dragged. More...
 
Element ActiveOver
 The element that this pointer is currently over. More...
 
Element ActivePressed
 The element that this pointer last pressed/ clicked on. More...
 
float Pressure
 The latest pressure. More...
 
int ButtonID
 The latest button that went down. More...
 
bool LatestHitSuccess
 True if LatestRayHit is valid (because it hit something). More...
 
UnityEngine.RaycastHit LatestHit
 If WorldUI's receive input, a ray must be fired from CameraFor3DInput to attempt input. This is the lastest ray result. UI.MouseOver updates this immediately; it's updated at the UI rate otherwise. More...
 
long pointerId =0
 A globally unique ID. More...
 
bool isPrimary =true
 Is this the primary pointer? They all are by default in PowerUI (everything receives the 'legacy' mouse events). More...
 

Static Package Functions

static void Tidy ()
 Removes the pointers marked for removal. More...
 

Static Package Attributes

static int PointerCount
 To avoid resizing this array repeatedly, we track how many are actually in use. More...
 
static InputPointer[] AllRaw =new InputPointer[1]
 The raw set of all available input pointers. PointerCount is how many indices are actually in use. More...
 

Properties

static InputPointer[] All [get]
 The set of all input pointers that are currently actively doing something. Note that this array gets built when you request this property; If you want extra speed, access AllRaw and use PointerCount instead. More...
 
virtual string pointerType [get]
 The type of input pointer. More...
 
virtual float tangentialPressure [get]
 The 'barrel' pressure when available. More...
 
virtual double width [get]
 The width of the active pointer area in CSS pixels. More...
 
virtual double height [get]
 The height of the active pointer area in CSS pixels. More...
 
virtual float tiltX [get]
 The x tilt of the pointer. More...
 
virtual float tiltY [get]
 The y tilt of the pointer. More...
 
virtual float twist [get]
 The rotation angle of an input when available. More...
 
bool IsDown [get]
 True if this input is currently down. More...
 
float startX [get]
 The X coordinate when the pointer went down (clicked). Same as DownDocumentX More...
 
float startY [get]
 The Y coordinate when the pointer went down (clicked). Same as DownDocumentY More...
 
bool MovedBeyondDragDistance [get]
 Checks if the delta between DocumentX/Y and DownDocumentX/Y is bigger than our min drag size. More...
 

Static Private Member Functions

static void ResizePointerStack ()
 Doubles the size of the pointer stack, AllRaw. More...
 

Static Private Attributes

static long GlobalID =0
 A globally unique ID. More...
 

Constructor & Destructor Documentation

PowerUI.InputPointer.InputPointer ( )
inline

Member Function Documentation

void PowerUI.InputPointer.Add ( )
inline

Adds this pointer to the available set so it'll get updated.

void PowerUI.InputPointer.Click ( int  unityButtonID)
inline

Clicks this pointer - same as SetPressure(1).

float PowerUI.InputPointer.GetMinDragDistance ( )
inline

Finds the minimum drag distance. Always greater than zero.

void PowerUI.InputPointer.Release ( int  unityButtonID)
inline

Releases this pointer - same as SetPressure(0).

virtual bool PowerUI.InputPointer.Relocate ( out UnityEngine.Vector2  delta)
inlinevirtual

Update ScreenX/ScreenY.

Returns
True if it moved.
static void PowerUI.InputPointer.ResizePointerStack ( )
inlinestaticprivate

Doubles the size of the pointer stack, AllRaw.

IEventTarget PowerUI.InputPointer.ResolveTarget ( )
inline

Attempts to resolve LatestHit to an event target. Prefers to use Input.TargetResolver but falls back searching for a script on the gameobject which implements it. Will search up the hierarchy too.

void PowerUI.InputPointer.SetButton ( int  unityButtonID)
inline

Sets ButtonID mapping from the Unity ID to the W3C ones.

void PowerUI.InputPointer.SetPressure ( float  v)
inline

Sets the pressure level.

static void PowerUI.InputPointer.Tidy ( )
inlinestaticpackage

Removes the pointers marked for removal.

Member Data Documentation

Element PowerUI.InputPointer.ActiveOver

The element that this pointer is currently over.

Element PowerUI.InputPointer.ActivePressed

The element that this pointer last pressed/ clicked on.

Element PowerUI.InputPointer.ActiveUpdating

Used by e.g. dragging. The element that is "pressed" can be different from the one being actually dragged.

InputPointer [] PowerUI.InputPointer.AllRaw =new InputPointer[1]
staticpackage

The raw set of all available input pointers. PointerCount is how many indices are actually in use.

int PowerUI.InputPointer.ButtonID

The latest button that went down.

float PowerUI.InputPointer.DocumentX

The current X coordinate on the document that ActiveOver is in.

float PowerUI.InputPointer.DocumentY

The current Y coordinate on the document that ActiveOver is in.

float PowerUI.InputPointer.DownDocumentX

The X coordinate when the pointer went down (clicked).

float PowerUI.InputPointer.DownDocumentY

The Y coordinate when the pointer went down (clicked).

const int PowerUI.InputPointer.DRAG_NOT_AVAILABLE =1

Tried to drag something that isn't actually draggable.

const int PowerUI.InputPointer.DRAG_UNKNOWN =0

Not tested if a pointer is in the dragging state yet.

const int PowerUI.InputPointer.DRAGGING =2

Dragging something.

int PowerUI.InputPointer.DragStatus =DRAG_UNKNOWN

The current drag status. See e.g. DRAG_UNKNOWN.

bool PowerUI.InputPointer.FireTouchEvents

True if this pointer should fire touch events.

long PowerUI.InputPointer.GlobalID =0
staticprivate

A globally unique ID.

int PowerUI.InputPointer.ID =-1

A unique ID for this pointer.

bool PowerUI.InputPointer.isPrimary =true

Is this the primary pointer? They all are by default in PowerUI (everything receives the 'legacy' mouse events).

UnityEngine.RaycastHit PowerUI.InputPointer.LatestHit

If WorldUI's receive input, a ray must be fired from CameraFor3DInput to attempt input. This is the lastest ray result. UI.MouseOver updates this immediately; it's updated at the UI rate otherwise.

bool PowerUI.InputPointer.LatestHitSuccess

True if LatestRayHit is valid (because it hit something).

float PowerUI.InputPointer.MinDragDistance

The current minimum drag distance.

int PowerUI.InputPointer.PointerCount
staticpackage

To avoid resizing this array repeatedly, we track how many are actually in use.

long PowerUI.InputPointer.pointerId =0

A globally unique ID.

float PowerUI.InputPointer.Pressure

The latest pressure.

bool PowerUI.InputPointer.Removed

This occurs with touch pointers. They get marked as removed when the finger is no longer on the screen.

float PowerUI.InputPointer.ScreenX

The current X coordinate on the screen.

float PowerUI.InputPointer.ScreenY

The current Y coordinate on the screen.

const int PowerUI.InputPointer.SELECTING =4

Selecting something.

bool PowerUI.InputPointer.StillAlive =true

Used by pointers that don't stick around (fingers and styluses). They're marked as still alive until they don't show up in the touch set anymore. It's always unfortunate that we have to do things like this; the underlying API's are event based but Unity would rather we poll instead.

Property Documentation

InputPointer [] PowerUI.InputPointer.All
staticget

The set of all input pointers that are currently actively doing something. Note that this array gets built when you request this property; If you want extra speed, access AllRaw and use PointerCount instead.

virtual double PowerUI.InputPointer.height
get

The height of the active pointer area in CSS pixels.

bool PowerUI.InputPointer.IsDown
get

True if this input is currently down.

bool PowerUI.InputPointer.MovedBeyondDragDistance
get

Checks if the delta between DocumentX/Y and DownDocumentX/Y is bigger than our min drag size.

virtual string PowerUI.InputPointer.pointerType
get

The type of input pointer.

float PowerUI.InputPointer.startX
get

The X coordinate when the pointer went down (clicked). Same as DownDocumentX

float PowerUI.InputPointer.startY
get

The Y coordinate when the pointer went down (clicked). Same as DownDocumentY

virtual float PowerUI.InputPointer.tangentialPressure
get

The 'barrel' pressure when available.

virtual float PowerUI.InputPointer.tiltX
get

The x tilt of the pointer.

virtual float PowerUI.InputPointer.tiltY
get

The y tilt of the pointer.

virtual float PowerUI.InputPointer.twist
get

The rotation angle of an input when available.

virtual double PowerUI.InputPointer.width
get

The width of the active pointer area in CSS pixels.