[LayaAir3]关于fixedauto适配

            case Stage.SCALE_FIXED_AUTO:
if ((screenWidth / screenHeight) < (this.designWidth / this.designHeight)) {
scaleY = scaleX;
this._height = canvasHeight = Math.round(screenHeight / scaleX);
} else {
scaleX = scaleY;
this._width = canvasWidth = Math.round(screenWidth / scaleY);
}
break;
在laya.stage中的setScreenSize中有上面代码,以iphone se为例750/1334=0.5622,设计分辨率720/1280=0.5625此时上述if成立最终按fixedwidth适配,但是当screenHeight减小时,比如减小到750/1174 = 0.6388,最终就不会按固定宽适配了;但实际上此时仍然是竖屏,希望按固定宽适配。因为将游戏放入iframe中所以有上面的宽高数据,或者实现下面图示有其它方法可以保持竖屏fixedwidth,横屏auto
捕获.PNG
已邀请:

要回复问题请先

商务合作
商务合作