View Single Post
03-02-22, 05:07 AM   #3
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 123
Magnificent, isn't?

Lua Code:
  1. local f = CreateFrame('Button', 'MyButtonName', UIParent)
  2. f:SetPoint('CENTER')
  3. f:SetSize(128, 128)
  4.  
  5. local tex = f:CreateTexture(nil, "BACKGROUND")
  6. tex:SetAllPoints()
  7. tex:SetTexture(1, 1, 1, 0.5)
  8.  
  9. f.flasher = f:CreateAnimationGroup()
  10.  
  11.  
  12. f.flasher.opacity = -0.5
  13.  
  14. f.flasher:SetLooping("BOUNCE")
  15.  
  16. f.flasher:SetScript(
  17.     "OnFinished",
  18.     function(self, requested)
  19.         if requested then
  20.             self:Hide()
  21.         end
  22.     end
  23. )
  24.  
  25. f.flasher:SetScript(
  26.     "OnLoop",
  27.     function()
  28.         f.flasher.opacity = (f.flasher.opacity == -0.5) and 0.5 or -0.5
  29.     end
  30. )
  31.  
  32. local fade = f.flasher:CreateAnimation("Alpha")
  33. fade:SetDuration(0.5)
  34. fade:SetChange(f.flasher.opacity)
  35. fade:SetOrder(1)
  36.  
  37. f.flasher:Play()

Last edited by Benalish : 03-02-22 at 10:48 AM.
  Reply With Quote