我们可以在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 },
如设计一个800*600的,可以乘以一个比例系数
{ name: 'vipkid', width: 1067, height: 800, ratio: 1 },