I'm having trouble figuring how to properly anchor my animations, and I need some help.
I built a "fade out" animation that shrinks and fades my custom frames. As the animation runs, each child texture will scale-down towards it's own center instead of its parent frame. How do I get all the textures to scale as an unified unit? Would I have to run a separate "Translation" animation for each texture?
Sample of code I'm running
Code:
local plate = CreateFrame("Frame",nil,UIParent)
local backleft,backright,backtop,backbottom = plate:CreateTexture(),plate:CreateTexture(),plate:CreateTexture(),plate:CreateTexture()
backleft:SetTexture(0,0,0)
backright:SetTexture(0,0,0)
backtop:SetTexture(0,0,0)
backbottom:SetTexture(0,0,0)
backtop:SetPoint("TOPLEFT",plate,"TOPLEFT")
backtop:SetPoint("BOTTOMRIGHT",plate,"TOPRIGHT",0,-2)
backbottom:SetPoint("BOTTOMLEFT",plate,"BOTTOMLEFT")
backbottom:SetPoint("TOPRIGHT",plate,"BOTTOMRIGHT",0,2)
backleft:SetPoint("TOPLEFT",plate,"TOPLEFT")
backleft:SetPoint("BOTTOMRIGHT",plate,"BOTTOMLEFT",2,0)
backright:SetPoint("TOPRIGHT",plate,"TOPRIGHT")
backright:SetPoint("BOTTOMLEFT",plate,"BOTTOMRIGHT",-2,0)
local ag = plate:CreateAnimationGroup()
ag:SetLooping("NONE")
ag:SetScript("OnFinished",removePlate)
local a1 = ag:CreateAnimation("Scale")
a1:SetScale(-0.33, -0.33)
a1:SetDuration(1)
a1:SetSmoothing("IN")
a1:SetOrigin("CENTER",0,0)
local a2 = ag:CreateAnimation("Alpha")
a2:SetChange(-1)
a2:SetDuration(1)
a2:SetSmoothing("IN")
plate:SetAllPoints(realframe)