Class: TimerDispatcher

Grape2D.utils. TimerDispatcher

new TimerDispatcher()

Timer class. This is not handling double calls or more for long intervals.
Source:

Members

<static, constant> HOUR :number

Constant that represents an hour.
Type:
  • number
Source:

<static, constant> MINUTE :number

Constant that represents a minute.
Type:
  • number
Source:

<static, constant> SECOND :number

Constant that represents a second.
Type:
  • number
Source:

<private> tm :!Array.<Object.<!string, !(number|Function|boolean)>>

Internal representation of the callbacks and internal timers.
Type:
  • !Array.<Object.<!string, !(number|Function|boolean)>>
Source:

Methods

add(interv, callback, remove)

Adds.
Parameters:
Name Type Argument Description
interv number Time interval between calls, in milliseconds.
callback Function Function to be called after the interval has run out.
remove boolean <optional>
True to remove after it has been called one time.
Source:

dispatch(dt)

Dispatches the calls if its time for it, or updates the internal timers, preparing for the next update.
Parameters:
Name Type Description
dt number Delta time, since the last dispatch call.
Source: