PowerUI.CameraPointer Class Reference

Detailed Description

A fixed camera input. It stays in a particular spot on the screen and only "relocates" when a camera is transformed. Think VR input setups where the mouse is right in the middle of the screen and it moves as the camera does.

Inheritance diagram for PowerUI.CameraPointer:
PowerUI.InputPointer

Public Member Functions

void ForceInvalidate ()
 Force the pointer to invalidate itself (which makes it recompute which element is under it). More...
 
 CameraPointer (Camera cam, Vector2 position)
 
 CameraPointer (Camera cam, float relativeX, float relativeY)
 
override bool Relocate (out Vector2 delta)
 
- Public Member Functions inherited from PowerUI.InputPointer
 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...
 

Properties

Vector2 Position [get, set]
 The screen-space coordinates, in pixels. The top left corner is 0,0. More...
 
Camera Camera [get, set]
 The camera doing the pointing. More...
 
- Properties inherited from PowerUI.InputPointer
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...
 

Private Attributes

Camera Camera_
 The camera doing the pointing. More...
 
Transform Transform_
 The transform it's connected to. More...
 
bool Invalidated_
 True if the position was updated. More...
 
Vector2 Position_
 The screen-space coordinates, in pixels. The top left corner is 0,0. More...
 

Additional Inherited Members

- Public Attributes inherited from PowerUI.InputPointer
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 inherited from PowerUI.InputPointer
static void Tidy ()
 Removes the pointers marked for removal. More...
 
- Static Package Attributes inherited from PowerUI.InputPointer
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...
 

Constructor & Destructor Documentation

PowerUI.CameraPointer.CameraPointer ( Camera  cam,
Vector2  position 
)
inline
Parameters
camThe camera that is doing the pointing. This is actually optional, but it's a very good idea to use it. When given, it'll invalidate the pointer whenever that camera is transformed in some way. I.e. the camera rotates and the pointer updates what is under it.
positionThe screen-space coordinates, in pixels, of where the pointer will be. The top left corner is 0,0.
PowerUI.CameraPointer.CameraPointer ( Camera  cam,
float  relativeX,
float  relativeY 
)
inline
Parameters
camThe camera that is doing the pointing. This is actually optional, but it's a very good idea to use it. When given, it'll invalidate the pointer whenever that camera is transformed in some way. I.e. the camera rotates and the pointer updates what is under it.
relativeXThe screen-space X coordinate, in 0-1 (0.5 is 50%), of where the pointer will be. The top left corner is 0,0.
relativeYThe screen-space Y coordinate, in 0-1 (0.5 is 50%), of where the pointer will be. The top left corner is 0,0.

Member Function Documentation

void PowerUI.CameraPointer.ForceInvalidate ( )
inline

Force the pointer to invalidate itself (which makes it recompute which element is under it).

override bool PowerUI.CameraPointer.Relocate ( out Vector2  delta)
inline

Member Data Documentation

Camera PowerUI.CameraPointer.Camera_
private

The camera doing the pointing.

bool PowerUI.CameraPointer.Invalidated_
private

True if the position was updated.

Vector2 PowerUI.CameraPointer.Position_
private

The screen-space coordinates, in pixels. The top left corner is 0,0.

Transform PowerUI.CameraPointer.Transform_
private

The transform it's connected to.

Property Documentation

Camera PowerUI.CameraPointer.Camera
getset

The camera doing the pointing.

Vector2 PowerUI.CameraPointer.Position
getset

The screen-space coordinates, in pixels. The top left corner is 0,0.