public static get GetContextStage():egret.Stage {
return egret.MainContext.instance.stage;
}
private static isSetFixedHeight:boolean=true;
private static isSetFixedWidth:boolean=true;
private static SetResize()
{
if( this.GetContextStage.stageHeight / this.GetContextStage.stageWidth<1.7 )
{
this.GetContextStage.scaleMode = egret.StageScaleMode.FIXED_HEIGHT;
if(this.isSetFixedHeight)
{
this.isSetFixedHeight=false;
this.isSetFixedWidth=true;
this.GetContextStage.setContentSize(1440,720);
}
GameAdapt.SetOrientation(false);
}
else
{
this.GetContextStage.scaleMode = egret.StageScaleMode.FIXED_WIDTH;
if(this.isSetFixedWidth)
{
this.isSetFixedWidth=false;
this.isSetFixedHeight=true;
this.GetContextStage.setContentSize(720,1440);
}
egret 横竖屏自适应
最新推荐文章于 2021-05-29 00:16:44 发布