Inputs.TwoFingerInput Class
Extends Streams.SimpleStream
Defined in:
samsara/inputs/TwoFingerInput.js:20
Generalizes handling of two-finger touch events. Helper to PinchInput, RotateInput, and ScaleInput. This class is meant to be overridden and not used directly.
Constructor
Inputs.TwoFingerInput
()
private
Item Index
Methods
- calculateAngle static
- calculateCenter static
- calculateDistance static
- filter
- map
- pluck
- split
Methods
calculateAngle
(
Number
static
-
posA
-
posB
Calculates the angle between two touches relative to [0,1].
Returns:
filter
(
-
filterFn
Filter converts the current stream into a new stream
that only emits if the filter condition is satisfied.
The function should return a Boolean.
Parameters:
-
filterFn
FunctionFunction to filter event payload
map
(
-
mapperFn
Map converts the current stream into a new stream
with a modified (mapped) data payload.
Parameters:
-
mapperFn
FunctionFunction to map event payload
pluck
(
-
key
Pluck is an opinionated mapper. It projects a Stream
onto one of its return values.
Useful if a Stream returns an array or an object.
split
(
-
splitterFn
Split maps one of several streams based on custom logic.
The function should return an EventEmitter.
Parameters:
-
splitterFn
FunctionSplitter function