how do you find touch coordinates with JavaScript? | Sololearn: Learn to code for FREE!

0

how do you find touch coordinates with JavaScript?

How do you find touch coordinates with JavaScript? I'm making a pong game using canvas and would appreciate any answers.

3/2/2021 10:43:24 AM

Will

4 Answers

New Answer

+6

touchstart touchmove touchend https://code.sololearn.com/WO8wrPV40Fzn/?ref=app for reference check this code

+2

what did you mean by 'touch'? only digital touches? any pointer click (mouse/stylet/touch)? anything else (shapes intersections...)?

+2

https://developer.mozilla.org/en-US/docs/Web/API/Touch_events https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events

+1

what would a program that senses a touch on the screen of my phone and stores the position of the touch in a variable look like? I'm not sure what you mean with digital touches and mouse/stylet/shapes intersections, sorry