Thread Tools Display Modes
04-05-11, 11:32 PM   #1
Crepusculu
A Deviate Faerie Dragon
 
Crepusculu's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 16
Animation Anchoring

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)
  Reply With Quote
04-06-11, 04:23 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I can't help you with this. But I can say that the animation stuff is full of bugs. I've tried to build some animations myself and gave up after several days of testing.
Animated fontstrings for example are always scaling to the bottom left corner - regardles of any anchorpoints, parent frames or SetOrigins.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Animation Anchoring


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