mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Merge pull request #6375 from samme/feature/clock-startTime
Add Phaser.Time.Clock#startTime
This commit is contained in:
commit
4d4aa77a68
1 changed files with 13 additions and 0 deletions
|
@ -56,6 +56,17 @@ var Clock = new Class({
|
||||||
*/
|
*/
|
||||||
this.now = 0;
|
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.
|
* The scale of the Clock's time delta.
|
||||||
*
|
*
|
||||||
|
@ -144,6 +155,8 @@ var Clock = new Class({
|
||||||
*/
|
*/
|
||||||
start: function ()
|
start: function ()
|
||||||
{
|
{
|
||||||
|
this.startTime = this.systems.game.loop.time;
|
||||||
|
|
||||||
var eventEmitter = this.systems.events;
|
var eventEmitter = this.systems.events;
|
||||||
|
|
||||||
eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);
|
eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this);
|
||||||
|
|
Loading…
Reference in a new issue