Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created August 8, 2019 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/4996d1840f5bf5a3a507d1e74418f2ca to your computer and use it in GitHub Desktop.
Save andijakl/4996d1840f5bf5a3a507d1e74418f2ca to your computer and use it in GitHub Desktop.
Adding the touchend event listener through the HTML DOM within Amazon Sumerian.
// Add an event listener for touch events anywhere on the screen.
// Note: the MouseUpAction of Sumerian doesn't provide the coordinates
// -> use the HTML DOM event directly. This is accessible through
// the Renderer.
this.internalWorld.sumerianRunner.renderer.domElement.addEventListener('touchend', performHitTestCallback);
// Phones use touch events. To also develop / test on a PC (or on
// a mobile device with a mouse attached), you can also register for
// mouse events.
//this.internalWorld.sumerianRunner.renderer.domElement.addEventListener('mouseup', performHitTestCallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment