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.

Home Page:http://phaser.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Combined use of multiple Input Pointers not working

Weedshaker opened this issue · comments

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

  • A bug in the API:
    • Phaser version(s): v2.13.2
    • Live example: https://tarutarolegends.com (Password: 2014)
    • What steps produce the bug: load the game and start demo
    • What should happen: multiple input pointers should work, resp. should be supported at the same time
    • What happens instead: only one pointer reacts at a time

Cheers

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!

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.

game.input.reset helps!

commented

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

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.