c3d.event
The event module is mainly used internally for sharing data across the engine. It is similiar to CCs event system.
clear() | clears the event queue |
---|---|
poll() | returns an iterator function to iterate everything in the event queue |
push(...) | adds an event to the queue |
quit(status) | triggers the quit event with the given status code |
wait() | returns event from the queue, if there isnt one it waits for one |
add_listener(filter, f [, name [, debug]]) | Makes a new event listener with a custom filter |
event_listener | methods for the event listener object |
- clear()Source
clears the event queue
- poll()Source
returns an iterator function to iterate everything in the event queue
Returns
- function event queue iterator function
- push(...)Source
adds an event to the queue
Parameters
- ... the event data
- quit(status)Source
triggers the quit event with the given status code
Parameters
- status number the exist code to trigger the event with
- wait()Source
returns event from the queue, if there isnt one it waits for one
Returns
- ... caught events data
- add_listener(filter, f [, name [, debug]])Source
Makes a new event listener with a custom filter
Parameters
- filter the filter used for this event listener, may be a string or a table of event names.
- f function function triggered by the event_listener
- name? string allows you to select a custom name for the listener
- debug? boolean enables a bunch of logs that might be useful
Returns
- C3D.EVENT_LISTENER bunch of useful functions you can use to pause/kill/revive and manipulate this listener
- event_listenerSource
methods for the event listener object
kill() kills the current event listener pause() pauses the currently running event listener resume() resumes the currently paused event listener