0

I am making a game where response depends upon where the user touches on the canvas area. So could anyone explain me how to do it with a small snippet. Will be of much help.

Sure I did try to find out myself on the internet but couldn't find one that I could understand clearly.

1 Answers1

0

here is your code . Simply put this code in device ready function .

   $('#canvas_div').bind("touchstart", function (e) {
       var touch = e.originalEvent.touches[0];
       canvas_x = touch.pageX;
       canvas_y = touch.pageY - OffsetRadar;
    });
Hassan ALi
  • 1,313
  • 1
  • 23
  • 51