View Single Post
01-26-10, 03:55 PM   #9
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by Amenity View Post
Wow guys...thank you for the quick responses! Working perfectly now.

(Also bookmarking as a reference page)
If this is going to be a reference, then I'll add something new, a variable to determine speed of the pulse in seconds(don't set it to 0, dividing by 0 FTW):

lua Code:
  1. local speed = 1
  2. frame.mult = 1
  3. frame.alpha = 1
  4. frame:SetScript("OnUpdate", function(self, elapsed)
  5.     elapsed = elapsed*(1/speed)
  6.     self:SetAlpha(self.alpha)
  7.     self.alpha = self.alpha - elapsed*self.mult
  8.     if self.alpha < 0 and self.mult > 0 then
  9.         self.mult = self.mult*-1
  10.         self.alpha = 0
  11.     elseif self.alpha > 1 and frame.mult < 1 then
  12.         self.mult = self.mult*-1
  13.     end
  14. end)
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote