phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Combined use of multiple Input Pointers not working #637

Closed Weedshaker closed 5 years ago

Weedshaker commented 5 years ago

Android Chrome, PWA, only one Input Pointer works at the same time. More Pointers than one at the same time doe not react. Can anybody reproduce this with their Android device? It works perfectly fine on my Iphone 8, though.

I have been able to (re)produce the bug on Android 8.1.0 Oxygen OS 5.1.4

Cheers

Weedshaker commented 5 years ago

I followed the trails for these events at Phaser 2 and Phaser 3, which handle it the same way.


  1. Phaser 2: https://github.com/photonstorm/phaser-ce/blob/master/src/input/Touch.js#L181 Phaser 3: https://github.com/photonstorm/phaser/blob/master/src/input/touch/TouchManager.js#L320
  2. It then sends it to the Pointer: this.game.input.startPointer(event.changedTouches[i]); https://github.com/photonstorm/phaser-ce/blob/master/src/input/Touch.js#L246 (according to this https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/changedTouches compatibility should not place a problem as well as the further consumption of the event)

    I assume that the event does not get fired. So I did put a console.log('onTouchStart', event); at Touch.js#L243 (https://github.com/Shoga9Team/tarutarolegends/blob/master/JavaScript/Game.js). I don't have a Physical Android device, but it would be great, if anybody could reproduce the wrong behavior and see if the event gets logged out and with what props.

Thank you very much in advance!

Weedshaker commented 5 years ago

I was able to test it on a different Samsung Android device and it has been no issue there. So, it is device specific! Good to know that this can be an issue... but nothing to do about it.

Weedshaker commented 5 years ago

game.input.reset helps!

samme commented 5 years ago

Could you try game.debug.inputInfo(…) and see what it shows before and after game.input.reset()?

Weedshaker commented 5 years ago

yeah, thats a bit of a problem, since I don't have an android device on my own. I just borrowed one over the weekend for testing...

The conclusions I came up with: 1) It happens when interrupting the game, eg. pause, unfocus the app or enter fullscreen... 2) To reset the game.input solves the issue, when done after 1 happens

thank you for your response.