Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | GringoFrenzy | |
Old Version | Published before Godot 3 was released. |
Is it possible to detect screen taps/touch from a mobile device running an HTML5 game in browser? (Chrome or Safari)
I’m trying to make a basic one-button game that can be embedded on a web page and will run on iOS / Android without needing to download from an app store.
I don’t want to do anything clever; even if the only event I can detect is a basic tap, that would be enough for me.
I’ve verified that the game loads and runs on both platforms…the problem is I can’t get it to respond to any input.
So far I’ve tried BaseButton nodes, TouchScreenButton nodes, and hooking into events like InputEvent.SCREEN_TOUCH
and InputEvent.MOUSE_BUTTON
…none of them work.
The ‘fullscreen’ button that appears in the top-right of the canvas DOES respond to touch…just none of my buttons.
Am I fighting a losing battle?
For a 1 tap you can use mouse events instead of touch, but I don’t know if will work on mobile web browsers because HTML5 export is not good and mobile support for it is even worse.
You may have to wait fot Godot 3 (or 3.1) to get a good HTML5 export.
eons | 2016-11-17 00:47