自定義機型

我們可以在CC的安裝路徑中找到這些機型的定義。

/Applications/CocosCreator⁩/⁨Contents/⁨Resources/⁨static/⁨preview-templates⁩/boot.js 文件預定義了各種機型的各種分辨率。

 // init device resolutions
    var devices = [
        { name: 'Apple iPad', width: 1024, height: 768, ratio: 2 },
        { name: 'Apple iPad Mini', width: 1024, height: 768, ratio: 1 },
        { name: 'Apple iPhone 4', width: 320, height: 480, ratio: 2 },
        { name: 'Apple iPhone 5', width: 320, height: 568, ratio: 2 },
        { name: 'Apple iPhone 6', width: 375, height: 667, ratio: 2 },
        { name: 'Apple iPhone 6 Plus', width: 414, height: 736, ratio: 3 },
        { name: 'Apple iPhoneX', width: 1792, height: 828, ratio: 1 },
        { name: 'Huawei P9', width: 540, height: 960, ratio: 2},
        { name: 'Huawei Mate9 Pro', width: 720, height: 1280, ratio: 2},
        { name: 'Goolge Nexus 4', width: 384, height: 640, ratio: 2 },
        { name: 'Goolge Nexus 5', width: 360, height: 640, ratio: 3 },
        { name: 'Goolge Nexus 6', width: 412, height: 732, ratio: 3.5 },
        { name: 'Goolge Nexus 7', width: 960, height: 600, ratio: 2 },

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章