kick.core.EventQueue Class
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.
Methods
add
(
Object
-
task
-
timeStart
-
timeEnd=timeStart
Add a event to the event queue. Using timeStart = 0 will make the event run in the next frame.
Parameters:
-
task
Function -
timeStart
NumberNumber of milliseconds from current time
-
timeEnd=timeStart
NumberNumber 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.