Do Defold support touch in html5 build? (SOLVED)

#21

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.

0 Likes

#22

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

0 Likes

#23

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

#24

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

#25

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

0 Likes

#26

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.

0 Likes

#27

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

#28

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

1 Like

#29

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

#30

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

4 Likes

#31

Solved in 1.2.164

3 Likes