![]() |
Lysa.nodes
0.0
Lysa 3D Engine
|
A countdown timer node that fires a TIMEOUT event when it expires.
Inherits from: Node
Lua full name: lysa.nodes.Timer
Public Member Functions | |
| Timer | create (wait_time: number|nil, one_shot: boolean|nil)static |
| Creates a Timer node with an optional duration and one-shot flag. More... | |
| nil | start (time_sec: number|nil) |
| Starts or restarts the timer. If time_sec > 0 it overrides wait_time for this run. More... | |
| nil | stop () |
| Stops the timer without firing the TIMEOUT event. More... | |
Properties | |
| boolean | is_stopped |
| True if the timer is not currently running. (read-only) | |
| number | time_left |
| Remaining time in seconds; 0 if the timer is stopped. (read-only) | |
| number | wait_time |
| Total countdown duration in seconds (default 1.0). | |
| boolean | one_shot |
| If true the timer stops automatically after the first TIMEOUT; otherwise it loops. | |
| boolean | autostart |
| If true the timer starts automatically when the node enters the scene tree. | |
| boolean | paused |
| Pauses or resumes the countdown without resetting the remaining time. | |
|
static |
Creates a Timer node with an optional duration and one-shot flag.
| wait_time | number|nil |
| one_shot | boolean|nil |
|
Starts or restarts the timer. If time_sec > 0 it overrides wait_time for this run.
| time_sec | number|nil |
|
Stops the timer without firing the TIMEOUT event.
| boolean is_stopped |
True if the timer is not currently running. (read-only)
| number time_left |
Remaining time in seconds; 0 if the timer is stopped. (read-only)
| number wait_time |
Total countdown duration in seconds (default 1.0).
| boolean one_shot |
If true the timer stops automatically after the first TIMEOUT; otherwise it loops.
| boolean autostart |
If true the timer starts automatically when the node enters the scene tree.
| boolean paused |
Pauses or resumes the countdown without resetting the remaining time.