1、USING_NS_CC; 相对应于using namespace cocos2d;域名操作符(命名空间)
2、#include”cocos2d.h” cocos的头文件
3、平台 #define CC_PLATFORM_IOS 1
#define CC_PLATFORM_ANDROID 2
#define CC_PLATFORM_WIN32 3
例如CC_TARGET_PLATFORM == CC_PLATFORM_IOS
4、USING_NS_CC_EXT;相对应于using namespace cocos2d::extension;扩展空间
使用TableView、ScrollView、ListView的时候会使用到它
例如#include "CCTableView.h"
//#include "CCScrollView.h"
//#include "CCTableViewCell.h"
USING_NS_CC_EXT;
using namespace std;
5、使用到Cocos2dx中UI控件的话包含头文件
#include "extensions/cocos-ext.h"
#include "ui/CocosGUI.h"
USING_NS_CC::ui; ui作用域 相对应于using namespace cocos2d::ui;
如果还用到cocos studio的话,还需要添加#include "editor-support/cocostudio/CocoStudio.h"
using namespace cocostudio;
6、C++语法需要用到的有哪些
#include <iostream> 输入输出流 打印可以使用
using namespace std; std命名空间比如std::string
7、网络的接收与发送
using namespace cocos2d::network;
8、使用到C++的容器或者函数时,注意要包含头文件,例如
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <set>