1 decade ago by Balaji
So, I read the thread on how to use canvas touch earlier. But there was one problem I found with that method: Multi-touch.
Now, if I wanted to move right and jump at the same time, the method mentioned earlier is not going to work, I presume.
Is there a simple way to get button images (left arrow, right arrow, jump, shoot, etc) on the canvas to bind to touches?
I used bindTouch till now. That took a selector from the HTML page and it works perfectly. But now, I want all my input to be within the canvas itself. I also tried ig.input.bind(ig.KEY.MOUSE1, "CanvasTouch"); and kept checking for ig.input.state("CanvasTouch"). That worked but for only a single touch event. Once I tap two buttons at the same time, the player just stops!
Any help is appreciated. Thank you so much.
Now, if I wanted to move right and jump at the same time, the method mentioned earlier is not going to work, I presume.
Is there a simple way to get button images (left arrow, right arrow, jump, shoot, etc) on the canvas to bind to touches?
I used bindTouch till now. That took a selector from the HTML page and it works perfectly. But now, I want all my input to be within the canvas itself. I also tried ig.input.bind(ig.KEY.MOUSE1, "CanvasTouch"); and kept checking for ig.input.state("CanvasTouch"). That worked but for only a single touch event. Once I tap two buttons at the same time, the player just stops!
Any help is appreciated. Thank you so much.