Show:
Extends Inputs._TwoFingerInput

Detects two-finger pinching motion and emits start, update and end events with the payload data:

 count         - Number of simultaneous touches
 value         - Amount of scaling from starting placement
 delta         - Difference in scaling
 velocity      - Relative velocity of the scale
 cumulate      - Total accumulated scaling
 center        - Midpoint between the two touches

The value is the ratio of the current displacement between two fingers with the initial displacement. For example, a value of 1 indicates the fingers are at the same displacement from where they began. A value of 2 indicates the fingers are twice as far away as they originally began. A value of 1/2 indicates the fingers are twice as close as they originally began, etc.

Constructor

Inputs.ScaleInput

(
  • options
)

Parameters:

  • options Object

    Options

    • [scale=1] Number optional

      Scale the response to pinch

    • [direction] Number optional

      Direction to project movement onto. Options found in ScaleInput.DIRECTION.

    • [rails=false] Boolean optional

      If a direction is specified, movement in the orthogonal direction is suppressed

Example:

 var scaleInput = new ScaleInput();
         scaleInput.subscribe(surface)
        
         scaleInput.on('start', function(payload){
             console.log('start', payload);
         });
        
         scaleInput.on('update', function(payload){
             console.log('update', payload);
         });
        
         scaleInput.on('end', function(payload){
             console.log('end', payload);
         });

Item Index