5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cocos2dx v3.0環境設定メモ

Last updated at Posted at 2014-02-24

###当方環境

  • OS X Marvericks
  • HomeBrew
  • zsh
  • cocos2d v3.0
  • Xcode5
  • IntelliJ12
  • AndroidSDK
  • AndroidNDK

###最初にやること
AndroidNDKのパスを通しておく

~/.zprofile
	export NDK_ROOT=/path/to/android-ndk
	export ANDROID_HOME=/path/to/android-sdk

###次にやること
マルチプラットフォームプロジェクトを作成する。

	./create_project.py -n Name -k com.example.name -l cpp -p /path/to/yourworkspace

###できるディレクトリ構成

  • Classes
  • CMakeLists.txt
  • cocos2d
  • proj.android
  • proj.ios_mac
  • proj.linux
  • proj.win32
  • Resouces

###共通
C ++ファイルはClassesに追加。
リソースファイルはResoucesに追加。

###Android対応
Classesに追加したファイルを記述する。

proj.android/jni/Android.mk
	LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/GameScene.cpp \
                   ../../Classes/Config.cpp \
                   ../../Classes/BlockSprite.cpp \
                   ../../Classes/CCPlaySE.cpp

ビルドする。

proj.android/
	./build_native.py

参考本
cocos2d-xによるiPhone/Androidアプリプログラミングガイド
清水 友晶

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?