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
Will4 Answers
New Answertouchstart touchmove touchend https://code.sololearn.com/WO8wrPV40Fzn/?ref=app for reference check this code
what did you mean by 'touch'? only digital touches? any pointer click (mouse/stylet/touch)? anything else (shapes intersections...)?
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
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
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message