Build a bridge between Java and Lua script.
More...
#include <CCLuaJavaBridge.h>
|
static int | retainLuaFunctionById (int functionId) |
| Add a reference count for the Lua functionId,and save this reference in the Lua table named luaj_function_id_retain. More...
|
|
static int | releaseLuaFunctionById (int functionId) |
| Release a reference count for the Lua functionId, If the reference count is still greater than 0,save this reference in the Lua table named luaj_function_id_retain. More...
|
|
static int | callLuaFunctionById (int functionId, const char *arg) |
| Call the Lua function corresponding to the functionId with the string pointer arg. More...
|
|
static int | callLuaGlobalFunction (const char *functionName, const char *arg) |
| Call a global Lua function named functionName with the string pointer arg. More...
|
|
Build a bridge between Java and Lua script.
This mechanism make Lua and Java call each other easily.
static int callLuaFunctionById |
( |
int |
functionId, |
|
|
const char * |
arg |
|
) |
| |
|
static |
Call the Lua function corresponding to the functionId with the string pointer arg.
- Parameters
-
functionId | the values corresponding to the Lua function. |
arg | the string pointer point to the argument. |
- Returns
- a number value returned frome the Lua function when call sucessfully, otherwise return -1 or the opposite number for one of the three numbers LUA_ERRRUN,LUA_ERRMEM and LUA_ERRERR.
static int callLuaGlobalFunction |
( |
const char * |
functionName, |
|
|
const char * |
arg |
|
) |
| |
|
static |
Call a global Lua function named functionName with the string pointer arg.
- Parameters
-
functionName | the name of global function. |
arg | the string pointer point to the argument. |
- Returns
- a number value returned frome the Lua function when call sucessfully, otherwise return -1 or the opposite number for one of the three numbers LUA_ERRRUN,LUA_ERRMEM and LUA_ERRERR.
static int releaseLuaFunctionById |
( |
int |
functionId | ) |
|
|
static |
Release a reference count for the Lua functionId, If the reference count is still greater than 0,save this reference in the Lua table named luaj_function_id_retain.
Otherwise, remove the refrence about this functionId in the luaj_function_id table and the luaj_function_id_retain table by set the corresponding value nil.
- Parameters
-
functionId | the id of Lua function. |
- Returns
- the reference count of the functionId if the luaj_function_id table, the luaj_function_id_retain table and the corresponding value for functionId exists a reference count for the Lua functionId is still greater than 0,and otherwise return 0.
static int retainLuaFunctionById |
( |
int |
functionId | ) |
|
|
static |
Add a reference count for the Lua functionId,and save this reference in the Lua table named luaj_function_id_retain.
- Parameters
-
functionId | the id of Lua function. |
- Returns
- the reference count of the functionId if luaj_function_id_retain table exists and the corresponding value for functionId exists, otherwise return 0.
The documentation for this class was generated from the following file:
- /Users/minggo/SourceCode/cocos2d-x/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h