Class cc.CallFunc
- Defined in: CCActionInstant.js
- Extends cc.ActionInstant
Constructor Attributes | Constructor Name and Description |
---|---|
cc.CallFunc(selector, selectorTarget, data)
Calls a 'callback'.
|
Method Summary
Class Detail
cc.CallFunc(selector, selectorTarget, data)
Calls a 'callback'.
// 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.
Field Detail
Please use cc.callFunc instead.
Creates the action with the callback.
- Deprecated:
-
since v3.0
Please use cc.callFunc instead.
Method Detail
-
{cc.CallFunc} clone()to copy object with deep copy. returns a clone of action.
- Returns:
- {cc.CallFunc}
-
ctor(selector, selectorTarget, data)Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
Creates a CallFunc action with the callback.- Parameters:
- {function} selector
- {object|null} selectorTarget Optional
- {*|null} data Optional
- data for function, it accepts all data types.
-
execute()execute the function.
-
{object} getTargetCallback()Get selectorTarget.
- 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)Set selectorTarget.
- Parameters:
- {object} sel
-
update(dt)Called once per frame. Time is the number of seconds of a frame interval.
- Parameters:
- {Number} dt