[0]Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize);
Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize);
private ChangeSize(e:Laya.Event) {
Laya.stage.off(Laya.Event.RESIZE,this, this.ChangeSize);
console.log("size---------------",e)
if(Laya.Browser.window.clientHeight < Laya.Browser.window.clientWidth) {
console.log("横屏")
// Laya.stage.screenMode = "horizontal";
Laya.stage.width = 1136;
Laya.stage.height = 640;
// Laya.stage.size(1136,640);
} else {
console.log("竖屏")
// Laya.stage.screenMode = "vertical";
Laya.stage.width = 640;
Laya.stage.height = 1136;
// Laya.stage.size(640,1136);
}
// Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize);
}
重新设置stage的宽高时,如何让这个监听暂停,等设置好宽高后又起效
private ChangeSize(e:Laya.Event) {
Laya.stage.off(Laya.Event.RESIZE,this, this.ChangeSize);
console.log("size---------------",e)
if(Laya.Browser.window.clientHeight < Laya.Browser.window.clientWidth) {
console.log("横屏")
// Laya.stage.screenMode = "horizontal";
Laya.stage.width = 1136;
Laya.stage.height = 640;
// Laya.stage.size(1136,640);
} else {
console.log("竖屏")
// Laya.stage.screenMode = "vertical";
Laya.stage.width = 640;
Laya.stage.height = 1136;
// Laya.stage.size(640,1136);
}
// Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize);
}
重新设置stage的宽高时,如何让这个监听暂停,等设置好宽高后又起效
没有找到相关结果
已邀请:
1 个回复
phhh
赞同来自: