我在cocos2dx 3.x版本,一般会根据自己的图片去设置屏幕尺寸大小,那么如何去设置呢,下面给出具体代码
auto glView = Director::getInstance()->getOpenGLView();
if (! glView)
{
glView = GLViewImpl::create("star");
glView->setFrameSize(640, 960);
Director::getInstance()->setOpenGLView(glView);
}
glView->setDesignResolutionSize(640, 960, ResolutionPolicy::FIXED_HEIGHT); //1
glView->setFrameSize(640, 960); //2