API Documentation for: 1.1.23
Show:

DelayedCall Class

Defined in: DelayedCall:10
Namespace: cloudkid

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

Constructor

DelayedCall

(
  • callback
  • delay
  • repeat=false
  • autoDestroy=true
)

Defined in DelayedCall:10

Parameters:

  • callback Function

    The function to call when the delay has completed.

  • delay Int

    The time to delay the call, in milliseconds.

  • repeat=false Boolean

    If the DelayedCall should automatically repeat itself when completed.

  • autoDestroy=true Boolean

    If the DelayedCall should clean itself up when completed.

Methods

_update

(
  • elapsed
)
private

Defined in _update:75

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

Parameters:

  • elapsed Int

    The time elapsed since the previous frame.

destroy

() public

Defined in destroy:156

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

restart

() public

Defined in restart:102

Restarts the DelayedCall, whether it is running or not.

stop

() public

Defined in stop:117

Stops the DelayedCall, without destroying it.

Properties

_autoDestroy

Boolean private

Defined in _autoDestroy:47

If the DelayedCall should destroy itself after completing

Default: true

_callback

Function private

Defined in _callback:22

The function to call when the delay is completed.

_delay

Int private

Defined in _delay:28

The delay time, in milliseconds.

_paused

Boolean private

Defined in _paused:60

If the DelayedCall is currently paused (not stopped).

_repeat

Boolean private

Defined in _repeat:40

If the DelayedCall should repeat itself automatically.

Default: false

_timer

Int private

Defined in _timer:34

The timer counting down from _delay, in milliseconds.

_updateId

String private

Defined in _updateId:54

The unique ID used for the update callback for the OS.

paused

Boolean public

Defined in paused:128

If the DelayedCall is paused or not.