Lua support for cocos2d-x. More...
#include <CCLuaEngine.h>
Public Member Functions | |
virtual | ~CCLuaEngine (void) |
virtual ccScriptType | getScriptType () |
Get script type. More... | |
CCLuaStack * | getLuaStack (void) |
virtual void | addSearchPath (const char *path) |
Add a path to find lua files in. More... | |
virtual void | addLuaLoader (lua_CFunction func) |
Add lua loader, now it is used on android. More... | |
virtual void | removeScriptObjectByCCObject (CCObject *pObj) |
Remove CCObject from lua state. More... | |
virtual void | removeScriptHandler (int nHandler) |
Remove Lua function reference. More... | |
virtual int | reallocateScriptHandler (int nHandler) |
Reallocate Lua function reference. More... | |
virtual int | executeString (const char *codes) |
Execute script code contained in the given string. More... | |
virtual int | executeScriptFile (const char *filename) |
Execute a script file. More... | |
virtual int | executeGlobalFunction (const char *functionName) |
Execute a scripted global function. More... | |
virtual int | executeNodeEvent (CCNode *pNode, int nAction) |
Execute a node event function. More... | |
virtual int | executeMenuItemEvent (CCMenuItem *pMenuItem) |
virtual int | executeNotificationEvent (CCNotificationCenter *pNotificationCenter, const char *pszName) |
Execute a notification event function. More... | |
virtual int | executeCallFuncActionEvent (CCCallFunc *pAction, CCObject *pTarget=NULL) |
execute a callfun event More... | |
virtual int | executeSchedule (int nHandler, float dt, CCNode *pNode=NULL) |
execute a schedule function More... | |
virtual int | executeLayerTouchesEvent (CCLayer *pLayer, int eventType, CCSet *pTouches) |
functions for executing touch event More... | |
virtual int | executeLayerTouchEvent (CCLayer *pLayer, int eventType, CCTouch *pTouch) |
virtual int | executeLayerKeypadEvent (CCLayer *pLayer, int eventType) |
functions for keypad event More... | |
virtual int | executeAccelerometerEvent (CCLayer *pLayer, CCAcceleration *pAccelerationValue) |
execute a accelerometer event More... | |
virtual int | executeEvent (int nHandler, const char *pEventName, CCObject *pEventSource=NULL, const char *pEventSourceClassName=NULL) |
function for common event More... | |
int | executeTableViewEvent (int nEventType, cocos2d::extension::CCTableView *pTableView, void *pValue=NULL, CCArray *pResultArray=NULL) |
virtual int | executeEventWithArgs (int nHandler, CCArray *pArgs) |
function for c++ call back lua funtion More... | |
virtual bool | handleAssert (const char *msg) |
called by CCAssert to allow scripting engine to handle failed assertions More... | |
![]() | |
virtual | ~CCScriptEngineProtocol () |
Static Public Member Functions | |
static CCLuaEngine * | defaultEngine (void) |
Lua support for cocos2d-x.
|
virtual |
|
virtual |
Add lua loader, now it is used on android.
|
virtual |
Add a path to find lua files in.
path | to be added to the Lua path |
|
static |
|
virtual |
execute a accelerometer event
Implements CCScriptEngineProtocol.
|
virtual |
execute a callfun event
Implements CCScriptEngineProtocol.
|
virtual |
function for common event
Implements CCScriptEngineProtocol.
|
virtual |
function for c++ call back lua funtion
Reimplemented from CCScriptEngineProtocol.
|
virtual |
Execute a scripted global function.
The function should not take any parameters and should return an integer.
functionName | String object holding the name of the function, in the global script environment, that is to be executed. |
Implements CCScriptEngineProtocol.
|
virtual |
functions for keypad event
Implements CCScriptEngineProtocol.
functions for executing touch event
Implements CCScriptEngineProtocol.
Implements CCScriptEngineProtocol.
|
virtual |
Implements CCScriptEngineProtocol.
|
virtual |
Execute a node event function.
pNode | which node produce this event |
nAction | kCCNodeOnEnter,kCCNodeOnExit,kCCMenuItemActivated,kCCNodeOnEnterTransitionDidFinish,kCCNodeOnExitTransitionDidStart |
Implements CCScriptEngineProtocol.
|
virtual |
Execute a notification event function.
Implements CCScriptEngineProtocol.
execute a schedule function
Implements CCScriptEngineProtocol.
|
virtual |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed |
Implements CCScriptEngineProtocol.
|
virtual |
Execute script code contained in the given string.
codes | holding the valid script code that should be executed. |
Implements CCScriptEngineProtocol.
int executeTableViewEvent | ( | int | nEventType, |
cocos2d::extension::CCTableView * | pTableView, | ||
void * | pValue = NULL , |
||
CCArray * | pResultArray = NULL |
||
) |
|
inline |
|
inlinevirtual |
Get script type.
Reimplemented from CCScriptEngineProtocol.
|
virtual |
called by CCAssert to allow scripting engine to handle failed assertions
Implements CCScriptEngineProtocol.
|
virtual |
Reallocate Lua function reference.
Reimplemented from CCScriptEngineProtocol.
|
virtual |
Remove Lua function reference.
Reimplemented from CCScriptEngineProtocol.
|
virtual |