Show:

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

(
  • posA
  • posB
)
Number static

Calculates the angle between two touches relative to [0,1].

Parameters:

  • posA Array

    First touch location (x,y)

  • posB Array

    Second touch location (x,y)

Returns:

calculateCenter

(
  • posA
  • posB
)
Array static

Calculates the midpoint between two touches.

Parameters:

  • posA Array

    First touch location (x,y)

  • posB Array

    Second touch location (x,y)

Returns:

calculateDistance

(
  • posA
  • posB
)
Number static

Calculates the distance between two touches.

Parameters:

  • posA Array

    First touch location (x,y)

  • posB Array

    Second touch location (x,y)

Returns:

filter

(
  • filterFn
)

Inherited from Streams.SimpleStream:

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 Function
    Function to filter event payload

map

(
  • mapperFn
)

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

pluck

(
  • key
)

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 an object.

Parameters:

split

(
  • splitterFn
)

Inherited from Streams.SimpleStream:

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

Parameters: