Egret获取舞台宽高

点击量:155

Egret获取舞台宽高

stage.stageWidth
stage.stageHeight

1、egret.MainContext.instance.stage

2、Main.Stage

Main.ts

class Main extends eui.UILayer {

    public static Stage: egret.Stage = null;

     protected createChildren(): void {
        super.createChildren();

        Main.Stage = this.stage;
}