diff --git a/CHANGELOG.md b/CHANGELOG.md index 890ba5107..d3a31064d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Notes: * The `PluginManager.installScenePlugin` method has a new optional boolean parameter `fromLoader` which controls if the plugin is coming in from the result of a Loader operation or not. If it is, it no longer throws a console warning if the plugin already exists. This fixes an issue where if you return to a Scene that loads a Scene Plugin it would throw a warning and then not install the plugin to the Scene. * The Scale Manager has a new event `FULLSCREEN_FAILED` which is fired if you try to enter fullscreen mode, but the browser rejects it for some reason. * The `ScaleMode` Component has been removed from every Game Object, and along with it the `scaleMode` property and `setScaleMode` method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 (thanks @jcyuan) +* The `Clock.now` property value is now synced to be the `TimeStep.time` value when the Clock plugin boots and is no longer `Date.now()` until the first update (thanks @Antriel) ### Bug Fixes diff --git a/src/time/Clock.js b/src/time/Clock.js index 714c33484..dfff66c1e 100644 --- a/src/time/Clock.js +++ b/src/time/Clock.js @@ -53,7 +53,7 @@ var Clock = new Class({ * @type {number} * @since 3.0.0 */ - this.now = Date.now(); + this.now = 0; // Scale the delta time coming into the Clock by this factor // which then influences anything using this Clock for calculations, like TimerEvents @@ -129,6 +129,9 @@ var Clock = new Class({ */ boot: function () { + // Sync with the TimeStep + this.now = this.systems.game.loop.time; + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); },