Class: Gesture

player/TouchGestures~Gesture()

abstract class for touch gesture handlers.

Constructor

new Gesture()

Source:

Methods

checkSwipe(distX, distY, minX, minY) → {boolean}

Tests for vertical or horizontal swipes according to a given minimum movement.

Performs the swipe in the dominant direction (longer absolute move)

Parameters:
Name Type Description
distX number

Touch movement in horizontal direction

distY number

Touch movement in vertical direction

minX number

Minimum distance in horizontal direction to accept as swipe

minY number

Minimum distance in vertical direction to accept as swipe

Source:
Returns:
  • true, if a swipe was ececuted
Type
boolean

doSwipe()

Execute a swipe.

Must be implemented by derived class.

Source:

finish()

Gesture has been completed successfully.

Specific behaviour to be implemented by derived classes

Source:

move(touches)

Touchpoints have been moved.

Specific behaviour to be implemented by derived classes

Parameters:
Name Type Description
touches Array.<object>

Array of touchpoints from the touch event.

Source:

rejects(touches) → {boolean}

Checks whether the given touches (e.g. by number) cannot be processed by the specific gesture object.

Must be implemented by derived classes.

Parameters:
Name Type Description
touches Array.<object>

Array of touchpoints from the touch event.

Source:
Returns:
  • true, if touches are rejected, false if accepted
Type
boolean