行业新闻您现在的位置:主页 > 新闻资讯 > 行业新闻 >

跟着石头哥哥学cocos2d-x(一)---2dx环境搭建 (

发布日期:2016-12-15 23:05

之前一直忙于游戏后台的开发,也没有时间整理,本人热衷游戏开发,现工作之余准备整理2dx引擎方面的东西,方便大家学习以及自己备忘吧,废话少说直接上菜:
环境搭建分以下步走:
1.开发环境搭建:java环境 +android环境 这个就不说了,这里顺带提及下,这里ide直接上idea,自行下载:;好处你懂得;可以自动导入2dx交叉编译后需要的java lib文件,eclipse还得自己添加,后面一篇会讲到跨平台编译到android中提及,顺便分享下idea的使用心得;
2.下载cygwin,我 下载的版本是1.7.2 :,镜像就用吧,http://mirrors.163.com/.help/cygwin.html,搭建交叉编译环境,慢慢等吧,下载完毕了吗? ok 配置下,进入安装的目录,切换到home下 有个bash_profile, 填写你的ndk路径 想这个:
01
# base-files version 4.0-6
02
# ~/.bash_profile: executed by bash(1) for login shells.
03
04
# The latest version as installed by the Cygwin Setup program can
05
# always be found at /etc/defaults/etc/skel/.bash_profile
06
07
# Modifying /etc/skel/.bash_profile directly will prevent
08
# setup from updating it.
09
10
# The copy in your home directory (~/.bash_profile) is yours, please
11
# feel free to customise it to create a shell
12
# environment to your liking. If you feel a change
13
# would be benifitial to all, please feel free to send
14
# a patch to the cygwin mailing list.
15
16
# User dependent .bash_profile file
17
18
# source the users bashrc if it exists
19
if [ -f "${HOME}/.bashrc" ] ; then
20
source "${HOME}/.bashrc"
21
fi
22
23
# Set PATH so it includes user's private bin if it exists
24
# if [ -d "${HOME}/bin" ] ; then
25
# PATH="${HOME}/bin:${PATH}"
26
# fi
27 
28
# Set MANPATH so it includes users' private man if it exists
29
# if [ -d "${HOME}/man" ]; then
30
# MANPATH="${HOME}/man:${MANPATH}"
31
# fi
32
33
# Set INFOPATH so it includes users' private info if it exists
34
# if [ -d "${HOME}/info" ]; then
35
# INFOPATH="${HOME}/info:${INFOPATH}"
36
# fi
37
#ndk-root
38
NDK_ROOT=/cygdrive/d/commons/android_sdk/android-ndk-r8e
39
export NDK_ROOT
这里要注意 我的ndk是放在d盘的哈,如果编译的时候出现ndk找不到,别担心,将这个玩家放到你登录电脑的帐号文件夹下面,譬如我的C:\Users\CHENLEI\。用户文件夹下面;
3.下载coocs2d-x引擎源代码,我是2.1.4版本,打开目录,\cocos2d-x- 2.1.4\template\msvc\CCAppWiz.win32\Scripts\1033\找到脚本修改如下注意文件路径:
001
function LogInfo(strInfo) {
002
var FileSys = new ActiveXObject("Scripting.FileSystemObject");
003
var strLogPath = "\\CCApplicationWizardLog.txt"
004
var file = FileSys.OpenTextFile(strLogPath, 8, true);
005
file.WriteLine(strInfo); 
006
file.Close(); 
007
}
008
009
function OnFinish(selProj, selObj) {
010
try {
011
// Create symbols based on the project name
分享到:QQ空间新浪微博腾讯微博人人网微信
客服软件
live chat