Class

RezTimer

RezTimer()

Constructor

# new RezTimer()

Represents a timer in the Rez game engine. Timers can be configured to run once or repeatedly, with optional count-down functionality. When triggered, they dispatch timer events through the game's event processor.

View Source rez_timer.js, line 1

Extends

Methods

# static constructor(id, attributes)

Creates a new timer instance with the specified configuration

Parameters:
Name Type Description
id string

unique identifier for this timer

attributes object

timer attributes from Rez compilation

View Source rez_timer.js, line 11

# static dec_counter()

Decrements the timer's count attribute if present. When count reaches zero, the timer automatically stops itself.

View Source rez_timer.js, line 47

# static notify()

Called when the timer fires. Decrements the count (if present) and dispatches a timer event through the game's event processor.

View Source rez_timer.js, line 63

# static running() → {boolean}

Indicates whether the timer is currently running and will trigger events

View Source rez_timer.js, line 22

true if the timer is currently active

boolean

# static start()

Starts the timer using either setInterval (for repeating timers) or setTimeout (for one-shot timers). The timer will trigger the notify method when it fires.

View Source rez_timer.js, line 32

# static stop()

Stops the timer by clearing the timeout/interval and resetting the internal timer reference

View Source rez_timer.js, line 75