
以下是测试代码
this.owner.scene.scale(1.25, 1.25) //使用缩放后 图片拼合会多一条线 2.0中没有此问题
Laya.loader.load("http://103.219.177.59:63344/%E5%9B%BE%E7%89%87%E6%8B%BC%E5%90%88/33_19_a.jpg", Laya.Loader.TEXTURE2D).then((texture: Laya.Texture2D) => {
//在U方向上使用WARPMODE_CLAMP
texture.wrapModeU = Laya.WrapMode.Clamp;
//在V方向使用WARPMODE_CLAMP
texture.wrapModeV = Laya.WrapMode.Clamp;
//创建Texture
let texture1: Laya.Texture = new Laya.Texture(texture);
let a = new Laya.Sprite()
//使用Sprite对象的绘制纹理方式
a.graphics.drawTexture(texture1, 0, 0);
this.owner.addChild(a)
});
Laya.loader.load("http://103.219.177.59:63344/%E5%9B%BE%E7%89%87%E6%8B%BC%E5%90%88/33_20_a.jpg", Laya.Loader.TEXTURE2D).then((texture: Laya.Texture2D) => {
//在U方向上使用WARPMODE_CLAMP
texture.wrapModeU = Laya.WrapMode.Clamp;
//在V方向使用WARPMODE_CLAMP
texture.wrapModeV = Laya.WrapMode.Clamp;
//创建Texture
let texture1: Laya.Texture = new Laya.Texture(texture);
let a = new Laya.Sprite()
//使用Sprite对象的绘制纹理方式
a.graphics.drawTexture(texture1, 0, 512);
this.owner.addChild(a)
});
let a = new Laya.Sprite()
a.loadImage("http://103.219.177.59:63344/%E5%9B%BE%E7%89%87%E6%8B%BC%E5%90%88/33_19.jpg")
a.pos(512,0,true)
this.owner.addChild(a)
let b = new Laya.Sprite()
b.loadImage("http://103.219.177.59:63344/%E5%9B%BE%E7%89%87%E6%8B%BC%E5%90%88/33_20.jpg")
b.pos(512,512,true)
this.owner.addChild(b)