Quantcast [Animation] Scale "Pulsing" acting strangely - WoWInterface
Thread Tools Display Modes
08-21-16, 05:19 PM   #1
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 126
[Animation] Scale "Pulsing" acting strangely

I'm trying to make an animation where I "pulse" an object's scale. I've got the animation to work, but the animation itself isn't acting as intended. See the gif below to see what I'm referring to.

https://gfycat.com/LittleSnarlingIvorygull

I'm sure one question that might be asked as to why I'm attempting to do this as Blizzard offers this effect already. The reason being that I'm looking to make it a "progress texture". The picture below is what I'm trying to achieve.



Below is my current code. Commented code is everything that I've tried.
Lua Code:
  1. -- Lava Surge Progress Bar/Texture
  2. SSA.LavaSurgeBar = CreateFrame("StatusBar","LavaSurgeBar",UIParent);
  3. local LavaSurgeBar = SSA.LavaSurgeBar;
  4.  
  5. LavaSurgeBar:SetStatusBarTexture("Textures\\SpellActivationOverlays\\Imp_Empowerment");
  6. LavaSurgeBar:GetStatusBarTexture():SetHorizTile(false);
  7. LavaSurgeBar:GetStatusBarTexture():SetVertTile(false);
  8. LavaSurgeBar:SetOrientation("VERTICAL");
  9. LavaSurgeBar:SetPoint("CENTER",UIParent,"CENTER",-130,0);
  10. LavaSurgeBar:SetWidth(116);
  11. LavaSurgeBar:SetHeight(200);
  12. LavaSurgeBar:SetFrameStrata("LOW");
  13. LavaSurgeBar:SetStatusBarColor(1,1,1);
  14.  
  15. LavaSurgeBar.bg = LavaSurgeBar:CreateTexture(nil,"BACKGROUND");
  16. LavaSurgeBar.bg:SetTexture("Textures\\SpellActivationOverlays\\Imp_Empowerment");
  17. LavaSurgeBar.bg:SetAllPoints(true);
  18. LavaSurgeBar.bg:SetVertexColor(1,1,1);
  19. LavaSurgeBar.bg:SetAlpha(0.5);
  20.  
  21. LavaSurgeBar.scaler = LavaSurgeBar:CreateAnimationGroup();
  22. LavaSurgeBar.scaler:SetLooping("BOUNCE");
  23. --LavaSurgeBar.scaler:SetLooping("REPEAT");
  24.  
  25. local scaleOut = LavaSurgeBar.scaler:CreateAnimation("Scale");
  26. scaleOut:SetFromScale(1,1);
  27. scaleOut:SetToScale(1,1.08);
  28. --scaleOut:SetScale(1,1.08);
  29. scaleOut:SetDuration(0.5);
  30. scaleOut:SetEndDelay(0);
  31. scaleOut:SetSmoothing("NONE");
  32. --scaleOut:SetSmoothing("OUT");
  33.  
  34. --[[local scaleIn = LavaSurgeBar.scaler:CreateAnimation("Scale");
  35. scaleIn:SetFromScale(1,1.08);
  36. scaleIn:SetToScale(1,1);
  37. --scaleIn:SetScale(1,1);
  38. scaleIn:SetDuration(0.5);
  39. scaleIn:SetOrder(1);
  40. scaleIn:SetSmoothing("NONE");
  41. scaleIn:SetEndDelay(0);]]
  42. --scaleIn:SetSmoothing("OUT");
  43. --scaleIn:SetEndDelay(0);
  Reply With Quote
08-21-16, 10:50 PM   #2
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Lua Code:
  1. local scalePush = 1.2
  2. local scalePull = 1 / scalePush
  3.  
  4. local scaleOut = LavaSurgeBar.scaler:CreateAnimation("Scale")
  5. scaleOut:SetOrder(1)
  6. scaleOut:SetDuration(0.5)
  7. scaleOut:SetStartDelay(0.1)
  8. scaleOut:SetSmoothing("IN_OUT")
  9. scaleOut:SetFromScale(1, 1)
  10. scaleOut:SetToScale(1, scalePush)
  11.  
  12. local scaleIn = LavaSurgeBar.scaler:CreateAnimation("Scale")
  13. scaleIn:SetOrder(2)
  14. scaleIn:SetDuration(0.5)
  15. scaleIn:SetStartDelay(0.1)
  16. scaleIn:SetSmoothing("IN_OUT")
  17. scaleIn:SetFromScale(1,1)
  18. scaleIn:SetToScale(1, scalePull)
  19.  
  20. LavaSurgeBar.scaler:Play()


when doing scaleOut -> 1.2 is the new base value (100%) so you have to math out the old 1.0 by doing:
1 / 1.2

Last edited by syncrow : 08-21-16 at 11:01 PM.
  Reply With Quote
08-21-16, 10:58 PM   #3
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 126
That worked perfectly, thanks!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » [Animation] Scale "Pulsing" acting strangely

Thread Tools
Display Modes

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