Originally Posted by nightcracker
What I say now I assuming you meant this:
Code:
do
local last_update = 0
local updater = CreateFrame("Frame", nil, UIParent)
updater:Hide()
updater:SetScript("OnUpdate",
function(self, elapsed)
last_update = last_update + .25
if last_update <= -.25 then
RunSinFunction()
last_update = 0
end
end)
end
Then that is equal to this:
Code:
do
local start = 0
local updater = CreateFrame("Frame", nil, UIParent)
updater:Hide()
updater:SetScript("OnUpdate", function(self, elapsed)
start = start + .25
SomeFrame:SetAlpha(math.sin(start))
end)
end
Which means that the speed of the pulsing is determined by your FPS, not the amount of fluentness(is that a word?).
|
nah
i meant this :
Code:
do
local last_update = 0
local updater = CreateFrame("Frame", nil, UIParent)
updater:Hide()
updater:SetScript("OnUpdate",
function(self, elapsed)
last_update = last_update + elapsed
if last_update >= 0.25 then
RunSinFunction()
last_update = last_update-0.25
end
end)
end
Originally Posted by Torhal
This is true, if you're looking to be precise.
|
well it's a sinus function - where little differences may cause weird results or atleast not nice looking ones