Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-11-11, 09:56 AM   #1
cormanthor
A Warpwood Thunder Caller
 
cormanthor's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2008
Posts: 97
Animation of the Minimap

I'm trying to animate the Minimap through translation and scale transitions, based on a conditional. I have the lua functioning as intended, but the animation only works on translation of the border frame, not the scale, and neither on the Minimap itself. I read on here that parenting did not affect animations, which is why I duplicated my efforts between the two frames.
I've attached the .lua file in its entirety for better troubleshooting (Mask.tga can be subbed out for the WHITE8X8 image). Any help would be greatly appreciated.
Here's the relevant code:
Code:
-- create animation effects

-- working as intended
local partyAGborder = mm:CreateAnimationGroup()
local trans1border = partyAGborder:CreateAnimation("Translation")
trans1border:SetOffset(xOffset,yOffset)
trans1border:SetDuration(duration)
trans1border:SetSmoothing("IN_OUT")
trans1border:SetOrder(1)
-- end working section

local scale1border = partyAGborder:CreateAnimation("Scale")
scale1border:SetScale(smallScale,smallScale)
scale1border:SetOrigin("CENTER", 0, 0)
scale1border:SetDuration(duration)
scale1border:SetSmoothing("NONE")
scale1border:SetOrder(1)

local partyAGmap = Minimap:CreateAnimationGroup()
local trans1map = partyAGmap:CreateAnimation("Translation")
trans1map:SetOffset(xOffset,yOffset)
trans1map:SetDuration(duration)
trans1map:SetSmoothing("IN_OUT")
trans1map:SetOrder(1)
trans1map:SetScript("OnFinished", function(self) MoveMap(nil, "party") end)
local scale1map = partyAGmap:CreateAnimation("Scale")
scale1map:SetScale(smallScale,smallScale)
scale1map:SetOrigin("CENTER", 0, 0)
scale1map:SetDuration(duration)
scale1map:SetSmoothing("NONE")
scale1map:SetOrder(1)

-- working as intended
local soloAGborder = mm:CreateAnimationGroup()
local trans2border = soloAGborder:CreateAnimation("Translation")
trans2border:SetOffset(-1*xOffset,-1*yOffset)
trans2border:SetDuration(duration)
trans2border:SetSmoothing("IN_OUT")
trans2border:SetOrder(1)
-- end working section

local scale2border = soloAGborder:CreateAnimation("Scale")
scale2border:SetScale(largeScale,largeScale)
scale2border:SetOrigin("CENTER", 0, 0)
scale2border:SetDuration(duration)
scale2border:SetSmoothing("NONE")
scale2border:SetOrder(1)

local soloAGmap = Minimap:CreateAnimationGroup()
local trans2map = soloAGmap:CreateAnimation("Translation")
trans2map:SetOffset(-1*xOffset,-1*yOffset)
trans2map:SetDuration(duration)
trans2map:SetSmoothing("IN_OUT")
trans2map:SetOrder(1)
trans2map:SetScript("OnFinished", function(self) MoveMap(nil, "solo") end)
local scale2map = soloAGmap:CreateAnimation("Scale")
scale2map:SetScale(largeScale,largeScale)
scale2map:SetOrigin("CENTER", 0, 0)
scale2map:SetDuration(duration)
scale2map:SetSmoothing("NONE")
scale2map:SetOrder(1)
Attached Files
File Type: lua cormMiniMap.lua (5.0 KB, 610 views)
__________________
Some days it's just not worth chewing through the restraints...
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Animation of the Minimap


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off