Options
All
  • Public
  • Public/Protected
  • All
Menu

The SwipeDetector class tracks swipes (with touch or mouse)

Hierarchy

  • SwipeDetector

Index

Constructors

constructor

Properties

Optional maxTouchTime

maxTouchTime: number = 1500

The max time of a touch to be considered a swipe. If touch time exceeds this limit, the touch will no longer be considered for a swipe.

minDistance

minDistance: number = 50

The min distance of a touch movement (in pixels) before the touch is considered a swipe

Readonly onSwipeDown

onSwipeDown: Signal = new Phaser.Signal()

Signal that fires when a swipe down occurs. Two parameters are passed, the point where the swipe started and the point where the swipe ended.

Readonly onSwipeLeft

onSwipeLeft: Signal = new Phaser.Signal()

Signal that fires when a swipe left occurs. Two parameters are passed, the point where the swipe started and the point where the swipe ended.

Readonly onSwipeRight

onSwipeRight: Signal = new Phaser.Signal()

Signal that fires when a swipe right occurs. Two parameters are passed, the point where the swipe started and the point where the swipe ended.

Readonly onSwipeUp

onSwipeUp: Signal = new Phaser.Signal()

Signal that fires when a swipe up occurs. Two parameters are passed, the point where the swipe started and the point where the swipe ended.

Optional swipeBounds

swipeBounds: Rectangle

The screen bounds that the touch has to stay within to be considered for a swipe

Methods

destroy

  • destroy(): void
  • Returns void