springroll.DelayedCall Class

Module: Core

A class for delaying a call through the Application, instead of relying on setInterval() or setTimeout().

Constructor

springroll.DelayedCall

(
  • callback
  • delay
  • [options=false]
  • [autoDestroy=true]
  • [useFrames=false]
)

Parameters:

  • callback Function

    The function to call when the delay has completed.

  • delay Int

    The time to delay the call, in milliseconds (or optionally frames).

  • [options=false] Object | Boolean optional

    The options to use or repeat value

    • [repeat=false] Boolean optional

      If the DelayedCall should automatically repeat itself when completed.

    • [autoDestroy=true] Boolean optional

      If the DelayedCall should clean itself up when completed.

    • [useFrames=false] Boolean optional

      If the DelayedCall should use frames instead of milliseconds for the delay.

  • [autoDestroy=true] Boolean optional

    If the DelayedCall should clean itself up when completed.

  • [useFrames=false] Boolean optional

    If the DelayedCall should use frames instead of milliseconds for the delay.

_update

(
  • elapsed
)
private

Defined in _update:116

The callback supplied to the Application for an update each frame.

Parameters:

  • elapsed Int

    The time elapsed since the previous frame.

destroy

()
public

Defined in destroy:201

Stops and cleans up the DelayedCall. Do not use it after calling destroy().

restart

()
public

Defined in restart:143

Restarts the DelayedCall, whether it is running or not.

stop

()
public

Defined in stop:158

Stops the DelayedCall, without destroying it.

_autoDestroy

Boolean private

Defined in _autoDestroy:84

If the DelayedCall should destroy itself after completing

Default: true

_callback

Function private

Defined in _callback:55

The function to call when the delay is completed.

_delay

Int private

Defined in _delay:62

The delay time, in milliseconds.

_paused

Boolean private

Defined in _paused:100

If the DelayedCall is currently paused (not stopped).

_repeat

Boolean private

Defined in _repeat:76

If the DelayedCall should repeat itself automatically.

Default: false

_timer

Int private

Defined in _timer:69

The timer counting down from _delay, in milliseconds.

_useFrames

Boolean private

Defined in _useFrames:92

If the DelayedCall should use frames instead of milliseconds for the delay.

Default: false

paused

Boolean public

Defined in paused:169

If the DelayedCall is paused or not.