COCOS2DX 3.3 C + + Project Add LUA support

Source: Internet
Author: User
Tags lua

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.