View Single Post
06-23-15, 11:07 AM   #3
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Resike View Post
Try to increment the place of the template argument, just like the CreateTexture one:

Lua Code:
  1. Frame:CreateTexture(["textureName"[, "layer"]][, "inheritsFrom"])

If thats not working then maybe it doesn't support templates which would be weird.

On the second tought you maybe need this one:

http://wowprogramming.com/docs/widge...reateAnimation
I'm glad I'm not the only one who finds that weird. The argument is in the right place and tried incrementing it to the 3rd argument but that didn't work either. It detects that I am trying to use a template but it cannot find my declared animation group "MY_FadeOutTemplate". I don't think animation groups use the "virtual" attribute but I tried it with and without but no luck.

Lua Code:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/">
  2.     <AnimationGroup name="MY_AnimationGroupTemplate" virtual="true">
  3.         <Alpha change="-1" smoothing="IN" duration="0.3" order="1" />
  4.         <Translation offsetX="0" offsetY="10" smoothing="OUT" duration="0.3" order="1" />
  5.         <Scripts>
  6.             <OnFinished>
  7.                 self:GetParent():Hide();
  8.             </OnFinished>
  9.         </Scripts>
  10.     </AnimationGroup>
  11. </Ui>

Lua Code:
  1. local f = CreateFrame("Frame", "TestingFrame", UIParent)
  2. f:SetSize(512, 512)
  3. f:SetPoint("LEFT", UIParent, "LEFT", 150, 100)
  4. f.closeAnim = f:CreateAnimationGroup(nil, "MY_AnimationGroupTemplate")

Code:
TestingFrame:CreateAnimationGroup(): Couldn't find inherited node "MY_AnimationGroupTemplate"
That's what I want to inherit as a test but I just can't get it to work with CreateAnimationGroup.

I will try using CreateAnimation but its a pain since there are 2 Animation types I want to use and seems a shame to have to keep creating separate Animation Groups.

Last edited by Mayron : 06-23-15 at 11:18 AM.
  Reply With Quote