
export default class CanvaRenderMgr {
    private static instance: CanvaRenderMgr;
    public static Get_Instance(): CanvaRenderMgr {
        return CanvaRenderMgr.instance || (CanvaRenderMgr.instance = new CanvaRenderMgr());
    }
    private tex2d: Laya.Texture2D;
    private tex1d: Laya.Texture;
  
    public yincang() {
        Laya.timer.clear(this, this.renderbyWX);
         this.uisprite.visible = false;
    }
    private renderbyWX() {
            this.tex2d.loadImageSource(this.render_Canvas);
            this.tex1d.setTo(this.tex2d);
            this.uisprite.graphics.clear();
            this.uisprite.graphics.drawTexture(this.tex1d, 0, 0, this.tex1d.width, this.tex1d.height);
    }
    public xianshi() {
        Laya.timer.frameLoop(10, this, this.renderbyWX);
         this.uisprite.visible = true;
    }


    private uisprite: Laya.Sprite;
    public ChuShiHUa(w: number = 720, h: number = 1280) {
        this.render_Canvas = Laya.Browser.window.sharedCanvas;
        this.uisprite = new Laya.Sprite();
        this.uisprite.zOrder = 1008;
        this.uisprite.pos(0, 0);
        this.uisprite.cacheAs = "normal";
        Laya.stage.addChild(this.uisprite);
        this.tex2d = new Laya.Texture2D();
        this.tex1d = new Laya.Texture(this.tex2d);
        this.render_Canvas.width = w;
        this.render_Canvas.height = h;
    }
    private render_Canvas: any;
}