MeshBaker
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | List of all members
GestureRecognizer Class Referenceabstract

The base class for all gesture recognizers More...

Inherits FGComponent.

Inherited by AveragedGestureRecognizer, and MultiFingerGestureRecognizer.

Public Types

enum  GestureState { GestureState.Ready, GestureState.InProgress, GestureState.Failed, GestureState.Recognized }
 Possible gesture states More...
 
enum  GestureResetMode { GestureResetMode.NextFrame, GestureResetMode.EndOfTouchSequence, GestureResetMode.StartOfTouchSequence }
 The reset mode determines when to reset a GestureRecognizer after it fails or succeed (GestureState.Failed or GestureState.Recognized) More...
 

Public Member Functions

virtual bool CheckCanBeginDelegate (FingerGestures.IFingerList touches)
 
delegate bool CanBeginDelegate (GestureRecognizer gr, FingerGestures.IFingerList touches)
 
void SetCanBeginDelegate (CanBeginDelegate f)
 
CanBeginDelegate GetCanBeginDelegate ()
 
- Public Member Functions inherited from FGComponent
delegate void EventDelegate< T > (T source)
 

Public Attributes

GestureResetMode ResetMode = GestureResetMode.StartOfTouchSequence
 Get or set the reset mode for this gesture recognizer More...
 

Protected Member Functions

virtual void Reset ()
 Put back the gesture recognizer in Ready state and reset any relevant data ResetMode More...
 
override void Start ()
 
virtual void OnTouchSequenceStarted ()
 Called when the first finger of a new multi-touch sequence has touched the screen More...
 
virtual void OnTouchSequenceEnded ()
 Called when all the fingers that participated in the current multi-touch sequence are no longer touching the screen More...
 
override void OnUpdate (FingerGestures.IFingerList touches)
 This is called after FingerGestures has updated the state of each finger More...
 
virtual GestureState OnReady (FingerGestures.IFingerList touches)
 
virtual bool ShouldFailFromReady (FingerGestures.IFingerList touches)
 
virtual bool CanBegin (FingerGestures.IFingerList touches)
 This controls whether or not the gesture recognition should begin More...
 
abstract int GetRequiredFingerCount ()
 Return the exact number of active touches required for the gesture to be valid More...
 
abstract void OnBegin (FingerGestures.IFingerList touches)
 Method called when the gesture recognizer has just started recognizing a valid gesture More...
 
abstract GestureState OnActive (FingerGestures.IFingerList touches)
 Method called on each frame that the gesture recognizer is in an active state More...
 
bool Young (FingerGestures.IFingerList touches)
 Check if all the touches in the list started recently More...
 
- Protected Member Functions inherited from FGComponent
virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 

Properties

GestureState PreviousState [get]
 Get the previous gesture state More...
 
GestureState State [get, protected set]
 Get or set the current gesture state More...
 
bool IsActive [get]
 Return true if the gesture recognition has started and is on-going State More...
 
FingerGestures.ITouchFilter TouchFilter [get, set]
 Get or set the touch filter used to modify the list of active touches about to be processed by the gesture recognizer More...
 

Events

EventDelegate< GestureRecognizerOnStateChanged
 Event fired whenever the gesture recognizer state changes State PreviousState More...
 

Detailed Description

The base class for all gesture recognizers

Member Enumeration Documentation

§ GestureResetMode

The reset mode determines when to reset a GestureRecognizer after it fails or succeed (GestureState.Failed or GestureState.Recognized)

Enumerator
NextFrame 

The gesture recognizer will reset on the next Update()

EndOfTouchSequence 

The gesture recognizer will reset at the end of the current multitouch sequence

StartOfTouchSequence 

The gesture recognizer will reset at the beginning of the next multitouch sequence

§ GestureState

Possible gesture states

Enumerator
Ready 

The gesture recognizer is ready and waiting for the correct initial input conditions to begin

InProgress 

The gesture recognition has started and is still going on

Failed 

The gesture detected a user input that invalidated it

Recognized 

The gesture was succesfully recognized

Member Function Documentation

§ CanBegin()

virtual bool GestureRecognizer.CanBegin ( FingerGestures.IFingerList  touches)
protectedvirtual

This controls whether or not the gesture recognition should begin

Parameters
touchesThe active touches

Reimplemented in RotationGestureRecognizer, SwipeGestureRecognizer, PinchGestureRecognizer, DragGestureRecognizer, and MousePinchGestureRecognizer.

§ CanBeginDelegate()

delegate bool GestureRecognizer.CanBeginDelegate ( GestureRecognizer  gr,
FingerGestures.IFingerList  touches 
)

§ CheckCanBeginDelegate()

virtual bool GestureRecognizer.CheckCanBeginDelegate ( FingerGestures.IFingerList  touches)
virtual

§ GetCanBeginDelegate()

CanBeginDelegate GestureRecognizer.GetCanBeginDelegate ( )

§ GetRequiredFingerCount()

abstract int GestureRecognizer.GetRequiredFingerCount ( )
protectedpure virtual

Return the exact number of active touches required for the gesture to be valid

Implemented in RotationGestureRecognizer, PinchGestureRecognizer, AveragedGestureRecognizer, and MousePinchGestureRecognizer.

§ OnActive()

abstract GestureState GestureRecognizer.OnActive ( FingerGestures.IFingerList  touches)
protectedpure virtual

Method called on each frame that the gesture recognizer is in an active state

Parameters
touchesThe active touches
Returns
The new state the gesture recognizer should be in

Implemented in RotationGestureRecognizer, PinchGestureRecognizer, SwipeGestureRecognizer, TapGestureRecognizer, DragGestureRecognizer, MousePinchGestureRecognizer, and LongPressGestureRecognizer.

§ OnBegin()

abstract void GestureRecognizer.OnBegin ( FingerGestures.IFingerList  touches)
protectedpure virtual

Method called when the gesture recognizer has just started recognizing a valid gesture

Parameters
touchesThe active touches

Implemented in RotationGestureRecognizer, SwipeGestureRecognizer, TapGestureRecognizer, PinchGestureRecognizer, DragGestureRecognizer, LongPressGestureRecognizer, and MousePinchGestureRecognizer.

§ OnReady()

virtual GestureState GestureRecognizer.OnReady ( FingerGestures.IFingerList  touches)
protectedvirtual

§ OnTouchSequenceEnded()

virtual void GestureRecognizer.OnTouchSequenceEnded ( )
protectedvirtual

Called when all the fingers that participated in the current multi-touch sequence are no longer touching the screen

§ OnTouchSequenceStarted()

virtual void GestureRecognizer.OnTouchSequenceStarted ( )
protectedvirtual

Called when the first finger of a new multi-touch sequence has touched the screen

§ OnUpdate()

override void GestureRecognizer.OnUpdate ( FingerGestures.IFingerList  touches)
protectedvirtual

This is called after FingerGestures has updated the state of each finger

Parameters
touchesThe list of fingers currently down / touching the screen

Implements FGComponent.

§ Reset()

virtual void GestureRecognizer.Reset ( )
protectedvirtual

Put back the gesture recognizer in Ready state and reset any relevant data ResetMode

Reimplemented in TapGestureRecognizer.

§ SetCanBeginDelegate()

void GestureRecognizer.SetCanBeginDelegate ( CanBeginDelegate  f)

§ ShouldFailFromReady()

virtual bool GestureRecognizer.ShouldFailFromReady ( FingerGestures.IFingerList  touches)
protectedvirtual

§ Start()

override void GestureRecognizer.Start ( )
protectedvirtual

Reimplemented from FGComponent.

Reimplemented in MultiFingerGestureRecognizer.

§ Young()

bool GestureRecognizer.Young ( FingerGestures.IFingerList  touches)
protected

Check if all the touches in the list started recently

Parameters
touchesThe touches to evaluate
Returns
True if the age of each touch in the list is under a set threshold

Member Data Documentation

§ ResetMode

Get or set the reset mode for this gesture recognizer

Property Documentation

§ IsActive

bool GestureRecognizer.IsActive
get

Return true if the gesture recognition has started and is on-going State

§ PreviousState

GestureState GestureRecognizer.PreviousState
get

Get the previous gesture state

§ State

GestureState GestureRecognizer.State
getprotected set

Get or set the current gesture state

§ TouchFilter

FingerGestures.ITouchFilter GestureRecognizer.TouchFilter
getset

Get or set the touch filter used to modify the list of active touches about to be processed by the gesture recognizer

Event Documentation

§ OnStateChanged

EventDelegate<GestureRecognizer> GestureRecognizer.OnStateChanged

Event fired whenever the gesture recognizer state changes State PreviousState


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