[]怎么裁剪一张图片
let tmp = new Laya.Sprite();
tmp.loadImage("test.png", 0, 0, 30, 52);
我这么写,裁不出30*52的区域。请问要怎么写
tmp.loadImage("test.png", 0, 0, 30, 52);
我这么写,裁不出30*52的区域。请问要怎么写
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自:
/**
* 根据指定资源和坐标、宽高、偏移量等创建 <code>Texture</code> 对象。
* @param source 绘图资源 img 或者 Texture 对象。
* @param x 起始绝对坐标 x 。
* @param y 起始绝对坐标 y 。
* @param width 宽绝对值。
* @param height 高绝对值。
* @param offsetX X 轴偏移量(可选)。
* @param offsetY Y 轴偏移量(可选)。
* @param sourceWidth 原始宽度,包括被裁剪的透明区域(可选)。
* @param sourceHeight 原始高度,包括被裁剪的透明区域(可选)。
* @return <code>Texture</code> 对象。
*/
public static function create(source:*, x:Number, y:Number, width:Number, height:Number, offsetX:Number = 0, offsetY:Number = 0, sour