Back
./src/timer.lua
Timer
The class which holds all the properties and methods related to Timers
Timer.process(tc)
tcnumber
Number of milliseconds from start
Processes all the timers
Timer.new(id, callback, timeout, loop, ...)
idany
The ID of the timer.
callbackfunction
The function to be called after timeout
timeoutnumber
Number of milliseconds for the mature
loopboolean
Sets the timers looping function. If true runs again after mature.
...any
This is a vararg. These varagrs are used to call the callback
Return Timer
A new timer
Creates a new timer with given properties
Timer:setCallback(func)
funcfunction
The new function
Changes the callback with the new function provided
Timer:addTime(time)
timenumber
Milliseconds to be added
Adds more time for maturing
Timer:setLoop(loop)
loopboolean
The loop status of the timer
Sets the loop status of the timer
Timer:setArgs(...)
...any
Varargs that to be passed to the callback
Passese the new parameter for the callback function
Timer:call()
Calls the timer prematurely or after the mature
Timer:kill()
Kills the timer
Timer:reset()
Resets the timer
Powered by ©MetalEvolutionStudio ©MetalEvolutionStudio