Cocos Code IDE

Cocos Code IDE 安装 Vrapper(vim)插件

下载Vrapper: http://sourceforge.net/projects/vrapper/files/vrapper/

解压至 $COCOS_CODE_IDE/

DNSCrypt And Dnsmasq

> 安装

$ brew update
$ brew install dnscrypt dnsmasq

> 配置

$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
$ vim /usr/local/etc/dnsmasq.conf
server=192.168.1.1                  # 所有IP使用该DNS

server=/google.com/127.0.0.1#65053
server=/github.com/127.0.0.1#65053
server=/debug.opendns.com/127.0.0.1#65053

> 启动

$ sudo dnscrypt-proxy --local-address=127.0.0.1:65053 -R OpenDNS
$ sudo dnsmasq --no-daemon --listen-address=127.0.0.1

> 更改

$ sudo vim /etc/resolv.conf
nameserver 127.0.0.1

GYP

> 安装

$ git svn clone -r HEAD http://gyp.googlecode.com/svn/trunk/ gyp
$ cd gyp
$ ./setup.py build
$ sudo ./setup.py install

> Hello World

$ vim main.cpp
#include <stdio.h>
int main(int argc, char** argv)
{
     printf("hello world\n");  
}
$ vim main.gyp
{
    "targets": [
        {
            "target_name": "main",
            "type": "executable",
            "sources": [
                "main.cpp"
            ]
        }
    ]
}
$ gyp --depth=. main.gyp
$ open main.xcodeproj

COMMAND + R 运行

Cocos2d-x Upgrade 2.0 to 3.0

由于项目使用CocosBuilder构建UI,类的变化比较多

table(table table-bordered). |_.old|_.new| |@CCNodeLoaderLibrary@|@NodeLoaderLibrary@| |@CC*Loader@|@*Loader@| |@CCTable*@|@Table*@| |@CCLuaEngine@|@LuaEngine@| |@CCScriptEngineManager@|@ScriptEngineManager@| |@SEL_CCControlHandler@|@Control::Handler@| |@CCScrollView@|@ScrollView@| |@CCControlEvent*@|@Control::EventType::*@| |@CCControlEvent@|@Control::EventType@| |@registerCCNodeLoader@|@registerNodeLoader@| |@ccTouch*@|@onTouch*@| |@CCScale9Sprite@|@Scale9Sprite@| |@CCLabelTTF@|@Label@| |@CCLabelBMFont@|@Label@| |@CCBValue@|@Value@| |@CCDictElement@|@DictElement@| |@CCHttp*@|@network::Http*@| |@CCHttpRequest::kHttp*@|@HttpRequest::Type::*@| |@getChildren()->objectAtIndex(0)@|@getChildren().at(0)@| |@unsigned int@|@ssize_t@| |@kCCScrollViewDirection*@|@ScrollView::Direction::*@| |@kCCTableViewFill*@|@TableView::VerticalFillOrder::*@| |@pushCCObject@|@pushObject@| |@CCEditBox@|@EditBox@| |@EAGLView@|@CCEAGLView@|

Android Freetype2

下载源码包: http://download.savannah.gnu.org/releases/freetype

设置构建环境:

$ $NDK_ROOT/build/tools/make-standalone-toolchain.sh --platform=android-19 --install-dir=~/standalone-toolchain-19
$ PATH=~/standalone-toolchain-19/bin:$PATH

解压freetype

$ cd Download
$ tar xf freetype-2.5.3.tar.bz2
$ cd freetype-2.5.3
$ ./configure --host=arm-linux-androideabi --prefix=/freetype --without-zlib --enable-static --disable-shared
$ make -j4
$ make install DESTDIR=$(pwd)

然后在freetype-2.5.3/freetype目录里就是编译好的文件

参考:http://my.oschina.net/nkm/blog/111831

参考:http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android#FreeType