Skip to content

Instantly share code, notes, and snippets.

@joehonton
Created February 21, 2021 03:41
Show Gist options
  • Save joehonton/f7766a07037481bebf52afbf23fb3687 to your computer and use it in GitHub Desktop.
Save joehonton/f7766a07037481bebf52afbf23fb3687 to your computer and use it in GitHub Desktop.
class Gestures {
constructor(canvas) {
this.canvas = canvas;
this.fingerPointers = [];
}
// finger pointers appearing and disappearing
addFinger(event) { ... }
updateFinger(event) { ... }
removeFinger(event) { ... }
cancelFingers(event) { ... }
// determining which gesture message to broadcast
sendInitialGesture() { ... }
sendIntermediateGesture() { ... }
sendFinalGesture() { ... }
// helpers to identify stationary versus travelers
fingerCount() { ... }
stationaryCount() { ... }
travelerCount() { ... }
getStationary() { ... }
getSecondStationary() { ... }
getTraveler() { ... }
getSecondTraveler() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment