Class: timer

rat. timer

new timer(func, delay, param2)

A timer that calls the function at the specified delay.
Parameters:
Name Type Description
func function the function to call. The first argument is the timer that went off. The second is param2 provided here.
delay number when, from now, will the function be called.
param2 ? the second parameter of the function to call.
Source:

Methods

autoUpdate()

Sets the timer to automatically update. These timers are not guaranteed to update in any order.
Source:

callNow()

Sets off the timer now to run the function.
Source:

endAutoUpdate()

Sets the timer to stop automatically updating. (marks dead - will get removed from autoupdate list when that list is next processed) It's OK to call this from within the timer's update function.
Source:

setPause(pause)

Sets if the timer is paused.
Parameters:
Name Type Description
pause boolean
Source:

setRepeat(repeat)

Sets if the timer should repeate.
Parameters:
Name Type Description
repeat boolean
Source:

update(deltaTime)

Updates the timer's time.
Parameters:
Name Type Description
deltaTime number
Source: