In javascript how would you change mouse control in games to touchscreen control? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In javascript how would you change mouse control in games to touchscreen control?

2nd Aug 2017, 5:59 PM
James Nixon
James Nixon - avatar
2 Answers
+ 5
I'm a bit confused by your question but if you're looking for a way to trigger touchscreen events then you need to lookup touch events instead of mouse events. Example: -You get the "click" event for mouse clicks and -You get the "touchstart" event for when the user touches the screen Look here for more info. https://www.w3schools.com/jquerymobile/jquerymobile_events_touch.asp
2nd Aug 2017, 6:43 PM
Ghauth Christians
Ghauth Christians - avatar
+ 1
This answers my question, thanks Gav!
2nd Aug 2017, 7:02 PM
James Nixon
James Nixon - avatar