Do Defold support touch in html5 build? (SOLVED)

Are you testing on a device which supports multitouch / in chrome with multitouch simulator active?

Does the above link work on your device? https://www.pkeod.com/defold/mobile_multitouch/

It will not work in vanilla chrome or defold as there is no fallback for normal touch/click in the example atm.

I tested In safari, ios 11, iphone 6s.
It count all touches, but position of orbs do not work.

The linked version doesnā€™t work or the copy downloaded from github doesnā€™t work?

This is older version of github project with some different changes, I believe itā€™s the version from that link.

https://www.pkeod.com/defold/touch/ has updated version.

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.

1 Like

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);

Do you have an alternative control scheme when playing on desktop?

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.

1 Like

Is there an ETA on when we might have multi-touch support for HTML5 builds?

1 Like

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!).

5 Likes

I really want you to do it too! It would be super-helpful to me, at least.

4 Likes

Solved in 1.2.164

3 Likes