new useful function, cycleEvent

This commit is contained in:
Eduardo Bart
2012-06-06 17:14:53 -03:00
parent bb1fb939c4
commit 70ea0361b6
6 changed files with 58 additions and 9 deletions

View File

@@ -41,6 +41,13 @@ function addEvent(callback, front)
return event
end
function cycleEvent(callback, front)
local event = g_eventDispatcher.cycleEvent(callback, front)
-- must hold a reference to the callback, otherwise it would be collected
event._callback = callback
return event
end
function periodicalEvent(eventFunc, conditionFunc, delay, autoRepeatDelay)
delay = delay or 30