MeshBaker
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Events | List of all members
SwipeGestureRecognizer Class Reference

Swipe gesture: quick drag/drop motion & release in a cardinal direction (e.g. More...

Inherits AveragedGestureRecognizer.

Public Member Functions

bool IsValidDirection (FingerGestures.SwipeDirection dir)
 Return true if the input direction is supported More...
 
- Public Member Functions inherited from GestureRecognizer
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

FingerGestures.SwipeDirection ValidDirections = FingerGestures.SwipeDirection.All
 Directions we want the swipe recognizer to detect More...
 
float MinDistance = 1.0f
 Minimum swipe distance More...
 
float MinVelocity = 1.0f
 Minimum swipe velocity More...
 
float DirectionTolerance = 0.2f
 Amount of tolerance when determining if the finger motion was performed along one of the supported swipe directions. More...
 
- Public Attributes inherited from AveragedGestureRecognizer
int RequiredFingerCount = 1
 Exact number of touches required for the gesture to be recognized More...
 
- Public Attributes inherited from GestureRecognizer
GestureResetMode ResetMode = GestureResetMode.StartOfTouchSequence
 Get or set the reset mode for this gesture recognizer More...
 

Protected Member Functions

override bool CanBegin (FingerGestures.IFingerList touches)
 This controls whether or not the gesture recognition should begin More...
 
override void OnBegin (FingerGestures.IFingerList touches)
 Method called when the gesture recognizer has just started recognizing a valid gesture More...
 
override GestureState OnActive (FingerGestures.IFingerList touches)
 Method called on each frame that the gesture recognizer is in an active state More...
 
- Protected Member Functions inherited from AveragedGestureRecognizer
override int GetRequiredFingerCount ()
 Return the exact number of active touches required for the gesture to be valid More...
 
- Protected Member Functions inherited from GestureRecognizer
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)
 
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

Vector2 Move [get]
 Get the total move from start position to last/current position More...
 
FingerGestures.SwipeDirection Direction [get]
 Get the swipe direction detected More...
 
float Velocity [get]
 Get the current swipe velocity (in screen units per second) More...
 
- Properties inherited from AveragedGestureRecognizer
Vector2 StartPosition [get, protected set]
 Initial finger(s) position More...
 
Vector2 Position [get, protected set]
 Current finger(s) position More...
 
- Properties inherited from GestureRecognizer
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< SwipeGestureRecognizerOnSwipe
 Event fired when a valid swipe gesture has been detected, upon release of the finger(s) Direction Velocity More...
 
- Events inherited from GestureRecognizer
EventDelegate< GestureRecognizerOnStateChanged
 Event fired whenever the gesture recognizer state changes State PreviousState More...
 

Additional Inherited Members

- Public Types inherited from GestureRecognizer
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...
 

Detailed Description

Swipe gesture: quick drag/drop motion & release in a cardinal direction (e.g.

a page flip with the finger)

Member Function Documentation

§ CanBegin()

override bool SwipeGestureRecognizer.CanBegin ( FingerGestures.IFingerList  touches)
protectedvirtual

This controls whether or not the gesture recognition should begin

Parameters
touchesThe active touches

Reimplemented from GestureRecognizer.

§ IsValidDirection()

bool SwipeGestureRecognizer.IsValidDirection ( FingerGestures.SwipeDirection  dir)

Return true if the input direction is supported

§ OnActive()

override GestureState SwipeGestureRecognizer.OnActive ( FingerGestures.IFingerList  touches)
protectedvirtual

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

Implements GestureRecognizer.

§ OnBegin()

override void SwipeGestureRecognizer.OnBegin ( FingerGestures.IFingerList  touches)
protectedvirtual

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

Parameters
touchesThe active touches

Implements GestureRecognizer.

Member Data Documentation

§ DirectionTolerance

float SwipeGestureRecognizer.DirectionTolerance = 0.2f

Amount of tolerance when determining if the finger motion was performed along one of the supported swipe directions.

This amount should be kept between 0 and 0.5f, where 0 means no tolerance and 0.5f means you can move within 45 degrees away from the allowed direction

§ MinDistance

float SwipeGestureRecognizer.MinDistance = 1.0f

Minimum swipe distance

§ MinVelocity

float SwipeGestureRecognizer.MinVelocity = 1.0f

Minimum swipe velocity

§ ValidDirections

FingerGestures.SwipeDirection SwipeGestureRecognizer.ValidDirections = FingerGestures.SwipeDirection.All

Directions we want the swipe recognizer to detect

Property Documentation

§ Direction

FingerGestures.SwipeDirection SwipeGestureRecognizer.Direction
get

Get the swipe direction detected

§ Move

Vector2 SwipeGestureRecognizer.Move
get

Get the total move from start position to last/current position

§ Velocity

float SwipeGestureRecognizer.Velocity
get

Get the current swipe velocity (in screen units per second)

Event Documentation

§ OnSwipe

EventDelegate<SwipeGestureRecognizer> SwipeGestureRecognizer.OnSwipe

Event fired when a valid swipe gesture has been detected, upon release of the finger(s) Direction Velocity


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