Cocos Creator API

1.3.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

CallbacksInvoker

: cc

The callbacks invoker to handle and invoke callbacks by key.

invoke
(
  • key
  • [p1 ]
  • [p2 ]
  • [p3 ]
  • [p4 ]
  • [p5 ]
)

key String
p1 optional Any
p2 optional Any
p3 optional Any
p4 optional Any
p5 optional Any

invokeAndRemove
(
  • key
  • [p1 ]
  • [p2 ]
  • [p3 ]
  • [p4 ]
  • [p5 ]
)

key String
p1 optional Any
p2 optional Any
p3 optional Any
p4 optional Any
p5 optional Any

bindKey
(
  • key
  • [remove =false]
)
Function

key String
remove optional Boolean false

remove callbacks after invoked

:

: Function

the new callback which will invoke all the callbacks binded with the same supplied key

add
(
  • key
  • callback
  • [target ]
)
Boolean

key String
callback Function
target optional Object

can be null

:

: Boolean

whether the key is new

has
(
  • key
  • [callback ]
  • [target ]
)
Boolean

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.

key String
callback optional Function
target optional Object

:

removeAll
(
  • key
)

Removes all callbacks registered in a certain event type or all callbacks registered with a certain target

key String | Object

The event key to be removed or the target to be removed

remove
(
  • key
  • callback
  • target
)
Boolean

key String
callback Function
target Object

:

: Boolean

removed

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index