[]android旋转屏幕 半边黑屏
LayaAir Native SDK 0.9.7 旋转后黑屏 老版本LayaAir Native SDK 0.9.2 正常
//初始化引擎
Laya.init(Browser.width, Browser.height, WebGL);
Laya.stage.bgColor = "#ffeff0";
//设置横竖屏
// Laya.stage.optimizeScrollRect = true;
Font.defaultFont = "宋体";
Laya.stage.alignV = "top";
Laya.stage.alignH = "left";
Laya.stage.screenMode = "vertical";
Laya.stage.scaleMode = Stage.SCALE_FULL;
spr = new Sprite
var te:Text = new Text();
te.fontSize = 50;
te.text = "内容测试";
spr.addChild(te);
Laya.stage.addChild(spr);
Laya.stage.on(Event.CLICK, this, function():void {
if (Laya.stage.screenMode == Stage.SCREEN_HORIZONTAL) {
if (Browser.window.conchConfig) {
Browser.window.conchConfig.setScreenOrientation(1);
}
Laya.stage.screenMode = Stage.SCREEN_VERTICAL;
Laya.stage.scaleMode = Stage.SCALE_FULL;
} else {
if (Laya.stage.screenMode == Stage.SCREEN_VERTICAL) {
if (Browser.window.conchConfig)
Browser.window.conchConfig.setScreenOrientation(0);
}
Laya.stage.screenMode = Stage.SCREEN_HORIZONTAL;
Laya.stage.scaleMode = Stage.SCALE_FULL;
}
}
});
要回复问题请先登录
1 个回复
Monica - 知识达人
赞同来自: