1.7 KiB
1.7 KiB
AnimationInstance
This is the AnimationInstance class. It represents a single animation instance
Fields
| Field | Type | Description |
|---|---|---|
| element | VisualElement |
The element being animated |
| type | string |
The type of animation |
| args | table |
The animation arguments |
| duration | number |
The duration in seconds |
| startTime | number |
The animation start time |
| isPaused | boolean |
Whether the animation is paused |
| handlers | table |
The animation handlers |
| easing | string |
The easing function name |
Functions
| Method | Returns | Description |
|---|---|---|
| AnimationInstance.new | AnimationInstance | Creates a new animation instance |
| AnimationInstance:complete | - | Called when the animation is completed |
| AnimationInstance:start | AnimationInstance | Starts the animation |
| AnimationInstance:update | boolean | Updates the animation |
AnimationInstance.new(element, animType, args, duration, easing)
Creates a new AnimationInstance
Parameters
elementVisualElementThe element to animateanimTypestringThe type of animationargstableThe animation argumentsdurationnumberDuration in secondseasingstringThe easing function name
Returns
AnimationInstanceThenew animation instance
AnimationInstance:complete()
Gets called when the animation is completed
AnimationInstance:start()
Starts the animation
Returns
AnimationInstanceselfThe animation instance
AnimationInstance:update(elapsed)
Updates the animation
Parameters
elapsednumberThe elapsed time in seconds
Returns
booleanWhetherthe animation is finished