一、HelloWorld
1.修改窗口属性:
main.cpp
1: CCEGLView * eglView = CCEGLView::sharedOpenGLView();
2: eglView->setViewName("HelloCpp");//窗口名字3: eglView->setFrameSize("2048,1536");//窗口大小4: eglView->setFrameZoomFactor(0.4f);//窗口缩放,只对计算机平台有效,对手机无效
2.解决无法打开文件“libcocos2d.lib”的问题
右键项目—》属性—》左侧,配置属性—》C/C++-—》右侧,附加包含目录—》编辑—》把$(SolutionDir)换成Cocos2d-x安装目录
3.AppDelegate.cpp—>applicationDidFinishLaunching
1: pDirector->setDisplayStats(true);//设置是否显示游戏的帧数等调试信息2: pDirector->setAnimationInterval(1.0 / 60);//设置游戏的帧率,在这里是60帧每秒3: CCScene * pScene = HelloWorld::scene();//创建一个场景4: pDirector->runWithScene(pScene);//只有执行这一步,才能让场景类显示出来
4.CREATE_FUNC宏
1: #define CREATE_FUNC(__TYPE__)\2: static__TYPE__* create() \
3: { \
4: