of the tween
Adds tweens to be called when this tween ends. The tweens here will be called all at the same time.
returns this tween for daisy chaining methods.
Rest
...tweens: Tween<any>[]tweens to be started when this tween ends
Sets the delay for this tween.
This will only be applied at the start of the tween. For delaying the repeating of a tween, see repeatDelay
This will only work before calling start.
returns this tween for daisy chaining methods.
the delay for this tween.
Set the final values for the target object's properties by reference. This will store a reference to the properties object allowing you to change the final values while the tween is running. If you want the tween to make a copy of the final values use to.
returns this tween for daisy chaining methods.
final values for the target object.
Optional
duration: numberif given it will be used as the duration in miliseconds. if not, a call to duration will be needed.
Optional
duration: numberSets the easing function to interpolate the starting values with the final values.
You can use the functions inside the Easing object.
returns this tween for daisy chaining methods.
a function that takes a number between 0 and 1 and returns another number between 0 and 1
Writes the starting values of the tween.
Starting values generated from start will be overwritten.
returns this tween for daisy chaining methods.
Starting values for this tween.
Gets the id for this tween. A tween id is a number that increases perpetually with each tween created. It is used inside Group to keep track of tweens
returns the id for this tween.
Sets the easing function to interpolate the starting values with the final values when the final value is an array of objects. Use this to create bezier curves or interpolate colors.
You can use the functions inside the Interpolation object.
returns this tween for daisy chaining methods.
A tween is playing when it has been started but hasn't ended yet. This has nothing to do with pausing. For that see isPaused.
returns true if this tween is playing.
Sets the onRepeat callback
returns this tween for daisy chaining methods.
the function to call on repeat. It will recieve the target object and this tween as a parameter.
Sets the onStart callback
returns this tween for daisy chaining methods.
the function to call on start. It will recieve the target object, this tween, and a number between 0 and 1 determining the progress as a parameter.
Sets the repeat delay for this tween.
This will only be applied at the start of every repeat. For delaying only the start, see delay
returns this tween for daisy chaining methods.
the repeat delay for this tween.
Experimental
Forces a tween to restart. Starting values for the animation will be stored at this moment. This literally calls reset and then start.
Starting values will be cleared!. This function will erase all values created from from and/or start
returns this tween for daisy chaining methods.
Optional
delay: numberif given it will be used as the delay in miliseconds.
Experimental
Sets the safety check function to test if the tweening object is still valid. If the function returns a non-truthy value, the tween will skip the update loop.
returns this tween for daisy chaining methods.
a function that takes the target object for this tween and returns true if the object is still valid.
Experimental
Skips forward the in the repeats of this tween by triggering a biiiiig update. Think of this as a less agressive end.
returns this tween for daisy chaining methods.
The amount of repeats to skip.
If true, the time will become zero and the object will return to the initial value in the next update.
Tweens won't start by themselves when created. Call this to start the tween. Starting values for the animation will be stored at this moment.
This function can't overwrite the starting values set by from
You can call this method on a finished tween to restart it without changing the starting values. To restart a tween and reset the starting values use restart
returns this tween for daisy chaining methods.
Optional
delay: numberif given it will be used as the delay in miliseconds.
Experimental
Starts all tweens chained to this tween. To chain a tween see chain.
returns this tween for daisy chaining methods.
If true, this tween will be stopped before it starts the chained tweens.
Sets the timescale for this tween. The deltaTime inside the update will be multiplied by this value allowing to speed up or slow down the flow of time.
returns this tween for daisy chaining methods.
the timescale value for this tween.
Set the final values for the target object's properties by copy.
This will try to create a deep copy of the properties
parameter.
If you want the tween to keep a reference to the final values use dynamicTo.
If an array value is provided for a value that originally wasn't an array, it will be interpreted as an interpolable curve and the values inside the array will be interpolated using the function provided in interpolation
If a string value that starts with either +
or -
is provided it will be taken as a relative value to the start value.
returns this tween for daisy chaining methods.
final values for the target object.
Optional
duration: numberif given it will be used as the duration in miliseconds. if not, a call to duration will be needed.
Optional
duration: numberUpdates this tween
returns true if the tween hasn't finished yet.
the amount of time that passed since last update in miliseconds
Prevent the removal of stopped, paused, finished or non started tweens from their group.
Experimental
Sets the easing function to interpolate the starting values with the final values on the way back due to a yoyo tween.
You can use the functions inside the Easing object.
returns this tween for daisy chaining methods.
a function that takes a number between 0 and 1 and returns another number between 0 and 1
Generated using TypeDoc
A Tween is basically an animation command. For example: Go from here to there in this amount of time.
Tweens won't start by themselves. Remeber to call start when you want your tweens to start!
Most methods will return the same object to allow for daisy chaining.