Crafty: Click/Touch doesn't work on mobile via PhoneGap with 0.7.1, works with 0.4.2
Hi,
I crafted a very, very simple minimal CraftyJS game – something like (minus boiler-plate code):
Crafty.e('2D, Alpha, Color, Canvas, Mouse, Touch').attr({ "w": 48, "h": 48 }).bind('Click', function() { Crafty.audio.play(someId) });
I tried swapping Click with Touch. It works fine on the web, but when I shove it into a PhoneGap container and deploy it on my phone (OnePlus X), the click handler never fires. I even added a “.color('blue”)` to make sure that it’s not just that audio’s broken on my phone.
Is this something that’s supposed to work, or is it something that’s not supported?
I’m using CraftyJS 0.7.1 with PhoneGap 6.3.0 (I think)
About this issue
- Original URL
- State: open
- Created 8 years ago
- Comments: 17 (17 by maintainers)
Commits related to this issue
- Streamline input implementation * **API change:** Changes the signature and functionality of Crafty.findPointerEventTargetByComponent: This method now only finds the entity. A newly introduced Crafty... — committed to mucaho/Crafty by mucaho 7 years ago
- Streamline input implementation * Split source and tests files into appropriate files: src/controls/input is split into different subfiles in the src/inputs directory. tests/unit/controls/input is mo... — committed to mucaho/Crafty by mucaho 7 years ago
- Streamline input implementation * Split source and tests files into appropriate files: src/controls/input is split into different subfiles in the src/inputs directory. tests/unit/controls/input is mo... — committed to mucaho/Crafty by mucaho 7 years ago
- Streamline input implementation * Split source and tests files into appropriate files: src/controls/input is split into different subfiles in the src/inputs directory. tests/unit/controls/input is mo... — committed to mucaho/Crafty by mucaho 7 years ago
- Streamline input implementation * Split source and tests files into appropriate files: src/controls/input is split into different subfiles in the src/inputs directory. tests/unit/controls/input is mo... — committed to mucaho/Crafty by mucaho 7 years ago
- Streamline input implementation * Split source and tests files into appropriate files: src/controls/input is split into different subfiles in the src/inputs directory. tests/unit/controls/input is mo... — committed to mucaho/Crafty by mucaho 7 years ago
After lots of hoopla related to network access, I can confirm that the touch event works as expected on my device.
I noticed that in both web (Chrome from desktop) and on my device, I have to (after the first click) click the square several times to get it to toggle – but the first click always changes it from green to blue.
You can close this issue or leave it open as per your processes. As far as I’m concerned, problem solved!
Sorry, it was always my intention to test this on my real device; I just didn’t get time yet. It’s my intention to get to this by the end of the week.