WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Animation Help (https://www.wowinterface.com/forums/showthread.php?t=43226)

Fox536 04-09-12 07:28 PM

Animation Help
 
Does anyone have experience or know a Guide to learning the Animation system in wow. I need some animations, mainly a Auto-Cast, and Spell Proc animation. If anyone knows how to create them, either the same as the default or from scratch I'd be greatly appreciative, and it'd help me out immensely.

semlar 04-09-12 09:57 PM

I know the animation system, I don't know if there are any guides for it but I could provide you with an example. I honestly couldn't tell you how I picked it up myself.

I believe the animations you're talking about are contained in ActionBarFrame.xml, specifically under "ActionBarButtonSpellActivationAlert".

The "ants" used for the proc animation is actually just a texture that's displayed one section at a time sort of like a flip-book.

First you should look at AnimationGroups (specifically CreateAnimation) and the Animation widget.

I'll try and provide a basic example here..
Lua Code:
  1. local f = CreateFrame("Frame", nil, UIParent)
  2. f:SetWidth(32)
  3. f:SetHeight(32)
  4. f:SetPoint("CENTER")
  5.  
  6. local tx = f:CreateTexture(nil, "BACKGROUND")
  7. tx:SetAllPoints()
  8. tx:SetTexture("interface/icons/inv_mushroom_11")
  9.  
  10. f.anigroup = f:CreateAnimationGroup() -- Create our animation group
  11.  
  12. f.spin = f.anigroup:CreateAnimation("Rotation") -- Rotation animation
  13. f.spin:SetOrder(1) -- Play it first, only matters with multiple animations
  14. f.spin:SetDuration(0.8) -- Spin for 0.8 seconds
  15. f.spin:SetDegrees(720) -- Total amount of rotation in degrees
  16.  
  17. f.scale = f.anigroup:CreateAnimation("Scale") -- Scale animation
  18. f.scale:SetOrder(1) -- Play it at the same time
  19. f.scale:SetDuration(1) -- Take 1 second
  20. f.scale:SetScale(5,5) -- Scale width and height to 500%
  21.  
  22. f.fade = f.anigroup:CreateAnimation("Alpha") -- Alpha animation
  23. f.fade:SetOrder(2) -- Play after the first group
  24. f.fade:SetDuration(0.5) -- Take 0.5 seconds
  25. f.fade:SetChange(-1) -- Reduce alpha by a factor of 1 (like f:SetAlpha(f:GetAlpha-1))
  26. f.fade:SetEndDelay(0.5) -- Wait 0.5 seconds after finishing before continuing
  27.  
  28. f.anigroup:SetLooping("BOUNCE") -- Repeat forward and backwards
  29. f.anigroup:Play() -- Start our animation group

Fox536 04-09-12 10:39 PM

Thanks I'll look into that, I think I found what I was looking for as far as the Flash and AutoCast animations in ActionButton.xml getting that to all work exactly how I want is another story but I think I got how they're working sorta, if only the blizzard code didn't jump all over lol. Abstraction is awesome until you're trying to read someone elses code lol. But I'm going to still learn Animations and what you've posted will definitely help since they're arnt many guides to animations. The things I could do with custom Animations would be pretty cool. If only there were a way to arc translations easier, rather then needing to step through the groups, maybe in wow 5.0.

zork 04-10-12 01:08 AM

I wrote some stuff on that topic.

For more check:
http://www.wowinterface.com/forums/s...ad.php?t=35104

The only thing that you need is a so called end-state after each animation. Once the animation is finished and it is not set to repeat you need to call this state in the OnFinished event of the animation.

Basically you can do all this:
http://wowprogramming.com/docs/widgets/Alpha
http://wowprogramming.com/docs/widgets/Rotation
http://wowprogramming.com/docs/widgets/Scale
http://wowprogramming.com/docs/widgets/Translation

Once you are finished you need to set the texture values in the OnFinished event. (Example: If you have an animation that fades your animation you need to call SetAlpha() with the corresponding alpha value in the OnFinished event.)

What you probably want is a bouncing animation that adjusts scale and alpha of a texture that bounces like 3-4 times with decreasing values and fades afterwards.

semlar 04-10-12 01:25 AM

Ah, good. That's probably more helpful. I didn't know there was a tutorial section.

Fox536 04-12-12 09:55 PM

lol ya thanks Zork I found your topic through google but didn't know exactly what was going on in it. But now that i've seen some of it work I get the basic Idea behind it. I was looking at the code for the spell proc and it had me so confused until I realized after messing with it for about an hour that it was 2 different parts, and the animation wasn't actually looping like it looks lol. I hope to have a working spell proc animation up and working soon for my addon, because without it, it looks a little plain lol.

Thanks for the help guys.


All times are GMT -6. The time now is 02:34 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI