Skip to content

Commit 37fc327

Browse files
committed
Tween elapsed debug.
1 parent 8833a50 commit 37fc327

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/tween/TweenData.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ Phaser.TweenData.prototype = {
240240

241241
this.startTime = this.game.time.time + this.delay;
242242

243+
// DEBUG
244+
this.realStart = Date.now();
245+
this.totalElapsedMs = 0;
246+
247+
console.log('startTime', this.startTime);
248+
console.log('realStart', this.realStart);
249+
243250
if (this.parent.reverse)
244251
{
245252
this.dt = this.duration;
@@ -375,6 +382,13 @@ Phaser.TweenData.prototype = {
375382

376383
this.percent = this.dt / this.duration;
377384

385+
this.totalElapsedMs = (this.totalElapsedMs || 0) + this.game.time.elapsedMS;
386+
387+
if (this.percent === 1)
388+
{
389+
console.log("ElapsedTime", this.totalElapsedMs, Date.now() - this.realStart);
390+
}
391+
378392
this.value = this.easingFunction(this.percent);
379393

380394
for (var property in this.vEnd)

0 commit comments

Comments
 (0)