You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem is, that when you click icon for browsing tabs (top right corner - see image below) and immediately click on tab with game, then game stays paused=true and looks like frozen. All buttons work, but game stays paused. It looks like resume is not called.
It does not happen always. Usually, it happens when you just opend browser and loaded game. I shot video of what happens and it is in .zip below (my iOS version is 12.4.6, I also tried Phaser engine version you attached to case #665, but without success): paused.zip
As a fix I subscribed to onPause signal in Boot state:
Yes, I did so... but that is the problem - only blur event is fired when you click that browser button. It pauses game, but there is no other event when you return. So game stays paused. As I wrote, it does not happen always, but I can simulate it now every time if I fresh open browser and load game.
While testing, I created simple on-screen console, so I can see console output directly on screen. Here is small part of it:
and I noticed, that focus event is fired, when I touch some of its elements. So: I run the game, pres tab button in browser, return to game and game is paused (I can see only blur event in console). I can wait any time, game does not unpause. I can touch game canvas and nothing happens. But if I touch any button from my on-screen console then it logs focus event and game unpauses.
Seeing this, I came up with that workaround above - if other HTML elements work and send their events, I can attach touchstart event directly to canvas to unpause game (it works, but focus or any other event is not sent).
This issue and other (#667) I sent recently comes from fact, that I am fixing for sponsor larger number of games made by various developers that failed in testing. Sponsor sent me tester logs to see what was wrong. I am doing lot of testing (including engine debugging) before posting as issue here. I think, that this one is something ugly with browser, not Phaser, but I had to solve it somehow :-) - fortunately, that workaround works for now.
This issue may be similar to #663.
Problem is, that when you click icon for browsing tabs (top right corner - see image below) and immediately click on tab with game, then game stays paused=true and looks like frozen. All buttons work, but game stays paused. It looks like resume is not called.
It does not happen always. Usually, it happens when you just opend browser and loaded game. I shot video of what happens and it is in .zip below (my iOS version is 12.4.6, I also tried Phaser engine version you attached to case #665, but without success):
paused.zip
As a fix I subscribed to onPause signal in Boot state:
onPauseHandler() looks like this:
and finally addMyCanvasListener() like this:
With this setup I can unpause game if it is still paused after selecting tab.
The text was updated successfully, but these errors were encountered: