Preparatory work:
1. Copy Cocos2d-x-3.3rc0\external\lua entire folder into the project (e.g. Myproject\cocos2d\external\lua)
2. Copy cocos2d-x-3.3rc0\cocos\scripting entire folder into the project (e.g. myproject\cocos2d\cocos\scripting)
VS Engineering Configuration:
1. Add the LIBLUACOCOS2D project you just copied from the solution (add an existing project: myproject\cocos2d\cocos\scripting\lua-bindings\proj.win32\ Libluacocos2d.vcxproj)
2. MyProject Project Add Project Dependencies (add new references, add a reference, right-click Project Properties---tick libluacocos2d)
3. Additional Include directory additions (refer to lua-tests project):
$ (engineroot) Cocos\scripting\lua-bindings\auto
$ (engineroot) cocos\scripting\lua-bindings\manual
$ (engineroot) external\lua\luajit\include
$ (engineroot) External\lua\tolua
$ (engineroot) External\lua
4. Connector--Input add:
Lua51.lib
ANDROID.MK configuration:
Just add:
Local_static_libraries + = Cocos2d_lua_static
$ (call import-module,scripting/lua-bindings/proj.android)
Such as:
Local_path: = $ (call My-dir) include $ (clear_vars) $ (call import-add-path,$ (Local_path)/. /.. /COCOS2D) $ (call import-add-path,$ (Local_path)/... /.. /cocos2d/external) $ (call import-add-path,$ (Local_path)/... /.. /cocos2d/cocos) Local_module: = cocos2dcpp_sharedlocal_module_filename: = libcocos2dcpp#====== Auto include all CPP Files in Classes directory ======# define walk function to recursive travel directorydefine Walk $ (wildcard $ (1)) $ (for Each e, $ (wildcard $ (1)/*), $ (call Walk, $ (e))) endef# travel Classes directoryallfiles = $ (call walk, $ (local_path)/. /.. /classes) File_list: = Hellocpp/main.cppfile_list + = $ (filter%.cpp, $ (allfiles)) Local_src_files: = $ (file_list:$ (LOCAL _path)/%=%) #=============================================================local_c_includes: = $ (LOCAL_PATH)/... /.. /classes $ (local_path)/. /.. /classes/ccgame/includelocal_static_libraries: = cocos2dx_staticlocal_static_libraries + = Cocos2d_lua_ Staticinclude $ (build_shared_library) $ (Call IMPORT-MODULE,SCRipting/lua-bindings/proj.android) $ (call Import-module,.)
COCOS2DX 3.3 C + + Project Add LUA support