Class cc.CallFunc

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

Method Summary

Class Detail

cc.CallFunc()
Calls a 'callback'

Method Detail

  • <static> {cc.CallFunc} cc.CallFunc.create(selector, selectorTarget, data)
    creates the action with the callback
    // example
    // CallFunc without data
    var finish = cc.CallFunc.create(this.removeSprite, this);
    
    // CallFunc with data
    var finish = cc.CallFunc.create(this.removeFromParentAndCleanup, this._grossini,  true),
    Parameters:
    {function} selector
    {object|null} selectorTarget Optional
    {*|Null} data Optional
    data for function, it accepts all data types.
    Returns:
    {cc.CallFunc}
  • execute()
    execute the function.
  • {object} getTargetCallback()
    Returns:
    {object}
  • {boolean} initWithFunction(func)
    initializes the action with the std::function
    Parameters:
    {function} func
    Returns:
    {boolean}
  • {Boolean} initWithTarget(selector, selectorTarget, data)
    Parameters:
    {function|Null} selector
    {object} selectorTarget
    {*|Null} data
    data for function, it accepts all data types.
    Returns:
    {Boolean}
  • setTargetCallback(sel)
    Parameters:
    {object} sel
  • update(time)
    Parameters:
    {Number} time