CallbacksInvoker
Class
The callbacks invoker to handle and invoke callbacks by key.
Index
Methods
hasEventListener
Check if the specified key has any registered callback.removeAll
Removes all callbacks registered in a certain event type or all callbacks registered with a certain targetoff
emit
Trigger an event directly with the event name and necessary arguments.
Details
Methods
hasEventListener
Check if the specified key has any registered callback. If a callback is also specified, it will only return true if the callback is registered.
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/core/platform/callbacks-invoker.js:188 |
Parameters
removeAll
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
meta | description |
---|---|
Defined in | cocos2d/core/platform/callbacks-invoker.js:235 |
Parameters
off
meta | description |
---|---|
Defined in | cocos2d/core/platform/callbacks-invoker.js:279 |
Parameters
emit
Trigger an event directly with the event name and necessary arguments.
meta | description |
---|---|
Defined in | cocos2d/core/platform/callbacks-invoker.js:309 |
Parameters
key
String event typearg1
Any First argumentarg2
Any Second argumentarg3
Any Third argumentarg4
Any Fourth argumentarg5
Any Fifth argument
Examples
eventTarget.emit('fire', event);
eventTarget.emit('fire', message, emitter);