API Docs for: 0.5.5
Show:

kick.core.EventQueue Class

Module: kick.core

Event queue let you schedule future events in the game engine. Events are invoked just before the Component.update() methods.
An event can run for either a single frame or for multiple frames.

Item Index

Methods

Methods

add

(
  • task
  • timeStart
  • timeEnd=timeStart
)
Object

Add a event to the event queue. Using timeStart = 0 will make the event run in the next frame.

Parameters:

  • task Function
  • timeStart Number

    Number of milliseconds from current time

  • timeEnd=timeStart Number

    Number of milliseconds from current time

Returns:

Object:

event object (used for 'cancel' event)

cancel

(
  • eventObject
)

Removes an event object from the queue.

Parameters:

  • eventObject Object

    (should be the object returned from the EventQueue.add method

clear

()

Clears the queue

run

() protected

Run the event queue. This method is invoked by the Engine object just before the components are updated.