Cocos2d-x  v3.12
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
CallFunc Class Reference

Calls a 'callback'. More...

Inherits ActionInstant.

Inherited by __CCCallFuncND, __CCCallFuncO, and CallFuncN.

Public Member Functions

virtual void execute ()
 Executes the callback.
 
local execute ()
 Executes the callback.
 
RefgetTargetCallback ()
 Get the selector target. More...
 
local getTargetCallback ()
 Get the selector target. More...
 
void setTargetCallback (Ref *sel)
 Set the selector target. More...
 
local setTargetCallback ( local sel)
 Set the selector target. More...
 

Static Public Member Functions

static CallFunccreate (const std::function< void()> &func)
 Creates the action with the callback of type std::function<void()>. More...
 
local create ( local func)
 Creates the action with the callback of type std::function<void()>. More...
 
static CallFunccreate (Ref *target, SEL_CallFunc selector)
 Creates the action with the callback typedef void (Ref::*SEL_CallFunc)(); Use the std::function API instead.
 

Protected Member Functions

bool initWithTarget (Ref *target)
 Initializes the action with the callback typedef void (Ref::*SEL_CallFunc)();.
 
var initWithTarget ( var target)
 Initializes the action with the callback typedef void (Ref::*SEL_CallFunc)();.
 
local initWithTarget ( local target)
 Initializes the action with the callback typedef void (Ref::*SEL_CallFunc)();.
 
bool initWithFunction (const std::function< void()> &func)
 initializes the action with the std::function<void()>
 
var initWithFunction ( var func)
 initializes the action with the std::function<void()>
 

Detailed Description

Calls a 'callback'.

Member Function Documentation

static CallFunc* create ( const std::function< void()> &  func)
static

Creates the action with the callback of type std::function<void()>.

This is the preferred way to create the callback. When this function bound in js or lua ,the input param will be changed. In lua:local create(local funcID).

A callback function need to be executed. An autoreleased CallFunc object.

var create ( var  func)
static

Creates the action with the callback of type std::function<void()>.

This is the preferred way to create the callback. When this function bound in js or lua ,the input param will be changed. In lua:local create(local funcID).

A callback function need to be executed. An autoreleased CallFunc object.

local create ( local  func)
static

Creates the action with the callback of type std::function<void()>.

This is the preferred way to create the callback. When this function bound in js or lua ,the input param will be changed. In lua:local create(local funcID).

A callback function need to be executed. An autoreleased CallFunc object.

Ref* getTargetCallback ( )
inline

Get the selector target.

The selector target.

var getTargetCallback ( )
inline

Get the selector target.

The selector target.

local getTargetCallback ( )
inline

Get the selector target.

The selector target.

void setTargetCallback ( Ref sel)
inline

Set the selector target.

The selector target.

var setTargetCallback ( var  sel)
inline

Set the selector target.

The selector target.

local setTargetCallback ( local  sel)
inline

Set the selector target.

The selector target.


The documentation for this class was generated from the following file: