[LayaAir 1.0]图片如何切割 AS3

如何将一张图片切除指定的坐标宽高 像拼图游戏切除一小块图片(AS3)
已邀请:

Laya07

赞同来自:

找到方法了
之前一直用clipRect不行,原来是我方法调用顺序错了
正确顺序:
var img:Image = new Image();
 var t:Texture = Laya.loader.getRes(_resUrl);
img.graphics.save();//必须要调用 否则报错
 img.graphics.clipRect(100,100,200,200);
 img.graphics.drawTexture(t);
 img.graphics.restore();
 this.addChild(img);

要回复问题请先

商务合作
商务合作