#include <CCLuaEngine.h>
Public Member Functions | |
virtual | ~LuaEngine (void) |
virtual ccScriptType | getScriptType () |
Get script type. More... | |
LuaStack * | getLuaStack (void) |
virtual void | addSearchPath (const char *path) |
Add a path to find lua files in. More... | |
local | addSearchPath ( local 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... | |
local | addLuaLoader ( local func) |
Add lua loader, now it is used on android. More... | |
virtual void | removeScriptObjectByObject (Object *object) |
Remove Object from lua state. More... | |
virtual void | removeScriptHandler (int nHandler) |
Remove Lua function reference. More... | |
local | removeScriptHandler ( local 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... | |
local | executeScriptFile ( local filename) |
Execute a script file. More... | |
virtual int | executeGlobalFunction (const char *functionName) |
Execute a scripted global function. More... | |
local | executeGlobalFunction ( local functionName) |
Execute a scripted global function. More... | |
virtual int | executeNodeEvent (Node *pNode, int nAction) |
virtual int | executeMenuItemEvent (MenuItem *pMenuItem) |
virtual int | executeNotificationEvent (NotificationCenter *pNotificationCenter, const char *pszName) |
local | executeNotificationEvent ( local pNotificationCenter, local pszName) |
virtual int | executeCallFuncActionEvent (CallFunc *pAction, Object *pTarget=NULL) |
virtual int | executeSchedule (int nHandler, float dt, Node *pNode=NULL) |
local | executeSchedule ( local nHandler, local dt, local NULL) |
virtual int | executeLayerTouchesEvent (Layer *pLayer, int eventType, Set *pTouches) |
virtual int | executeLayerTouchEvent (Layer *pLayer, int eventType, Touch *pTouch) |
virtual int | executeLayerKeypadEvent (Layer *pLayer, int eventType) |
virtual int | executeAccelerometerEvent (Layer *pLayer, Acceleration *pAccelerationValue) |
execute a accelerometer event More... | |
virtual int | executeEvent (int nHandler, const char *pEventName, Object *pEventSource=NULL, const char *pEventSourceClassName=NULL) |
virtual bool | handleAssert (const char *msg) |
called by CCAssert to allow scripting engine to handle failed assertions More... | |
virtual bool | parseConfig (ConfigType type, const std::string &str) override |
Parse configuration file. More... | |
local | parseConfig ( local type, local str) |
Parse configuration file. More... | |
virtual int | sendEvent (ScriptEvent *message) override |
when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua More... | |
local | sendEvent ( local message) |
when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua More... | |
virtual int | handleEvent (ScriptHandlerMgr::HandlerType type, void *data) |
local | handleEvent ( local type, local data) |
virtual int | handleEvent (ScriptHandlerMgr::HandlerType type, void *data, int numResults, const std::function< void(lua_State *, int)> &func) |
local | handleEvent ( local type, local data, local numResults, local func) |
Public Member Functions inherited from ScriptEngineProtocol | |
virtual | ~ScriptEngineProtocol () |
Static Public Member Functions | |
static LuaEngine * | getInstance (void) |
local | getInstance () |
static CC_DEPRECATED_ATTRIBUTE LuaEngine * | defaultEngine (void) |
local | defaultEngine () |
Additional Inherited Members | |
Public Types inherited from ScriptEngineProtocol | |
enum | ConfigType { NONE, COCOSTUDIO } |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Add lua loader, now it is used on android.
|
virtual |
Add lua loader, now it is used on android.
|
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 |
|
virtual |
Add a path to find lua files in.
path | to be added to the Lua path |
|
virtual |
Add a path to find lua files in.
path | to be added to the Lua path |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
virtual |
execute a accelerometer event
|
virtual |
execute a accelerometer event
|
virtual |
execute a accelerometer event
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
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 ScriptEngineProtocol.
|
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 ScriptEngineProtocol.
|
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 ScriptEngineProtocol.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed |
Implements ScriptEngineProtocol.
|
virtual |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed |
Implements ScriptEngineProtocol.
|
virtual |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed |
Implements ScriptEngineProtocol.
|
virtual |
Execute script code contained in the given string.
codes | holding the valid script code that should be executed. |
Implements ScriptEngineProtocol.
|
virtual |
Execute script code contained in the given string.
codes | holding the valid script code that should be executed. |
Implements ScriptEngineProtocol.
|
virtual |
Execute script code contained in the given string.
codes | holding the valid script code that should be executed. |
Implements ScriptEngineProtocol.
|
static |
|
static |
|
static |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Get script type.
Reimplemented from ScriptEngineProtocol.
|
inlinevirtual |
Get script type.
Reimplemented from ScriptEngineProtocol.
|
inlinevirtual |
Get script type.
Reimplemented from ScriptEngineProtocol.
|
virtual |
called by CCAssert to allow scripting engine to handle failed assertions
Implements ScriptEngineProtocol.
|
virtual |
called by CCAssert to allow scripting engine to handle failed assertions
Implements ScriptEngineProtocol.
|
virtual |
called by CCAssert to allow scripting engine to handle failed assertions
Implements ScriptEngineProtocol.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
Parse configuration file.
Implements ScriptEngineProtocol.
|
overridevirtual |
Parse configuration file.
Implements ScriptEngineProtocol.
|
overridevirtual |
Parse configuration file.
Implements ScriptEngineProtocol.
|
virtual |
Reallocate Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
Reallocate Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
Reallocate Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
Remove Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
Remove Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
Remove Lua function reference.
Reimplemented from ScriptEngineProtocol.
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua
Implements ScriptEngineProtocol.
|
overridevirtual |
when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua
Implements ScriptEngineProtocol.
|
overridevirtual |
when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua
Implements ScriptEngineProtocol.