cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LuaObjcBridge Class Reference

Build a bridge between ObjectC and Lua script. More...

#include <CCLuaObjcBridge.h>

Inheritance diagram for LuaObjcBridge:
LuaBridge

Static Public Member Functions

static void luaopen_luaoc (lua_State *L)
 Bind callObjcStaticMethod of LuaObjcBridge to Lua. More...
 
- Static Public Member Functions inherited from LuaBridge
static LuaStackgetStack (void)
 Get the LuaStack of LuaEngine. More...
 
var getStack ()
 Get the LuaStack of LuaEngine. More...
 
static int pushLuaFunctionById (int functionId)
 Push the function pointer corresponding to functionId on the top of lua stack by searching the lua_bridge_function_id table. More...
 
var pushLuaFunctionById ( var functionId)
 Push the function pointer corresponding to functionId on the top of lua stack by searching the lua_bridge_function_id table. More...
 
static int retainLuaFunctionById (int functionId)
 The retain count would be increase by 1 corresponding to functionId in the lua_bridge_function_id_retain table if it could be found. More...
 
static int releaseLuaFunctionById (int functionId)
 The retain count woulde be reduced by 1 corresponding to functionId in the lua_bridge_function_id_retain table if it could be found. More...
 

Static Protected Member Functions

static int callObjcStaticMethod (lua_State *L)
static void pushValue (lua_State *L, void *val)
local pushValue ( local L, local val)
- Static Protected Member Functions inherited from LuaBridge
static int retainLuaFunction (lua_State *L, int functionIndex, int *retainCountReturn)

Additional Inherited Members

- Static Protected Attributes inherited from LuaBridge
static lua_State * s_luaState
static int s_newFunctionId

Detailed Description

Build a bridge between ObjectC and Lua script.

This mechanism make Lua and ObjectC call each other easily.

Member Function Documentation

static int callObjcStaticMethod ( lua_State *  L)
staticprotected
local callObjcStaticMethod ( local  L)
staticprotected
static void luaopen_luaoc ( lua_State *  L)
static

Bind callObjcStaticMethod of LuaObjcBridge to Lua.

In current mechanism,we could call LuaObjcBridge.callStaticMethod(className, methodName, args) in Lua directly. Meanwhile the callObjcStaticMethod of LuaObjcBridge binding function is wrapped in the luaoc.lua

Parameters
Lthe current lua_State
static void pushValue ( lua_State *  L,
void *  val 
)
staticprotected
local pushValue ( local  L,
local  val 
)
staticprotected

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