Class cc.CallFunc

Class Summary
Constructor Attributes Constructor Name and Description
 
Calls a 'callback'

Method Summary

Class Detail

cc.CallFunc()
Calls a 'callback'

Field Detail

<static> {cc.CallFunc} cc.CallFunc.create
Please use cc.callFunc instead Creates the action with the callback

Method Detail

  • ctor(selector, selectorTarget, data)
    Creates a CallFunc action with the callback Constructor of cc.CallFunc
    // example
    // CallFunc without data
    var finish = new cc.CallFunc(this.removeSprite, this);
    
    // CallFunc with data
    var finish = new cc.CallFunc(this.removeFromParentAndCleanup, this,  true);
    Parameters:
    {function} selector
    {object|null} selectorTarget Optional
    {*|null} data Optional
    data for function, it accepts all data types.
  • execute()
    execute the function.
  • {object} getTargetCallback()
    Returns:
    {object}
  • {Boolean} initWithFunction(selector, selectorTarget, data)
    Initializes the action with a function or function and its target
    Parameters:
    {function} selector
    {object|Null} selectorTarget
    {*|Null} data Optional
    data for function, it accepts all data types.
    Returns:
    {Boolean}
  • setTargetCallback(sel)
    Parameters:
    {object} sel
  • update(time)
    Parameters:
    {Number} time