登录
  • 欢迎访问 Sharezer Blog

Cocos Creator Option

Cocos sharezer 3929次浏览 已收录 0个评论
var option =
{
    //width: width,
    //height: height,
    id: 'GameCanvas',
    scenes: settings.scenes,
    debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
    showFPS : settings.debug,
    frameRate : 60,
    jsList : jsList,
    groupList : settings.groupList,
    collisionMatrix : settings.collisionMatrix,
    renderMode : 1 // 1 是 canvas,2 是 webgl,0 是自动
};

* 当前的游戏配置,包括:                                                                 
* 1. debugMode(debug 模式,但是在浏览器中这个选项会被忽略)                               
*      "debugMode" 各种设置选项的意义。                                                  
*          0 - 没有消息被打印出来。                                                      
*          1 - cc.error,cc.assert,cc.warn,cc.log 将打印在 console 中。                 
*          2 - cc.error,cc.assert,cc.warn 将打印在 console 中。                         
*          3 - cc.error,cc.assert 将打印在 console 中。                                  
*          4 - cc.error,cc.assert,cc.warn,cc.log 将打印在 canvas 中(仅适用于 web 端)。
*          5 - cc.error,cc.assert,cc.warn 将打印在 canvas 中(仅适用于 web 端)。        
*          6 - cc.error,cc.assert 将打印在 canvas 中(仅适用于 web 端)。                 
* 2. showFPS(显示 FPS)                                                           
*      当 showFPS 为 true 的时候界面的左下角将显示 fps 的信息,否则被隐藏。             
* 3. frameRate (帧率)                                                             
*      “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实现和运行环境。     
* 4. id                                                                           
*      "gameCanvas" Web 页面上的 Canvas Element ID,仅适用于 web 端。                        
* 5. renderMode(渲染模式)                                                        
*      “renderMode” 设置渲染器类型,仅适用于 web 端:                             
*          0 - 通过引擎自动选择。                                                    
*          1 - 强制使用 canvas 渲染。
*          2 - 强制使用 WebGL 渲染,但是在部分 Android 浏览器中这个选项会被忽略。    
* 6. scenes                                                                        
*      “scenes” 当前包中可用场景。 


Sharezer , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Cocos Creator Option
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址