VertexColor

From Warcraft Wiki
Jump to navigation Jump to search
Instantiation AnimationGroup:CreateAnimation("VertexColor")

Example

Shows a two second looping animation that will transition the vertex color from red to blue and then back again.

local Texture = UIParent:CreateTexture()
Texture:SetTexture([[Interface\Buttons\White8x8]])
Texture:SetPoint("CENTER")
Texture:SetSize(128, 128)

local AnimationGroup = Texture:CreateAnimationGroup()
AnimationGroup:SetLooping("BOUNCE")

local VertexColor = AnimationGroup:CreateAnimation("VertexColor")
VertexColor:SetStartColor(CreateColor(1, 0, 0))
VertexColor:SetEndColor(CreateColor(0, 0, 1))
VertexColor:SetDuration(2)

AnimationGroup:Play()

Methods

VertexColor:GetEndColor() : color
VertexColor:GetStartColor() : color
VertexColor:SetEndColor(color)
VertexColor:SetStartColor(color)
Animation:GetDuration() : durationSec - Returns the number of seconds it takes for the animation to progress from start to finish.
Animation:GetElapsed() : elapsedSec - Returns the amount of time in seconds that the animation has been playing for.
Animation:GetEndDelay() : delaySec - Returns the number of seconds the animation delays after finishing.
Animation:GetOrder() : order - Returns the order of the animation within its parent group.
Animation:GetProgress() : progress - Returns the progress of the animation.
Animation:GetRegionParent() : region - Returns the Region object that the animation operates on.
Animation:GetSmoothProgress() : progress - Returns a smoothed progress value for the animation.
Animation:GetSmoothing() : weights - Returns the smoothing type for the animation.
Animation:GetStartDelay() : delaySec - Sets the number of seconds that the animation delays before it starts to progress.
Animation:GetTarget() : target
Animation:IsDelaying() : isDelaying - Returns true if the animation is in the middle of a start or end delay.
Animation:IsDone() : isDone - Returns true if the animation has finished playing.
Animation:IsPaused() : isPaused - Returns true if the animation is paused.
Animation:IsPlaying() : isPlaying
Animation:IsStopped() : isStopped - Returns true if the animation is stopped.
Animation:Pause() - Pauses the animation.
Animation:Play() - Plays the animation.
Animation:Restart()
Animation:SetChildKey(childKey) : success
Animation:SetDuration(durationSec [, recomputeGroupDuration]) - Sets the number of seconds it takes for the animation to progress from start to finish.
Animation:SetEndDelay(delaySec [, recomputeGroupDuration]) - Sets the number of seconds the animation delays after finishing.
Animation:SetOrder(newOrder) - Sets the order that the animation plays within its parent group.
Animation:SetParent(parent [, order]) - Sets the parent for the animation.
Animation:SetPlaying(play)
Animation:SetSmoothProgress(durationSec) - Sets the smoothing type for the animation.
Animation:SetSmoothing(weights)
Animation:SetStartDelay(delaySec [, recomputeGroupDuration]) - Returns the number of seconds that the animation delays before it starts to progress.
Animation:SetTarget(target) : success
Animation:SetTargetKey(key) : success
Animation:SetTargetName(name) : success
Animation:SetTargetParent() : success
Animation:Stop() - Stops the animation.
ScriptObject:GetScript(scriptTypeName [, bindingType]) : script - Returns the widget script handler.
ScriptObject:HasScript(scriptName) : hasScript - Returns true if the region supports the given script type.
ScriptObject:HookScript(scriptTypeName, script [, bindingType]) - Securely post-hooks a widget script handler.
ScriptObject:SetScript(scriptTypeName [, script]) - Sets the widget script handler.
Object:ClearParentKey() - Clears the parent key.
Object:GetDebugName([preferParentKey]) : debugName - Returns the object's debug name.
Object:GetParent() : parent - Returns the parent object.
Object:GetParentKey() : parentKey - Returns the key on the parent that references this object.
Object:SetParentKey(parentKey [, clearOtherKeys]) - Sets a key on the parent to the child object.
FrameScriptObject:GetName() : name - Returns the object's global name.
FrameScriptObject:GetObjectType() : objectType - Returns the object's widget type.
FrameScriptObject:IsForbidden() : isForbidden - Returns true if insecure interaction with the object is forbidden.
FrameScriptObject:IsObjectType(objectType) : isType - Returns true if the object belongs to a given widget type or its subtypes.
FrameScriptObject:SetForbidden() #protected - Sets the object to be forbidden from an insecure execution path.

Script Types

OnFinished(self, requested) - Invoked when the animation finishes animating.
OnPause(self) - Invoked when the animation is paused.
OnPlay(self) - Invoked when the animation begins to play.
OnStop(self, requested) - Invoked when the animation is stopped.
OnUpdate(self, elapsed) - Invoked on every frame.
OnLoad(self) - Invoked when the object is created.