当前位置 : 主页 > 手机开发 > 其它 >

cocos code ide config.json&方便查看不同屏幕分辨率适配效果

来源:互联网 收集:自由互联 发布时间:2021-06-13
config.json { "init_cfg":{ "isLandscape": true, "isWindowTop": false, "name": "mahjonghn", "width": 1080, "height": 540, "entry": "src/main.lua", "consolePort": 6050, "uploadPort": 6060 }, "simulator_screen_size": [ { "title": "iPhone 3Gs (

config.json

{
    "init_cfg":{
       "isLandscape": true,
       "isWindowTop": false,
       "name": "mahjonghn",
       "width": 1080,
       "height": 540,
       "entry": "src/main.lua",
       "consolePort": 6050,
       "uploadPort": 6060
    },
    "simulator_screen_size": [
        {
            "title": "iPhone 3Gs (480x320)",
            "width": 480,
            "height": 320
        },
        {
            "title": "iPhone 4 (960x640)",
            "width": 960,
            "height": 640
        },
        {
            "title": "iPhone 5 (1136x640)",
            "width": 1136,
            "height": 640
        },
        {
            "title": "iPad (1024x768)",
            "width": 1024,
            "height": 768
        },
        {
            "title": "iPad Retina (2048x1536)",
            "width": 2048,
            "height": 1536
        },
        {
            "title": "Android (800x480)",
            "width": 800,
            "height": 480
        },
        {
            "title": "Android (854x480)",
            "width": 854,
            "height": 480
        },
        {
            "title": "Android (1280x720)",
            "width": 1280,
            "height": 720
        },
        {
            "title": "Android (1920x1080)",
            "width": 1920,
            "height": 1080
        }
    ]
}

其中,


这个width和height调整为:

1080 * 540  小米mix2 2160*1080

960 * 640   普通手机  宽高比1.5

1024 * 768  ipad2  2048 * 1536

即可方便看到在不同手机上适配效果,再也不用担心公司没测试机啦

网友评论