Tweener<T, U>
Class in Zigurous.Tweening
Inherits from Tween
Declaration
public class Tweener<T, U> : Tween
Description
A tween that animates a parameter over time on an object from a start value to an end value.
Type Parameters
T | The type of object to tween. |
U | The type of parameter to tween. |
Properties
target | The object being tweened. |
getter | The function that gets the current value of the parameter being tweened. |
setter | The function that sets a new value of the parameter being tweened. |
interpolater | The function that interpolates values between the tween's start and end value. |
startValue | The initial value of the parameter at the start of the tween. |
endValue | The desired value of the parameter at the end of the tween. |
Constructors
Tweener | Creates a new tweener. |
Inherited
Properties
id | An identifier that can be used to distinguish the tween from others. This is not explicitly required nor is it necessarily unique. The id is often used to identify which object the parameter being animated belongs to, and often that object is animating multiple parameters. |
sceneIndex | The index of the scene that contains the object being animated by the tween. The is used to kill the tween when the scene is unloaded. |
State | The animation state of the tween. |
IsPlaying | Whether the tween is playing. |
IsStopped | Whether the tween is stopped. |
IsComplete | Whether the tween is complete. |
IsKilled | Whether the tween is killed. |
ease | The easing function type used by the tween to animate values. |
duration | The amount of seconds the tween takes to complete. |
Elapsed | The amount of seconds that have elapsed since the tween started. |
PercentComplete | The tween's percentage of completion. |
delay | The amount of seconds the tween waits before playing after being started. |
DelayElapsed | The amount of seconds that have elapsed during the tween's delayed state, when applicable. |
IsDelayed | Whether the tween is currently in a delayed state, i.e., the tween has been started but the elapsed time has not exceeded the delay duration. |
loops | The number of times the tween loops. A value of -1 will loop the tween infinitely. |
loopType | The style in which the tween loops. |
Iterations | The number of times the tween has completed. |
reversed | Animates from the end value to the start value as opposed to animating from the start value to the end value like normal. |
snapping | Smoothly snaps all interpolated values to whole numbers. |
recyclable | Keeps the tween in memory to be re-used after being killed. |
autoStart | Automatically starts the tween after being created. |
autoKill | Automatically kills the tween after being completed. |
eventHandler | An event handler that responds to lifecycle events of the tween. |
Inherited
Methods
Animate | Animates the parameter being tweened to the current state. |
Play | Plays the tween, whether starting for the first time or resuming from a stopped state. |
Stop | Stops the tween if currently being played. |
Complete | Completes the tween, jumping to the end value. |
Kill | Kills the tween in its place, preventing any further state changes or changes to the parameter being animated. |
Restart | Restarts the tween as along as it has not been killed. |