[0]drawToTexture截大图有问题,会丢失

private nsp:Laya.Sprite;
    init(): void {
        this.nsp=new Laya.Sprite();
        this.nsp.graphics.drawRect(0,0,1600,1600,"#ff0000");
        this.nsp.mouseThrough=true;
        Laya.stage.addChild(this.nsp);
        this.nsp.on(Laya.Event.CLICK,this,this.drawImg,null)
    }
    drawImg(e:Event=null):void{
        var copySpr:Laya.Sprite=new Laya.Sprite();
        copySpr.texture=this.nsp.drawToTexture(1600,1600,0,0) as Laya.Texture;
        this.nsp.removeSelf();
        copySpr.scale(.1,.1);
        Laya.stage.addChild(copySpr);
    }
QQ图片20220809182809.png

弓长

赞同来自:

您看看,主要就是截图超过一定范围就空了

弓长

赞同来自:

这个是示例,麻烦您下

要回复问题请先

商务合作
商务合作