Octo icon indicating copy to clipboard operation
Octo copied to clipboard

Gamepad visible in browser

Open tobiasvl opened this issue 3 years ago • 4 comments

When exporting an Octo game to HTML and choosing the "Gamepad" option as the game's touch mode, the gamepad overlay seems to be visible (but unresponsive) in the desktop browser version, even though the gamepad is only supported on touch devices.

tobiasvl avatar Nov 01 '21 19:11 tobiasvl

Would making it capable of responding when on desktop be useful? I can see it as useful for turn-based strategy games.

pushfoo avatar Nov 04 '21 05:11 pushfoo

Perhaps, but IMO it's a little awkward to have the gamepad cover the screen when you're on a computer where there's much more screen real estate than on a cell phone.

Personally, to achieve almost the same thing without an overlay, I'd rather draw the buttons myself in the corners, using the Seg16 touch mode to make the buttons respond to mouse clicks.

tobiasvl avatar Nov 04 '21 12:11 tobiasvl

even though the gamepad is only supported on touch devices.

It should be possible to make it work on desktop since the browser gamepad API has been supported fairly universally since 2012.

pushfoo avatar Nov 03 '23 01:11 pushfoo

I experimented briefly with the gamepad API a few years ago, and found that Safari, Firefox, and Chrome all had seriously inconsistent behavior and completely failed to detect most of the gamepads I had on hand. I'm open to the idea of gamepad support if somebody else wants to do the work and prepare a PR, but I absolutely do not want to add support if it will only work correctly on Chrome.

JohnEarnest avatar Nov 03 '23 02:11 JohnEarnest