User Tools

Site Tools


Using the Swipe Recognizer

A swipe gesture is a very quick and short drag performed in a single direction.


  • Min Distance: minimum distance the finger(s) must move in order to produce a swipe
  • Max Distance: maximum distance the finger(s) can travel from the initial position
  • Min Velocity: minimum instant swipe velocity that the finger(s) must maintain
  • Max Deviation: maximum deviation angle, in degrees


void OnSwipe( SwipeGesture gesture ) 
    // Total swipe vector (from start to end position)
    Vector2 move = gesture.Move;
    // Instant gesture velocity in screen units per second
    float velocity = gesture.Velocity;
    // Approximate swipe direction
    FingerGestures.SwipeDirection direction = gesture.Direction;
manual/gestures/swipe.txt · Last modified: 2013/03/11 19:52 by wravaine