修改win32平台下窗口大小,及屏幕适配

来源:互联网 发布:格灵深瞳 知乎 编辑:程序博客网 时间:2024/06/05 02:26

窗口大小在 AppDelegate.cpp 中

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
        glview = GLView::createWithRect("My Game",Rect(0,0,640,960));   //     Rect(0,0,640,960)     640 960是指窗口大小
         director->setOpenGLView(glview);
    }

//逻辑分辨率   分辨率 适配   WIN窗口大小在WIN32文件夹里  480 320 指的是游戏素材实际大小 

kResolutionExactFit   是适配全屏

kResolutionNoBorder

kResolutionShowAll

kResolutionFixedHeight

kResolutionFixedWidth

kResolutionUnKnown

 


 

glview->setDesignResolutionSize(480, 320, kResolutionFixedHeight);

 

 

0 0
原创粉丝点击