Skip to content

AnimationInstance

This is the AnimationInstance class. It represents a single animation instance

Fields

FieldTypeDescription
elementVisualElementThe element being animated
typestringThe type of animation
argstableThe animation arguments
durationnumberThe duration in seconds
startTimenumberThe animation start time
isPausedbooleanWhether the animation is paused
handlerstableThe animation handlers
easingstringThe easing function name

Functions

MethodReturnsDescription
AnimationInstance.newAnimationInstanceCreates a new animation instance
AnimationInstance:complete-Called when the animation is completed
AnimationInstance:startAnimationInstanceStarts the animation
AnimationInstance:updatebooleanUpdates the animation

AnimationInstance.new(element, animType, args, duration, easing)

Creates a new AnimationInstance

Parameters

  • element VisualElement The element to animate
  • animType string The type of animation
  • args table The animation arguments
  • duration number Duration in seconds
  • easing string The easing function name

Returns

  • AnimationInstance The new animation instance

AnimationInstance:complete()

Gets called when the animation is completed

AnimationInstance:start()

Starts the animation

Returns

  • AnimationInstance self The animation instance

AnimationInstance:update(elapsed)

Updates the animation

Parameters

  • elapsed number The elapsed time in seconds

Returns

  • boolean Whether the animation is finished

Released under the MIT License.