User Tools

Site Tools


manual:gestures:pinch

Using the Pinch Recognizer

A pinch is a two-fingers-only continuous gesture where the two fingers move away or closer from/to each other, in opposite direction. The pinch amount is measured by the gap distance between the two fingers.

Properties

  • Minimum DOT: DOT product tolerance value controlling what “opposite direction” means
  • Minimum Distance: minimum gap distance required between the two fingers to begin the pinch gesture

Events

void OnPinch( PinchGesture gesture ) 
{
    // current gesture phase (Started/Updated/Ended)
    ContinuousGesturePhase phase = gesture.Phase;
 
    // Current gap distance between the two fingers
    float gap = gesture.Gap;
 
    // Gap difference since last frame
    float delta = gesture.Delta;
}

Desktop Emulation

On desktop, you can emulate a pinch gesture by using the mouse scroll-wheel by default. This can be changed to another key on the “Mouse Input Provider” prefab.

manual/gestures/pinch.txt · Last modified: 2013/06/30 16:40 by wravaine