1.
let rate = 1;
let browserRate = Laya.stage.width / Laya.stage.height;
if(browserRate > 1334/750){
rate = Laya.stage.height / 750;
}else{
rate = Laya.stage.width / 1334;
}
this.view.ui_Window.setScale(rate,rate);
2.
public static get isIphoneX() {
if (Laya.stage.width / Laya.stage.height < 2) {
return true;
} else {
return false;
}
}
public static get iphoneXSubWidth() {
return 55;
}
public get scaleXY(): number {
let adjustX = 0;
if (UIManager.isIphoneX) {
adjustX = UIManager.iphoneXSubWidth;
}
const s: number = Math.min((Laya.stage.width - adjustX * 2) / Laya.stage.designWidth, Laya.stage.height / Laya.stage.designHeight);
return s;
}