Quantcast WoWInterface - View Single Post - "Pulsating" effect...what's the proper method?
View Single Post
01-26-10, 04:28 PM   #11
A Molten Giant
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by Amenity View Post
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.


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

Last edited by nightcracker : 02-06-10 at 08:32 AM.
  Reply With Quote