当前位置:网站首页>Cocos2dx screen adaptation

Cocos2dx screen adaptation

2022-07-05 04:56:00 Meteor spot

    Size screenSize = glview->getFrameSize();
    if (screenSize.width < screenSize.height)
    {
        glview->setFrameSize(screenSize.height, screenSize.width);
        screenSize = glview->getFrameSize();
    }
    if (screenSize.width / screenSize.height >= 1280.f / 720.f) {
        glview->setDesignResolutionSize(1280, 720, ResolutionPolicy::FIXED_HEIGHT);
    }
    else{
        glview->setDesignResolutionSize(1280, 720, ResolutionPolicy::SHOW_ALL);
    }

原网站

版权声明
本文为[Meteor spot]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140625238010.html