bool LuaStack::init(void) { _state = lua_open(); luaL_openlibs(_state); tolua_Cocos2d_open(_state); toluafix_open(_state); // Register our version of the global "print" function const luaL_reg global_functions [] = { {"print", lua_print}, {NULL, NULL} }; luaL_register(_state, "_G", global_functions); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif tolua_extensions_ccb_open(_state); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) tolua_web_socket_open(_state); #endif tolua_opengl_open(_state); tolua_scroll_view_open(_state); tolua_script_handler_mgr_open(_state); // add cocos2dx loader addLuaLoader(cocos2dx_lua_loader); return true; }
bool CCLuaEngine::init(void) { m_state = lua_open(); luaL_openlibs(m_state); tolua_Cocos2d_open(m_state); tolua_prepare_ccobject_table(m_state); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) addLuaLoader(loader_Android); #endif return true; }
bool CCLuaEngine::init(void) { m_state = lua_open(); luaL_openlibs(m_state); tolua_Cocos2d_open(m_state); tolua_UI_open(m_state); toluafix_open(m_state); luaopen_bit_custom(m_state); #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) CCLOG("addLuaLoader!!"); addLuaLoader(loader_Android); #endif return true; }
bool CCLuaStack::init(void) { m_state = lua_open(); luaL_openlibs(m_state); tolua_Cocos2d_open(m_state); toluafix_open(m_state); // Register our version of the global "print" function const luaL_reg global_functions [] = { {"print", lua_print}, {NULL, NULL} }; luaL_register(m_state, "_G", global_functions); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) CCLuaObjcBridge::luaopen_luaoc(m_state); #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) addLuaLoader(loader_Android); #endif return true; }
bool CCLuaStack::init(void) { m_state = lua_open(); luaL_openlibs(m_state); tolua_Cocos2d_open(m_state); toluafix_open(m_state); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) CCLuaObjcBridge::luaopen_luaoc(m_state); #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) addLuaLoader(loader_Android); #endif // register CCLuaLoadChunksFromZip lua_pushcfunction(m_state, loadChunksFromZip); lua_setglobal(m_state, "CCLuaLoadChunksFromZip"); // register CCLuaStackSnapshot luaopen_snapshot(m_state); return true; }
bool CCLuaStack::init(void) { m_state = lua_open(); luaL_openlibs(m_state); tolua_Cocos2d_open(m_state); toluafix_open(m_state); // Register our version of the global "print" function const luaL_reg global_functions [] = { {"print", lua_print}, {NULL, NULL} }; luaL_register(m_state, "_G", global_functions); tolua_CocoStudio_open(m_state); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) CCLuaObjcBridge::luaopen_luaoc(m_state); #endif register_all_cocos2dx_extension_manual(m_state); register_all_cocos2dx_studio_manual(m_state); // add cocos2dx loader addLuaLoader(cocos2dx_lua_loader); return true; }