I only have older iOS devices so unfortunately I probably canāt help with this. Someone else will need to. Itās also possible the reason itās not working well on iOS is because it interferes with what Defold is using to get touch. Iām not sure. It would be better at this point to wait until Defold team can add multitouch support for html5 in and test as they probably have access to more devices.
It seems to me, that parsing json in every update at 60 fps, then using it to control the virtual joystick in an Instant game is very quick & dirty hack. @britzl, @Oleg_The_Evangelist guys from Defold, we need your help, or do you think this is good solution for multi-touch html5 instant games?
Lua:
function update(self, dt)
local touch_data = json.decode(html5.run("get_touch_data()"))
Js:
function get_touch_data() {
return JSON.stringify(touch_data);
Yes, we have keyboard for movement and mouse for firing on desktop. On mobile we need to use virtual joystick (first touch) and second touch for firing.
This is obviously not optimal, but itās on the other hand not the end of the world either. Since itās done only once per frame I guess it will not have a really severe impact on performance. But it is a call from engine to JS which Iām guessing isnāt going to be super fast. And json.decode is pretty fast, so all in all you should be ok with this solution.
Weāve had it in the two most recent sprints but decided to push it ahead of us in favour of modularising the engine further. During this sprint weāll move iap.* and iac.* to native extensions which should conclude the work for now. My guess would be that we tackle multi-touch in 1.2.164, but I canāt make a promise (we really want to do it though!).