1. Trang chủ
  2. » Công Nghệ Thông Tin

Install Cocos2d in window Team V

37 233 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 37
Dung lượng 1,49 MB

Nội dung

Whats cocos2dx? Cocos2dx is a game engine branched from Cocos2diPhone, which consists of expanding supported platforms, with multiple choice of programming languages thats shares the same API structure.

Install Cocos2d in window Writer: Team V ● Topic What's cocos2dx? Necessary tools How to install Errors that we can meet Tip What's cocos2dx? Cocos2d-x is a game engine branched from Cocos2d-iPhone, which consists of expanding supported platforms, with multiple choice of programming languages thats shares the same API structure ● Necessary tools Android sdk, jdk, eclipse Cocos2dx package: http://cocos2dx.googlecode.com/files/cocos2d-2.1rc0-x-2.1.3.zip Android NDK: http://dl.google.com/android/ndk/android-ndk-r8ewindows-x86.zip Cygwin: http://cygwin.com/setup.exe Setup tools Cocos2dx package: unzip package that we have just download Build package: option: (only use one of them) Build by build-win.bat: Go to root folder of cocos2d and run build-win32.bat Use Visual Studio 2010: Open cocos2dwin32.vc2010.sln in root folder of cocos2d and build all project in this solution Setup tools Android NDK package: unzip this package Install Cygwin: open setup.exe, when we meet “select package” screen, we choose the same at below image How to install: – Add template project for Visual Studio: Go to root folder of cocos2d / template / msvc / – In this folder you click right mouse and open js file with “microsoft windows based host” that suitable version of Visual studio Ex: InstallWizardForVC2010Express for Visual Studio Express 2010 How to install: – Setup cygwin, sdk, ndk path in “create-androidproject.bat” Run “create-android-project.bat” to create android project (We also need type package name, project name, API version) How to install: Modify NDK_ROOT in build_native.sh: Before: # paths if [ -z "${NDK_ROOT+aaa}" ];then echo "please define NDK_ROOT" exit fi After: # paths NDK_ROOT="/cygdrive/e/All_Cocos2d-x/android-ndk-r8c" (you need set “/cygdrive/e” for your suitable drive) if [ -z "${NDK_ROOT+aaa}" ];then echo “please define NDK_ROOT” exit fi First, we need install C++ to Eclipse: Go to Help/Install New Software In “Work with” dropdown, select your eclipse version Finding “Programing Languages” and select “C/C++ Development Tools” and “C/C++ Development Tools SDK” Click Next and install them We have the android project after create by “create-androidproject.bat” and build by Cygwin throught “build_native.sh” Now, we’ll import that android project to Eclipse Then, select the project File->New-> Other Select “Convert to a C/C++ Project (Adds C/C++ Nature” And Click Next Select “Make file project” and select “Other toolchain” Click “Finish” Right click in your project-> Properties In “C/C++ Build” , modify like the image below with “HelloCaiTo” be replace by you project name Next, in “C/C++ General” ,select “Paths and sysbols” In “Includes” tab , select “GNU C+ +” Click “Add ” -After click “Add ” ,choose “File system” and select to your android NDK>platforms->{Select your android version} ->arch-arm->usr->include Click OK -And add the same with {Location of cocos2d-x}/cocos2dx/include (see image) -Click “Apply” and rebuild project Then, go to “Source Location” tab First it not contain the “Classes” and the “cocos2dx” like the image We need to add to your project Select “Link Folder ” Check “Link to folder file system ” and “Browse ” to your “Classes” folder in your project-> “OK” Do the same with your “cocos2dx” folder in the location which you save your cocos2d-x - Click “Apply” Modify NDK root/build/core/build-binary.mk Go to line: 49 Change: $(cleantarget): PRIVATE_CLEAN_FILES := ($(my)OBJS) To: $(cleantarget): PRIVATE_CLEAN_FILES := $($ (my)OBJS) There is a second issue that only affects Max OS X developers using the 64-bit NDK (i.e the download with the file name android-ndk-r8e-darwinx86_64.tar.bz2) The fix is trivial and requires you to make the following one-line changes to these two files: ${ANDROID_NDK_root}/ndk-build: Replace line 158: file -L “$SHELL” | grep -q “x86[_-]64″ with this: file -L “$SHELL” | grep -q “[xX]86[_-]64″ $ {ANDROID_NDK_root}/build/core/init.mk: Re place line 229: ifneq (,$(shell file -L $(SHELL) | grep ‘x86[_-]64′)) with this: ifneq (,$(shell file -L $(SHELL) | grep ‘[xX]86[_-]64′)) Now, clean your project and run ... template / msvc / – In this folder you click right mouse and open js file with “microsoft windows based host” that suitable version of Visual studio Ex: InstallWizardForVC2010Express for Visual Studio... build-win.bat: Go to root folder of cocos2d and run build-win32.bat Use Visual Studio 2010: Open cocos2dwin32.vc2010.sln in root folder of cocos2d and build all project in this solution Setup tools... “/cygdrive/e” for your suitable drive) if [ -z "${NDK_ROOT+aaa}" ];then echo “please define NDK_ROOT” exit fi Build native code for project: Run build_native.sh in prject, in cygwin terminal you

Ngày đăng: 17/07/2017, 14:32

TỪ KHÓA LIÊN QUAN