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
- Path:IsForbidden() - This function is not yet documented
- 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:SetChildKey(key) - Sets the animation to manipulate a particular child member of its host frame
- 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: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:SetTarget(region) - Sets the region affected by this animation
- Path:SetTargetKey(key) - Sets the animation to manipulate a particular child member of its target
- Path:Stop() - Stops the animation
Script Handlers
- 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