Skip to content
pixi-silk
GitHub repository
Interface

GestureHandlers

import type { GestureHandlers } from 'pixi-silk/ui/gesture';

Callbacks of trackGesture. Every one is optional.

Properties#

PropertyTypeDescriptionDefined in
onDown?(p: GesturePoint) => voidPointer went down (before the gesture is known).ui/gesture.ts:28
onDrag?(p: GesturePoint) => voidEvery move after onDragStart, on or off the target.ui/gesture.ts:41
onDragEnd?(p: GesturePoint) => voidDrag ended (release, or the pointer was lost).ui/gesture.ts:43
onDragStart?(p: GesturePoint) => voidMovement passed the pointer’s slop. Cancels a pending hold.ui/gesture.ts:39
onFlick?(p: GesturePoint, angle: number, speed: number) => voidFast release within 450 ms of the press. Fires after onDragEnd. angle is the direction in radians, speed is in local units per second.ui/gesture.ts:37
onHold?(p: GesturePoint) => voidPress held still for holdMs. A hold that then moves continues as a drag.ui/gesture.ts:32
onTap?(p: GesturePoint) => voidPress released within the pointer’s tapMs (at least 260 ms) that moved less than its slop, with no hold.ui/gesture.ts:30
onUp?(p: GesturePoint) => voidPointer went up, whatever the gesture was.ui/gesture.ts:45