Cocos2d-x  4.0.0
Public Member Functions | Static Public Member Functions | List of all members
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.
 
virtual LuaCallFuncclone () const override
 Returns a clone of action.
 
virtual void execute () override
 Executes the callback.
 

Static Public Member Functions

static LuaCallFunccreate (const std::function< void(void *self, Node *)> &func)
 Create a LuaCallFunc object by a function pointer for callback.
 
- 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()>.
 
- 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()>.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
- Static Public Attributes inherited from Action
static const int INVALID_TAG = -1
 Default tag used for all the actions.
 
- Protected Member Functions inherited from CallFuncN
bool initWithFunction (const std::function< void(Node *)> &func)
 initializes the action with the std::function<void(Node*)>
 

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.

NA NA

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.

Parameters
funca function pointer for callback.
bool initWithFunction ( const std::function< void(void *self, Node *)> &  func)

Init a LuaCallFunc object by a function pointer for callback.

Parameters
funca function pointer for callback.
virtual LuaCallFunc* clone ( ) const
overridevirtual

Returns a clone of action.

Returns
A clone action.

Reimplemented from CallFuncN.


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