You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tween.delay, Tween.repeat and Tween.yoyo will no longer throw an error if called before a TweenData object has been created (via Tween.to or Tween.from) (thanks @SomMeriphaserjs#1419)
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
-[How to Build](#how-to-build)
10
10
-[Koding](#koding)
11
11
-[Bower / NPM](#bower)
12
-
-[CDNJS](#cdnjs)
12
+
-[jsDelivr](#jsdelivr)
13
13
-[Requirements](#requirements)
14
14
-[Build Files](#build-files)
15
15
-[Learn By Example](#example)
@@ -79,6 +79,8 @@ Version 2.2.2 - "Alkindar" - in development
79
79
80
80
### Bug Fixes
81
81
82
+
* Tween.delay, Tween.repeat and Tween.yoyo will no longer throw an error if called before a TweenData object has been created (via Tween.to or Tween.from) (thanks @SomMeri#1419)
83
+
82
84
For details about changes made in previous versions of Phaser see the full Change Log at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
83
85
84
86

@@ -124,16 +126,18 @@ Nice and easy :)
124
126
125
127

126
128
127
-
<aname="cdnjs"></a>
128
-
## CDNJS
129
+
<aname="jsdelivr"></a>
130
+
## jsDelivr
131
+
132
+
Phaser is now available on [jsDelivr](http://jsdelivr.com) - a "super-fast CDN for developers and webmasters." You can include the following in your html:
129
133
130
-
Phaser is now available on [CDNJS](http://cdnjs.com). You can include the following in your html:
Copy file name to clipboardExpand all lines: src/tween/Tween.js
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -359,6 +359,7 @@ Phaser.Tween.prototype = {
359
359
/**
360
360
* Sets the delay in milliseconds before this tween will start. If there are child tweens it sets the delay before the first child starts.
361
361
* The delay is invoked as soon as you call `Tween.start`. If the tween is already running this method doesn't do anything for the current active tween.
362
+
* If you have not yet called `Tween.to` or `Tween.from` at least once then this method will do nothing, as there are no tweens to delay.
362
363
* If you have child tweens and pass -1 as the index value it sets the delay across all of them.
363
364
*
364
365
* @method Phaser.Tween#delay
@@ -368,6 +369,8 @@ Phaser.Tween.prototype = {
368
369
*/
369
370
delay: function(duration,index){
370
371
372
+
if(this.timeline.length===0){returnthis;}
373
+
371
374
if(typeofindex==='undefined'){index=0;}
372
375
373
376
if(index===-1)
@@ -388,6 +391,7 @@ Phaser.Tween.prototype = {
388
391
389
392
/**
390
393
* Sets the number of times this tween will repeat.
394
+
* If you have not yet called `Tween.to` or `Tween.from` at least once then this method will do nothing, as there are no tweens to repeat.
391
395
* If you have child tweens and pass -1 as the index value it sets the number of times they'll repeat across all of them.
392
396
* If you wish to define how many times this Tween and all children will repeat see Tween.repeatAll.
393
397
*
@@ -398,6 +402,8 @@ Phaser.Tween.prototype = {
398
402
*/
399
403
repeat: function(total,index){
400
404
405
+
if(this.timeline.length===0){returnthis;}
406
+
401
407
if(typeofindex==='undefined'){index=0;}
402
408
403
409
if(index===-1)
@@ -419,6 +425,7 @@ Phaser.Tween.prototype = {
419
425
/**
420
426
* A Tween that has yoyo set to true will run through from its starting values to its end values and then play back in reverse from end to start.
421
427
* Used in combination with repeat you can create endless loops.
428
+
* If you have not yet called `Tween.to` or `Tween.from` at least once then this method will do nothing, as there are no tweens to yoyo.
422
429
* If you have child tweens and pass -1 as the index value it sets the yoyo property across all of them.
423
430
* If you wish to yoyo this Tween and all of its children then see Tween.yoyoAll.
0 commit comments