在cocos2dx 2.x版本中,修改屏幕大小的代码在main.cpp中:
#include "main.h"
#include "AppDelegate.h"
#include "CCEGLView.h"
USING_NS_CC;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// create the application instance
AppDelegate app;
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
eglView->setViewName("Cocos2dx_JiKe_FlappyBird");
eglView->setFrameSize(640, 960); //在此处修改屏幕大小
return CCApplication::sharedApplication()->run();
}
</span>