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.

2nd Mar 2021, 10:43 AM
Will
4 Answers
+ 6
touchstart touchmove touchend https://code.sololearn.com/WO8wrPV40Fzn/?ref=app for reference check this code
2nd Mar 2021, 11:10 AM
Sharique Khan
Sharique Khan - avatar
+ 3
what did you mean by 'touch'? only digital touches? any pointer click (mouse/stylet/touch)? anything else (shapes intersections...)?
2nd Mar 2021, 11:02 AM
visph
visph - avatar
+ 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
2nd Mar 2021, 11:06 AM
Will