Timer¶
Category: Core
Brief Description¶
A countdown timer.
Member Functions¶
bool | is_stopped ( ) const |
void | start ( ) |
void | stop ( ) |
Member Variables¶
- bool autostart - If
true
, Timer will automatically start when entering the scene tree. Default value:false
. - bool one_shot - If
true
, Timer will stop when reaching 0. Iffalse
, it will restart. Default value:false
. - bool paused - If
true
, the timer is paused and will not process until it is unpaused again, even if start is called. - TimerProcessMode process_mode - Processing mode. Uses TIMER_PROCESS_* constants as value.
- float time_left - The timer’s remaining time in seconds. Returns 0 if the timer is inactive.
- float wait_time - Wait time in seconds.
Enums¶
enum TimerProcessMode
- TIMER_PROCESS_PHYSICS = 0 — Update the Timer during the physics step at each frame (fixed framerate processing).
- TIMER_PROCESS_IDLE = 1 — Update the Timer during the idle time at each frame.
Description¶
Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or “one shot” mode.