A Path animation combines multiple transitions into a single control path with multiple ControlPoints. The offsets of each control point are set relative to the origin of the region, rather than relative to the current position of the animation. The following example will animate the player's portrait in a box to the bottom-right of it's original position:
local group = PlayerPortrait:CreateAnimationGroup("PortraitBox")
local path = group:CreateAnimation("Path")
local a = path:CreateControlPoint()
local b = path:CreateControlPoint()
local c = path:CreateControlPoint()
local d = path:CreateControlPoint()
path:SetCurve("SMOOTH")
path:SetDuration(4.0)
a:SetOffset(70, 0)
a:SetOrder(1)
b:SetOffset(75, -75)
b:SetOrder(2)
c:SetOffset(0, -75)
c:SetOrder(3)
d:SetOffset(0, 0)
d:SetOrder(4)
PortraitBox:Play()
Defined Methods
- Path:CreateControlPoint(["name" [, "template" [, order]]]) - Creates a new control point for the given path
- ... = Path:GetControlPoints() - Returns the control points that belong to a given path
- curveType = Path:GetCurve() - Returns the curveType of the given path
- max = Path:GetMaxOrder() - Returns the maximum order of the control points belonging to a given path
- Path:SetCurve("curveType") - Sets the curve type for the path animation
Inherited Methods
- duration = Path:GetDuration() - Returns the time for the animation to progress from start to finish
- elapsed = Path:GetElapsed() - Returns the amount of time since the animation began playing
- delay = Path:GetEndDelay() - Returns the amount of time the animation delays after finishing
- framerate = Path:GetMaxFramerate() - Returns the maximum number of times per second that the animation will update its progress
- name = Path:GetName() - Returns the widget object's name
- type = Path:GetObjectType() - Returns the object's widget type
- order = Path:GetOrder() - Returns the order of the animation within its parent group
- parent = Path:GetParent() - Returns the object's parent object
- progress = Path:GetProgress() - Returns the progress of an animation, ignoring smoothing effects
- progress = Path:GetProgressWithDelay() - Returns the progress of the animation and associated delays
- region = Path:GetRegionParent() - Returns the `Region` object on which the animation operates
- handler = Path:GetScript("scriptType") - Returns the widget's handler function for a script
- progress = Path:GetSmoothProgress() - Returns the progress of the animation (ignoring start and end delay)
- smoothType = Path:GetSmoothing() - Returns the smoothing type for the animation
- delay = Path:GetStartDelay() - Returns the amount of time the animation delays before its progress begins
- hasScript = Path:HasScript("scriptType") - Returns whether the widget supports a script handler
- Path:HookScript("scriptType", handler) - Securely hooks a script handler
- delaying = Path:IsDelaying() - Returns whether the animation is currently in the middle of a start or end delay
- done = Path:IsDone() - Returns whether the animation has finished playing
- isType = Path:IsObjectType("type") - Returns whether the object belongs to a given widget type
- paused = Path:IsPaused() - Returns whether the animation is currently paused
- playing = Path:IsPlaying() - Returns whether the animation is currently playing
- stopped = Path:IsStopped() - Returns whether the animation is currently stopped
- Path:Pause() - Pauses the animation
- Path:Play() - Plays the animation
- Path:SetDuration(duration) - Sets the time for the animation to progress from start to finish
- Path:SetEndDelay(delay) - Sets the amount of time for the animation to delay after finishing
- Path:SetMaxFramerate(framerate) - Sets the maximum number of times per second for the animation to update its progress
- Path:SetOrder(order) - Sets the order for the animation to play within its parent group
- Path:SetParent(animGroup) or Path:SetParent("animGroupName") - Sets the parent for the animation
- Path:SetScript("scriptType", handler) - Sets the widget's handler function for a script
- Path:SetSmoothProgress() - This function is not yet documented
- Path:SetSmoothing("smoothType") - Sets the smoothing type for the animation
- Path:SetStartDelay(delay) - Sets the amount of time for the animation to delay before its progress begins
- Path:Stop() - Stops the animation
Script Handlers
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnFinished(self, requested) - Run when the animation (or animation group) finishes animating
- OnLoad(self) - Run when the frame is created
- OnPause(self) - Run when the animation (or animation group) is paused
- OnPlay(self) - Run when the animation (or animation group) begins to play
- OnStop(self, requested) - Run when the animation (or animation group) is stopped
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine