Inputs.ScaleInput Class
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:
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);
});