Add Phaser.Time.Clock#startTime

This commit is contained in:
samme 2023-01-30 06:57:40 -08:00
parent 5e185f32b5
commit 2ed4836dd2

View file

@ -56,6 +56,17 @@ var Clock = new Class({
*/
this.now = 0;
/**
* The time the Clock (and Scene) started, in milliseconds.
*
* This can be compared to the `time` parameter passed to a Scene's `update` method.
*
* @name Phaser.Time.Clock#startTime
* @type {number}
* @since 3.60.0
*/
this.startTime = 0;
/**
* The scale of the Clock's time delta.
*
@ -144,6 +155,8 @@ var Clock = new Class({
*/
start: function ()
{
this.startTime = this.systems.game.loop.time;
var eventEmitter = this.systems.events;
eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);