The Lua engine integrated into the cocos2d-x to process the interactive operation between lua and c++.
More...
|
virtual | ~LuaEngine (void) |
| Destructor of LuaEngine.
|
|
virtual ccScriptType | getScriptType () override |
| Get ccScriptType of LuaEngine used, it is always kScriptTypeLua. More...
|
|
LuaStack * | getLuaStack (void) |
| Get LuaStack of the LuaEngine. More...
|
|
virtual void | addSearchPath (const char *path) |
| Add a path to find lua files in. More...
|
|
virtual void | addLuaLoader (lua_CFunction func) |
| Add lua loader. More...
|
|
virtual int | reload (const char *moduleFileName) |
| Reload script code corresponding to moduleFileName. More...
|
|
virtual void | removeScriptObjectByObject (Ref *object) override |
| Remove the related reference about the Ref object stored in the Lua table by set the value of corresponding key nil: The related Lua tables are toluafix_refid_ptr_mapping,toluafix_refid_type_mapping,tolua_value_root and object_Metatable["tolua_ubox"] or tolua_ubox. More...
|
|
virtual void | removeScriptHandler (int nHandler) override |
| Remove Lua function reference by nHandler by setting toluafix_refid_function_mapping[nHandle] nil. More...
|
|
virtual int | reallocateScriptHandler (int nHandler) override |
| Reallocate Lua function reference index to the Lua function pointer to add reference. More...
|
|
virtual int | executeString (const char *codes) override |
| Execute script code contained in the given string. More...
|
|
virtual int | executeScriptFile (const char *filename) override |
| Execute a script file. More...
|
|
virtual int | executeGlobalFunction (const char *functionName) override |
| Execute a scripted global function. More...
|
|
virtual bool | handleAssert (const char *msg) override |
| Handle the assert message. More...
|
|
virtual bool | parseConfig (ConfigType type, const std::string &str) override |
| Parse the config information data. More...
|
|
virtual int | sendEvent (ScriptEvent *message) override |
| When some events triggered in the c++ also needs to pass on to lua to handle, we could call this function to send events. More...
|
|
virtual int | handleEvent (ScriptHandlerMgr::HandlerType type, void *data) |
| Pass on the events related with ScrollView,TableCell,AssertManager, Armature, Accelerometer, Keyboard, Touch, Touches ,Mouse and Custom event to lua to handle. More...
|
|
virtual int | handleEvent (ScriptHandlerMgr::HandlerType type, void *data, int numResults, const std::function< void(lua_State *, int)> &func) |
| Pass on the events related with TableCell and TableView to lua to handle. More...
|
|
| ScriptEngineProtocol () |
| Constructor of ScriptEngineProtocol.
|
|
virtual | ~ScriptEngineProtocol () |
| Destructor of ScriptEngineProtocol.
|
|
virtual void | retainScriptObject (Ref *, Ref *) |
| Reflect the retain relationship to script scope.
|
|
local | retainScriptObject () |
| Reflect the retain relationship to script scope.
|
|
virtual void | rootScriptObject (Ref *) |
| Add the script object to root object.
|
|
virtual void | releaseScriptObject (Ref *, Ref *) |
| Reflect the release relationship to script scope.
|
|
local | releaseScriptObject () |
| Reflect the release relationship to script scope.
|
|
virtual void | unrootScriptObject (Ref *) |
| Remove the script object from root object.
|
|
virtual void | releaseAllChildrenRecursive (Node *) |
| Release all children native refs for the given node in script scope.
|
|
local | releaseAllChildrenRecursive () |
| Release all children native refs for the given node in script scope.
|
|
virtual void | releaseAllNativeRefs (cocos2d::Ref *) |
| Release all native refs for the given owner in script scope.
|
|
local | releaseAllNativeRefs () |
| Release all native refs for the given owner in script scope.
|
|
virtual void | setCalledFromScript (bool) |
| Useless for Lua.
|
|
virtual bool | isCalledFromScript () |
| Useless for Lua.
|
|
virtual void | rootObject (Ref *) |
| Root a Reference. More...
|
|
virtual void | unrootObject (Ref *) |
| Unroot a Reference. More...
|
|
virtual void | removeObjectProxy (Ref *obj) |
| Remove proxy for a native object.
|
|
virtual void | garbageCollect () |
| Triggers the garbage collector.
|
|
local | garbageCollect () |
| Triggers the garbage collector.
|
|
The Lua engine integrated into the cocos2d-x to process the interactive operation between lua and c++.
virtual void
removeScriptObjectByObject |
( |
Ref * |
object | ) |
|
|
overridevirtual |
Remove the related reference about the Ref object stored in the Lua table by set the value of corresponding key nil: The related Lua tables are toluafix_refid_ptr_mapping,toluafix_refid_type_mapping,tolua_value_root and object_Metatable["tolua_ubox"] or tolua_ubox.
Meanwhile set the corresponding userdata nullptr and remove the all the lua function reference corresponding to this object.
In current mechanism, this function is called in the destructor of Ref object, developer don't call this functions.
- Parameters
-
object | the key object to remove script object. |
Reimplemented from ScriptEngineProtocol.