cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表

LuaStack类 参考

#include

类 LuaStack 继承关系图:

Public 成员函数 - 图3 Ref

## Public 成员函数
virtual ~LuaStack ()
lua_State getLuaState (void)
Method used to get a pointer to the lua_State that the script module is attached to. 更多…
virtual void addSearchPath (const char path)
Add a path to find lua files in. 更多…
virtual void addLuaLoader (lua_CFunction func)
Add lua loader, now it is used on android. 更多…
virtual int reload (const char moduleFileName)
reload script code contained in the given string. 更多…
virtual void removeScriptObjectByObject (Ref object)
Remove Object from lua state. 更多…
virtual void removeScriptHandler (int nHandler)
Remove Lua function reference. 更多…
virtual int reallocateScriptHandler (int nHandler)
Remove Lua function reference. 更多…
virtual int executeString (const char codes)
Execute script code contained in the given string. 更多…
virtual int executeScriptFile (const char filename)
Execute a script file. 更多…
virtual int executeGlobalFunction (const char functionName)
Execute a scripted global function. 更多…
virtual void clean (void)
virtual void pushInt (int intValue)
virtual void pushFloat (float floatValue)
virtual void pushLong (long longValue)
virtual void pushBoolean (bool boolValue)
virtual void pushString (const char stringValue)
virtual void pushString (const char stringValue, int length)
virtual void pushNil (void)
virtual void pushObject (Ref objectValue, const char typeName)
virtual void pushLuaValue (const LuaValue &value)
virtual void pushLuaValueDict (const LuaValueDict &dict)
virtual void pushLuaValueArray (const LuaValueArray &array)
virtual bool pushFunctionByHandler (int nHandler)
virtual int executeFunction (int numArgs)
virtual int executeFunctionByHandler (int nHandler, int numArgs)
virtual int executeFunctionReturnArray (int handler, int numArgs, int numResults, __Array &resultArray)
virtual int executeFunction (int handler, int numArgs, int numResults, const std::function< void(lua_State , int)> &func)
virtual bool handleAssert (const char msg)
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
## 静态 Public 成员函数
static LuaStack create (void)
static LuaStack attach (lua_State *L)
## Protected 成员函数
LuaStack (void)
bool init (void)
bool initWithLuaState (lua_State *L)
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…
## Protected 属性
lua_State * _state
int _callFromLua
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…

构造及析构函数说明

virtual ~LuaStack ( )

virtual

LuaStack ( void )

inlineprotected

成员函数说明

virtual void addLuaLoader ( lua_CFunction func)

virtual

Add lua loader, now it is used on android.

virtual void addSearchPath ( const char * path)

virtual

Add a path to find lua files in.

  • 参数
  • pathto be added to the Lua path

static LuaStack attach ( lua_State L)

static

virtual void clean ( void )

virtual

static LuaStack* create ( void )

static

virtual int executeFunction ( int numArgs)

virtual

virtual int executeFunction ( int handler,
int numArgs,
int numResults,
const std::function< void(lua_State *, int)> & func
)

virtual

virtual int executeFunctionByHandler ( int nHandler,
int numArgs
)

virtual

virtual int executeFunctionReturnArray ( int handler,
int numArgs,
int numResults,
__Array & resultArray
)

virtual

virtual int executeGlobalFunction ( const char * functionName)

virtual

Execute a scripted global function.

The function should not take any parameters and should return an integer.

  • 参数
  • functionNameString object holding the name of the function, in the global script environment, that is to be executed.

  • 返回
  • The integer value returned from the script function.

virtual int executeScriptFile ( const char * filename)

virtual

Execute a script file.

  • 参数
  • filenameString object holding the filename of the script file that is to be executed

virtual int executeString ( const char * codes)

virtual

Execute script code contained in the given string.

  • 参数
  • codesholding the valid script code that should be executed.

  • 返回
  • 0 if the string is excuted correctly.
  • other if the string is excuted wrongly.

lua_State* getLuaState ( void )

inline

Method used to get a pointer to the lua_State that the script module is attached to.

  • 返回
  • A pointer to the lua_State that the script module is attached to.

virtual bool handleAssert ( const char * msg)

virtual

bool init ( void )

protected

bool initWithLuaState ( lua_State * L)

protected

virtual void pushBoolean ( bool boolValue)

virtual

virtual void pushFloat ( float floatValue)

virtual

virtual bool pushFunctionByHandler ( int nHandler)

virtual

virtual void pushInt ( int intValue)

virtual

virtual void pushLong ( long longValue)

virtual

virtual void pushLuaValue ( const LuaValue & value)

virtual

virtual void pushLuaValueArray ( const LuaValueArray & array)

virtual

virtual void pushLuaValueDict ( const LuaValueDict & dict)

virtual

virtual void pushNil ( void )

virtual

virtual void pushObject ( Ref objectValue,
const char typeName
)

virtual

virtual void pushString ( const char * stringValue)

virtual

virtual void pushString ( const char * stringValue,
int length
)

virtual

virtual int reallocateScriptHandler ( int nHandler)

virtual

Remove Lua function reference.

virtual int reload ( const char * moduleFileName)

virtual

reload script code contained in the given string.

  • 参数
  • moduleFileNameString object holding the filename of the script file that is to be executed

  • 返回
  • 0 if the string is excuted correctly.
  • other if the string is excuted wrongly.

virtual void removeScriptHandler ( int nHandler)

virtual

Remove Lua function reference.

virtual void removeScriptObjectByObject ( Ref * object)

virtual

Remove Object from lua state.

  • 参数
  • objectThe object to be removed.

类成员变量说明

int _callFromLua

protected

lua_State* _state

protected


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/scripting/lua-bindings/manual/CCLuaStack.h
  • cocos2d
  • LuaStack
  • 生成于 2014年 五月 29日 星期四 09:41:46 , 为 cocos2d-x使用 doxygen 1.8.6