Cocos2d-x 3.0 Final Transplant Android

Source: Internet
Author: User

Preparatory work

You just have to follow the last article of the Cocos2d-x 3.0 final environment is ready to build


1. Edit Proj.android\jni\android.mk, change content such as the following

Local_path: = $ (call My-dir) include $ (clear_vars) Local_module: = Cocos2dcpp_sharedlocal_module_filename: = libcocos2dcpp# functions that Traverse folders and subfolders define walk$ (wildcard $ (1)) $ (foreach E, $ (wildcard $ (1)/*), $ (call Walk, $ (e))) endef# traversal Clas Ses folder Allfiles = $ (call walk, $ (local_path)/. /.. /classes) File_list: = hellocpp/main.cpp# Extracts all the. cpp files from all files File_list + = $ (filter%.cpp, $ (allfiles)) Local_src_files: = $ (file_list:$ (Local_path)/%=%) Local_c_includes: = $ (local_path)/... /.. /classeslocal_whole_static_libraries: = cocos2dx_staticlocal_whole_static_libraries + = Cocosdenshion_staticLOCAL_ Whole_static_libraries + = box2d_static #假设使用的是chipmunk引擎须要加上 chipmunk_staticlocal_whole_static_libraries + = Cocos_ Extension_static #因为使用了扩展, so add local_whole_static_libraries + = cocosbuilder_staticlocal_whole_static_libraries + = Cocos_network_staticlocal_whole_static_libraries + = Cocostudio_staticinclude $ (build_shared_library) $ (call IMPORT-MODULE,2D) $ (call Import-module,audio/android) $ (call import-module,box2d) #同上 $ (callImport-module,extensions) #同上 $ (call Import-module,editor-support/cocosbuilder) $ (Call Import-module,editor-support /cocostudio) $ (call import-module,network)


If you use the #include "cocos-ext.h" header file, change the location in the introduction to

#if (Cc_target_platform = = cc_platform_android) #include "extensions/cocos-ext.h" #else include "Cocos-ext.h" #endif

Android Landscape vertical screen changes such as the following, a vertical screen

android:screenorientation= "Portrait"


2.CMD to Proj.android folder, type Python build_native.py, start compiling,environment to build a look, and update the SDK manager inside the Android platform 4.4.2 (this is what I chose, you choose which on demand)


3. After compiling, open Eclispe, select File, import, import your project folder under Cocos2d\cocos\2d\platform\android\java, import, this is the reference LIBCOCOS2DX project, his property is the library, Do not move after importing

4. Select File--Import, this time is the import of your project Proj.android projects, project import will be actively connected to the LIBCOCOS2DX library, after import directly, OK

Cocos2d-x 3.0 Final Transplant Android

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.