Wowpedia
Advertisement
Wowpedia
240,483
pages

Animation (inherits from ParentedObject and ScriptObject, created with AnimationGroup:CreateAnimation) changes the presentation or other characteristics of a frame or other region over time.

The Animation object will take over the work of calling code over time, or when it is done, and tracks how close the animation is to completion.

The Animation type doesn't create any visual effects by itself, but it does provide an OnUpdate handler that you can use to support specialized time-sensitive behaviors that aren't provided by the transformations descended from Animations. In addition to tracking the passage of time through an elapsed argument, you can query the animation's progress as a 0-1 fraction to determine how you should set your behavior.

You can also change how the elapsed time corresponds to the progress by changing the smoothing, which creates acceleration or deceleration, or by adding a delay to the beginning or end of the animation.

You can also use an Animation as a timer, by setting the Animation's OnFinished script to trigger a callback and setting the duration to the desired time.

Defined methods

Animation:GetDuration() - Get the number of seconds it takes for the animation to progress from start to finish.
Animation:GetElapsed() - Gets the amount of time in seconds that the animation has been playing for.
Animation:GetEndDelay() - Get the number of seconds the animation delays after finishing.
Animation:GetOrder() - Gets the order of the animation within its parent group.
Animation:GetProgress() - Returns the progress of the animation as a unit value [0,1]. Ignores start and end delay.
Animation:GetRegionParent() - Gets the Region object that the animation operates on. The region object is this Animation's parent's parent (the AnimationGroup's parent).
Animation:GetSmoothProgress() - Returns a smoothed, [0,1] progress value for the animation.
Animation:GetSmoothing() - Gets the smoothing type for the animation.
Animation:GetStartDelay() - Get the number of seconds that the animation delays before it starts to progress.
Animation:GetTarget()
Animation:IsDelaying() - Returns true if the animation is in the middle of a start or end delay.
Animation:IsDone() - Returns true if the animation has finished playing.
Animation:IsPaused() - Returns true if the animation is paused.
Animation:IsPlaying() - Returns true if the animation is playing.
Animation:IsStopped() - Returns true if the animation is stopped.
Animation:Pause() - Pause the animation.
Animation:Play([reversed, elapsedOffset]) - Play the animation.
Animation:Restart() - Restart the animation.
Animation:SetChildKey()
Animation:SetDuration(durationSec) - Set the number of seconds it takes for the animation to progress from start to finish.
Animation:SetEndDelay(delaySec) - Set the number of seconds the animation delays after finishing.
Animation:SetOrder(order) - Sets the order that the animation plays within its parent group. Range is [1,100].
Animation:SetParent(animGroup or animGroupName) - Sets the parent for the animation. If the animation was not already a child of the parent, the parent will insert the animation into the proper order amongst its children.
Animation:SetPlaying(play)
Animation:SetSmoothProgress(smoothProgress) - Sets the smooth progress for an animation.
Animation:SetSmoothing(smoothType) - Sets the smoothing type for the animation. Input is [IN,OUT, or IN_OUT].
Animation:SetStartDelay(delaySec) - Set the number of seconds that the animation delays before it starts to progress.
Animation:SetTarget()
Animation:SetTargetKey()
Animation:Stop() - Stop the animation.

Patch changes

External links

References

  1. ^ zork 2009-10-22. Animation roundup. WoWInterface.
  2. ^ Blizzard Entertainment zootfizzle 2009-01-01. 3.1.0 API Changes - Animation System. Archived from the original on 2009-01-01.
Advertisement