Originally Posted by Amenity
Just as a quick test, I set it to pulse my Minimap (lulz) and it's using so little CPU time that it could simply just be an error. By comparison, the tool I used to measure this used 24 times as much CPU time as the pulse addon.
Hm, I'll have to give that a go. In the previous incarnation, I was just adjusting the value of frame.mult to adjust the speed.
|
Woops, I actually made a mistake in the script, and you are right, it should be enough to change frame.mult.
FINAL VERSION(I hope):
lua Code:
frame.mult = 1
frame.alpha = 1
frame:SetScript("OnUpdate", function(self, elapsed)
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 self.mult < 0 then
self.mult = self.mult*-1
end
end)