【问题标题】:COCOS2DJS - How to fullscreen game in win32COCOS2DJS - 如何在win32中全屏游戏
【发布时间】:2014-11-20 10:04:42
【问题描述】:

我正在测试 cocos2djs。无论如何我可以在游戏开始时将其设为全屏吗?我将分辨率策略设置为 720p。 (1280 x 720)。

【问题讨论】:

    标签: cocos2d-x cocos2d-x-3.0 cocos2d-js


    【解决方案1】:

    是的。我正在使用完整的 3.0 版。在文件./frameworks/runtime-src/Classes/AppDelegate.cpp 中找到这个块:

    #if(CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
            glview = cocos2d::GLViewImpl::create("Learn1");
    #else
            glview = cocos2d::GLViewImpl::createWithRect("Learn1", Rect(0,0,900,640));
    #endif
            director->setOpenGLView(glview);
    }
    

    然后,将createWithRect 更改为createWithFullScreen。像这样:

    #if(CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
            glview = cocos2d::GLViewImpl::create("Learn1");
    #else
            glview = cocos2d::GLViewImpl::createWithFullScreen("Learn1");
    #endif
            director->setOpenGLView(glview);
    }
    

    重新编译,然后就可以了。

    显然,您需要确保引用的是您的游戏名称,而不是“Learn1”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多