![]() |
Lysa
0.0
Lysa 3D Engine
|
One-shot or repeating countdown timer that fires a callback when its wait time elapses.
Lua full name: lysa.Timer
Public Member Functions | |
| nil | start () |
| Starts or restarts the timer. More... | |
| nil | stop () |
| Stops the timer without firing the callback. More... | |
| nil | set_callback (fn: fun()|nil) |
| Sets (or clears with nil) the Lua function invoked on each timeout, replacing any previously set callback. More... | |
Properties | |
| boolean | is_stopped |
| True if the timer is neither running nor waiting to fire. (read-only) | |
| number | wait_time |
| Delay in seconds before the callback fires; takes effect on the next start(). | |
| boolean | one_shot |
| True to stop after the first timeout, false to repeat indefinitely until stop() is called; takes effect on the next start(). | |
|
Starts or restarts the timer.
|
Stops the timer without firing the callback.
|
Sets (or clears with nil) the Lua function invoked on each timeout, replacing any previously set callback.
| fn | fun()|nil |
| boolean is_stopped |
True if the timer is neither running nor waiting to fire. (read-only)
| number wait_time |
Delay in seconds before the callback fires; takes effect on the next start().
| boolean one_shot |
True to stop after the first timeout, false to repeat indefinitely until stop() is called; takes effect on the next start().