Referencia touches

touches

Un Array de todos los puntos táctiles actuales en un dispositivo táctil.

La matriz touches está vacía de forma predeterminada. Cuando el usuario toca su pantalla, se crea y agrega un nuevo punto táctil a la matriz. Los puntos táctiles son Objets con las siguientes propiedades:

// Iterate over the touches array. for (let touch of touches) { // x-coordinate relative to the top-left // corner of the canvas. console.log(touch.x); <p> // y-coordinate relative to the top-left // corner of the canvas. console.log(touch.y);</p> <p> // x-coordinate relative to the top-left // corner of the browser. console.log(touch.winX);</p> <p> // y-coordinate relative to the top-left // corner of the browser. console.log(touch.winY);</p> <p> // ID number console.log(touch.id); } </p>

Ejemplos

This page is generated from the comments in src/events/touch.js . Please feel free to edit it and submit a pull request!

Referencias Relacionadas