Tween#Tween

new Tween(target, game, manager) A Tween allows you to alter one or more properties of a target object over a defined period of time.This can be used for things such as alpha fading Sprites, scaling them or motion.Use Tween.to or Tween.from to set-up the tween values. You can create multiple tweens on the same objectby calling Tween.to multiple times on the same Tween. Additional tweens specified in this way become "child" tweens andare played through in sequence. You can use Tween.timeScale

Tween#update()

update(time) → {boolean} Core tween update function called by the TweenManager. Does not need to be invoked directly. Parameters Name Type Description time number A timestamp passed in by the TweenManager. Returns boolean - false if the tween and all child tweens have completed and should be deleted from the manager, otherwise true (still active). Source code: tween/Tween.js (Line 717)

Tween#updateTweenData()

updateTweenData(property, value, index) → {Phaser.Tween} Updates either a single TweenData or all TweenData objects properties to the given value.Used internally by methods like Tween.delay, Tween.yoyo, etc. but can also be called directly if you know which property you want to tweak.The property is not checked, so if you pass an invalid one you'll generate a run-time error. Parameters Name Type Argument Default Description property string The property to update. value number | functi

Tween#yoyo()

yoyo(enable, yoyoDelay, index) → {Phaser.Tween} 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.Used in combination with repeat you can create endless loops.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.If you have child tweens and pass -1 as the index value it sets the yoyo property across all of them.If you wish to y

Tween#yoyoDelay()

yoyoDelay(duration, index) → {Phaser.Tween} Sets the delay in milliseconds before this tween will run a yoyo (only applies if yoyo is enabled).The repeatDelay 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.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 set repeatDelay on.If you have child tweens and pass -1 as the index value it

TweenData#delay

delay : number The amount to delay by until the Tween starts (in ms). Only applies to the start, use repeatDelay to handle repeats. Source code: tween/TweenData.js (Line 113)

TweenData#dt

dt : number Current time value. Source code: tween/TweenData.js (Line 118)

TweenData#duration

duration : number The duration of the tween in ms. Default Value 1000 Source code: tween/TweenData.js (Line 56)

TweenData#easingFunction

easingFunction : Function The easing function used for the Tween. Default Value Phaser.Easing.Default Source code: tween/TweenData.js (Line 129)

TweenData#from()

from(properties, duration, ease, delay, repeat, yoyo) → {Phaser.TweenData} Sets this tween to be a from tween on the properties given. A from tween sets the target to the destination value and tweens to its current value.For example a Sprite with an x coordinate of 100 tweened from x 500 would be set to x 500 and then tweened to x 100 by giving a properties object of { x: 500 }. Parameters Name Type Argument Default Description properties object The properties you want to tween, such a