CallbacksInvoker Class
The callbacks invoker to handle and invoke callbacks by key.
Index
Methods
hasEventListenerCheck if the specified key has any registered callback.removeAllRemoves all callbacks registered in a certain event type or all callbacks registered with a certain targetoffemitTrigger 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
keyString event typearg1Any First argumentarg2Any Second argumentarg3Any Third argumentarg4Any Fourth argumentarg5Any Fifth argument
Examples
eventTarget.emit('fire', event);
eventTarget.emit('fire', message, emitter);