Timer

A countdown timer.

Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one shot" mode.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
TimerProcessMode
enum TimerProcessMode

Functions

getTimeLeft
double getTimeLeft()
getTimerProcessMode
Timer.TimerProcessMode getTimerProcessMode()
getWaitTime
double getWaitTime()
hasAutostart
bool hasAutostart()
isOneShot
bool isOneShot()
isPaused
bool isPaused()
isStopped
bool isStopped()

Returns true if the timer is stopped.

opAssign
Timer opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Timer other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setAutostart
void setAutostart(bool enable)
setOneShot
void setOneShot(bool enable)
setPaused
void setPaused(bool paused)
setTimerProcessMode
void setTimerProcessMode(long mode)
setWaitTime
void setWaitTime(double time_sec)
start
void start(double time_sec)

Starts the timer. Sets wait_time to time_sec if time_sec > 0. This also resets the remaining time to wait_time. Note: this method will not resume a paused timer. See setPaused.

stop
void stop()

Stops the timer.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

autostart
bool autostart [@property getter]
bool autostart [@property setter]

If true the timer will automatically start when entering the scene tree. Default value: false.

oneShot
bool oneShot [@property getter]
bool oneShot [@property setter]

If true the timer will stop when reaching 0. If false it will restart. Default value: false.

paused
bool paused [@property getter]
bool paused [@property setter]

If true the timer is paused and will not process until it is unpaused again, even if start is called.

processMode
Timer.TimerProcessMode processMode [@property getter]
long processMode [@property setter]

Processing mode. See timerprocessmode.

timeLeft
double timeLeft [@property getter]

The timer's remaining time in seconds. Returns 0 if the timer is inactive. Note: You cannot set this value. To change the timer's remaining time, use waitTime.

waitTime
double waitTime [@property getter]
double waitTime [@property setter]

Wait time in seconds.

Static functions

_new
Timer _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta