Skip to content

Commit ae591c1

Browse files
committed
Timeline.setTimeScale would only impact the Timeline loop and completion delays, not the actively running Tweens. It now scales the time for all child tweens as well. Fix phaserjs#4164
1 parent 6d17343 commit ae591c1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ The following changes took place in the Pointer class:
184184
* `Zone.setSize` didn't update the displayOrigin, causing touch events to be inaccurate as the origin was out. Fix #4131 (thanks @rexrainbow)
185185
* `Tween.restart` wouldn't restart the tween properly. Fix #4594 (thanks @NokFrt)
186186
* Looped Tween Timelines would mess-up the tween values on every loop repeat, causing the loop to fail. They now loop correctly due to a fix in the Tween.play method. Fix #4558 (thanks @peteroravec)
187+
* `Timeline.setTimeScale` would only impact the Timeline loop and completion delays, not the actively running Tweens. It now scales the time for all child tweens as well. Fix #4164 (thanks @garethwhittaker)
187188

188189
### Examples, Documentation and TypeScript
189190

src/tweens/Timeline.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ var TWEEN_CONST = require('./tween/const');
1414
* @classdesc
1515
* A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween.
1616
*
17-
* The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline.
17+
* The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence
18+
* of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline.
1819
*
1920
* @class Timeline
2021
* @memberof Phaser.Tweens
@@ -695,8 +696,6 @@ var Timeline = new Class({
695696
return;
696697
}
697698

698-
var rawDelta = delta;
699-
700699
if (this.useFrames)
701700
{
702701
delta = 1 * this.manager.timeScale;
@@ -720,7 +719,7 @@ var Timeline = new Class({
720719
{
721720
var tween = this.data[i];
722721

723-
if (tween.update(timestamp, rawDelta))
722+
if (tween.update(timestamp, delta))
724723
{
725724
stillRunning--;
726725
}

0 commit comments

Comments
 (0)