Phaser 2.4.4 timing issue
HTML
<script src="//cdn.jsdelivr.net/phaser/2.4.4/phaser.min.js"></script>
<!-- Use the "External Resources" panel to the left to swap out the Phaser version.
Phaser 2.4.4 exhibits the timing problem: //cdn.jsdelivr.net/phaser/2.4.4/phaser.min.js
Phaser 2.4.3 and below do not: //cdn.jsdelivr.net/phaser/2.4.3/phaser.min.js
-->
JavaScript
var startDate = 0;
var game = new Phaser.Game(500, 100, Phaser.AUTO, null, {
create: function () {
game.stage.disableVisibilityChange = true;
game.forceSingleUpdate = true;
game.stage.backgroundColor = 0xffffff;
var tween = game.add.tween();
tween.onStart.add(function(){
startDate = Date.now();
game.add.text(500, 10, 'Tween started').anchor.x = 1;
});
tween.onComplete.add(function () {
game.add.text(500, 60, 'Tween complete after: ' + (Date.now()- startDate)).anchor.x = 1;
});
tween.to({}, 5000);
tween.start();
},
});