mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Merge pull request #6802 from samme/feature/timeline-timeScale
Add Phaser.Time.Timeline#timeScale
This commit is contained in:
commit
71684df68e
1 changed files with 17 additions and 1 deletions
|
@ -133,6 +133,22 @@ var Timeline = new Class({
|
|||
*/
|
||||
this.elapsed = 0;
|
||||
|
||||
/**
|
||||
* The Timeline's delta time scale.
|
||||
*
|
||||
* Values higher than 1 increase the speed of time, while values smaller than 1 decrease it.
|
||||
* A value of 0 freezes time and is effectively equivalent to pausing the Timeline.
|
||||
*
|
||||
* This doesn't affect the delta time scale of any Tweens created by the Timeline.
|
||||
* You will have to set the `timeScale` of each Tween or the Tween Manager if you want them to match.
|
||||
*
|
||||
* @name Phaser.Time.Timeline#timeScale
|
||||
* @type {number}
|
||||
* @default
|
||||
* @since 3.90.0
|
||||
*/
|
||||
this.timeScale = 1;
|
||||
|
||||
/**
|
||||
* Whether the Timeline is running (`true`) or active (`false`).
|
||||
*
|
||||
|
@ -241,7 +257,7 @@ var Timeline = new Class({
|
|||
return;
|
||||
}
|
||||
|
||||
this.elapsed += delta;
|
||||
this.elapsed += delta * this.timeScale;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue