Originally Posted by Amenity
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:
local speed = 1
frame.mult = 1
frame.alpha = 1
frame:SetScript("OnUpdate", function(self, elapsed)
elapsed = elapsed*(1/speed)
self:SetAlpha(self.alpha)
self.alpha = self.alpha - elapsed*self.mult
if self.alpha < 0 and self.mult > 0 then
self.mult = self.mult*-1
self.alpha = 0
elseif self.alpha > 1 and frame.mult < 1 then
self.mult = self.mult*-1
end
end)