Touch Controls

Hey, so I just finished a game and I want to add touch controls so I can publish my game on google play. Is there any way how?

Ummmmm here’s a way to hack them in:

this.project.view._canvas.addEventListener("touchdown", function(ev) {
  //javascript DOM events
});

this.project.view._canvas.addEventListener("touchmove", function(ev) {
  //javascript DOM events
});

this.project.view._canvas.addEventListener("touchup", function(ev) {
  //javascript DOM events
});
1 Like

so what does each script mean?

Does Wick Editor’s mouse events also respond to touch presses?

Also just search up javascript dom events or javascript touch events. _canvas should be a reference to the html canvas element used to render the scene.

ok thanks!

i’m pretty sure touch and click are the same in wick terms. you can probably use things like buttons. don’t know what will happen when you try to push 2 buttons at once though.

A warning, if you do this your project might break in the editor. MouseDown, mouseUp and mouseDrag should work when used on mobile devices but may not give the exact functionality.

2 Likes