phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Feature request: tween behaviour when changing browser tab

Open TadejZupancic opened this issue 8 years ago • 1 comments

I would like to have an option that the Tween would jump into the right position after returning from another tab. I know that the browser stops the updates when you switch tabs and I don't need it to constantly update when not visible.

I have a server based game, where the tween animations should stay in sync with the server. If I create a tween with duration 5 seconds, I want it to be at its ending position if I return back to the game tab after 5 seconds.

I've seen in the code that deltas are smoothed in TimeStep and the resetDelta prevents the deltas from becoming "big". I've changed that, but the Timeline/Tween processing would probably also have to be changed to process all the callbacks in the right order.

Maybe this could be solved by increasing tween's timescale? I can wait e.g. half a second after returning back to the game tab if the animation could catch up in that time.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

TadejZupancic avatar Jun 26 '18 14:06 TadejZupancic

Thank you for opening this feature request (all those months ago!). As the development of Phaser 4 has now started I am tidying-up the repo and closing off old issues that won't be directly fixed or implemented in Phaser 3 by me. I would still consider community PRs that address this issue, however, and have left the GitHub tags intact so others can track them if they wish to get involved. However, I'm afraid this is no longer a feature that will be added to v3.

photonstorm avatar Oct 02 '19 11:10 photonstorm