export default class RankPan  {
  
    public constructor() {
        this.shareCanvas = Laya.Browser.window.sharedCanvas;
        this.ShareSprite = new Laya.Sprite();
        this.ShareSprite.zOrder = 1008;
        this.ShareSprite.pos(0, 0);
        this.ShareSprite.cacheAs = "normal";
        Laya.stage.addChild(this.ShareSprite);
        this.SSSS = new Laya.Texture2D();
        this.TTTT = new Laya.Texture(this.SSSS);
    }
    private Width: number = 0;
    private Height: number = 0;
    private SSSS: Laya.Texture2D;
    private TTTT: Laya.Texture;
    private ShareSprite: Laya.Sprite;
    private shareCanvas: any;
    private AAAA: any;
    public ShuShi(_width: number = 720, _heigth: number = 1280) {
        this.Width = Laya.stage.width;
        this.Height = Laya.stage.height;
        this.shareCanvas.width = _width;
        this.shareCanvas.height = _heigth;
    }

    public open() {
        Laya.timer.frameLoop(10, this, this.gengxin);
        this.ShareSprite.visible = true;
    }

    public close() {
        Laya.timer.clear(this, this.gengxin);
        this.ShareSprite.visible = false;
    }

    public gengxin() {
        this.HuaTu();
    }

    private HuaTu() {
        this.SSSS.loadImageSource(this.shareCanvas);
        this.TTTT.setTo(this.SSSS);
        this.ShareSprite.graphics.clear();
        this.ShareSprite.graphics.drawTexture(this.TTTT, 0, 0, this.TTTT.width, this.TTTT.height);
    }

    private draw2d() {
        this.AAAA.drawImage(this.shareCanvas, 0, 0, this.shareCanvas.width, this.shareCanvas.height);
    }

    
    
}