View Single Post
12-07-22, 09:42 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Maybe (if the above is the effect you're looking for):
Lua Code:
  1. local duration = 2.0;
  2. local width = 50;
  3.  
  4. local center = CreateFrame("frame", UIParent); -- the red square
  5. center:SetPoint("CENTER", 0, 0)
  6. center:SetSize(2, 2);
  7. local centerTex = center:CreateTexture();
  8. centerTex:SetColorTexture(1, 0, 0, .9);
  9. centerTex:SetAllPoints(center);
  10.  
  11. local frame = CreateFrame("frame", UIParent); -- Host for the AnimationGroup and anchor for the rotating texture
  12. frame:SetSize(1, 1)
  13. frame:SetPoint("CENTER", center, "CENTER", 0, 0)
  14.  
  15. local tex = frame:CreateTexture(); -- Rotation animation (rot0) SetChildKey targets this texture to rotate
  16. frame.tex = tex                       -- through this key
  17. tex:SetColorTexture(0, 1, 0, .2);
  18. --tex:SetAllPoints(frame);
  19. tex:SetSize(width, width * 2)
  20. tex:SetPoint("LEFT", frame, "CENTER")
  21.  
  22. local ag = frame:CreateAnimationGroup();
  23. ag:SetLooping("REPEAT")
  24.  
  25. local rot0 = ag:CreateAnimation("Rotation");
  26. rot0:SetChildKey("tex")
  27. rot0:SetDegrees(360);
  28. rot0:SetDuration(duration);
  29. rot0:SetEndDelay(0);
  30. rot0:SetOrigin("LEFT", 0, 0);
  31. ag:Play();
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-08-22 at 12:56 AM.
  Reply With Quote