Show:

Generalizes handling of two-finger touch events. Helper to PinchInput and RotateInput. This class is meant to be overridden and not used directly.

Constructor

Inputs.TwoFingerInput

() private

Methods

calculateAngle

(
  • value1
  • value2
)
Number static

Calculates the angle between two touches relative to [0,1]. Direction option must not be set to x- or y- axes, otherwise 0 is returned.

Parameters:

  • value1 Array

    First touch location (x,y)

  • value2 Array

    Second touch location (x,y)

Returns:

calculateCenter

(
  • value1
  • value2
)
Number | Array static

Calculates the midpoint between two touches.

Parameters:

Returns:

calculateCenter

(
  • velocity1
  • velocity2
)
Number | Array static

Calculates the combined velocity of the two touches.

Parameters:

Returns:

calculateDistance

(
  • value1
  • value2
)
Number static

Calculates the distance between two touches.

Parameters:

Returns:

calculateOrientation

(
  • value1
  • value2
)
Number | Array static

Calculates the direction of the touch.

Parameters:

Returns:

detectOrientationChange

(
  • dir2
  • dir1
)
Boolean static

Detects if orientation has changed.

Parameters:

Returns:

filter

(
  • filterFn
)
SimpleStream

Inherited from Streams.SimpleStream:

Filter converts the current stream into a new stream that only emits if the filter condition is satisfied. The filter function should return a Boolean value.

Parameters:

  • filterFn Function
    Function to filter event payload

Returns:

SimpleStream: stream Filtered stream

map

(
  • mapperFn
)
SimpleStream

Inherited from Streams.SimpleStream:

Map converts the current stream into a new stream with a modified (mapped) data payload.

Parameters:

  • mapperFn Function
    Function to map event payload

Returns:

SimpleStream: stream Mapped stream

pluck

(
  • key
)
SimpleStream

Inherited from Streams.SimpleStream:

Pluck is an opinionated mapper. It projects a Stream onto one of its return values. Useful if a Stream returns an array or object.

Parameters:

Returns:

SimpleStream: stream Plucked stream

split

(
  • splitterFn
)

Inherited from Streams.SimpleStream:

Split maps one of several streams based on custom logic. The splitter function should return an EventEmitter type.

Parameters: