*book marks post so I can come back and ste... erm I mean utilise the code*
Originally Posted by nightcracker
Pretty elegant IMO:
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 frame.mult < 1 then self.mult = self.mult*-1 end end)
|