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

The LuaCallFunc is wrapped to call the callback function in the Lua conveniently and don't insert useless code to processing the Lua in the CallFuncN. More...

Inherits CallFuncN.

Public Member Functions

 LuaCallFunc ()
 Default constructor.
 
virtual ~LuaCallFunc ()
 Destructor.
 
bool initWithFunction (const std::function< void(void *self, Node *)> &func)
 Init a LuaCallFunc object by a function pointer for callback. More...
 
virtual void execute () override
 Executes the callback.
 
- Public Member Functions inherited from CallFunc
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 LuaCallFunccreate (const std::function< void(void *self, Node *)> &func)
 Create a LuaCallFunc object by a function pointer for callback. More...
 
- Static Public Member Functions inherited from CallFuncN
static CallFuncNcreate (const std::function< void(Node *)> &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 CallFuncNcreate (Ref *target, SEL_CallFuncN selector)
 Creates the action with the callback. More...
 
local create ( local target, local selector)
 Creates the action with the callback. More...
 
- Static Public Member Functions inherited from CallFunc
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.
 

Additional Inherited Members

- Protected Member Functions inherited from CallFuncN
bool initWithFunction (const std::function< void(Node *)> &func)
 initializes the action with the std::function<void(Node*)>
 
local initWithFunction ( local func)
 initializes the action with the std::function<void(Node*)>
 
bool initWithTarget (Ref *target, SEL_CallFuncN selector)
 initializes the action with the callback typedef void (Ref::SEL_CallFuncN)(Node);
 
- Protected Member Functions inherited from CallFunc
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

The LuaCallFunc is wrapped to call the callback function in the Lua conveniently and don't insert useless code to processing the Lua in the CallFuncN.

Member Function Documentation

static LuaCallFunc* create ( const std::function< void(void *self, Node *)> &  func)
static

Create a LuaCallFunc object by a function pointer for callback.

a function pointer for callback.

bool initWithFunction ( const std::function< void(void *self, Node *)> &  func)

Init a LuaCallFunc object by a function pointer for callback.

a function pointer for callback.


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