在 AppDelegate::applicationDidFinishLaunching()中
auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if(!glview) { glview = GLView::create("My Game"); glview->setFrameSize(540,960); director->setOpenGLView(glview); } glview->setDesignResolutionSize(540,960,ResolutionPolicy::EXACT_FIT);
其中(540,960)为项目设计size
改为自己项目size就可以了
原文链接:https://www.f2er.com/cocos2dx/344182.html