[]image的uv动画不能平铺
加载了一张img图片 并且设置了repeat=true,改变uv时图片没有平铺
private onFrame():void{
if(this.testScrollImg){
if(this.testScrollImg._bitmap && this.testScrollImg._bitmap.source){
this.testScrollImg._bitmap.source.repeat = true;
var ss:any = this.testScrollImg._bitmap.source.uv;
var uv:any[] = [];
uv[0] = ss[0] + 2/this.testScrollImg.width;
uv[1] = ss[1];
uv[2] = ss[2] + 2/this.testScrollImg.width;
uv[3] = ss[3];
uv[4] = ss[4] + 2/this.testScrollImg.width;
uv[5] = ss[5];
uv[6] = ss[6] + 2/this.testScrollImg.width;
uv[7] = ss[7];
this.testScrollImg._bitmap.source.uv = uv;
}
}
}
private onFrame():void{
if(this.testScrollImg){
if(this.testScrollImg._bitmap && this.testScrollImg._bitmap.source){
this.testScrollImg._bitmap.source.repeat = true;
var ss:any = this.testScrollImg._bitmap.source.uv;
var uv:any[] = [];
uv[0] = ss[0] + 2/this.testScrollImg.width;
uv[1] = ss[1];
uv[2] = ss[2] + 2/this.testScrollImg.width;
uv[3] = ss[3];
uv[4] = ss[4] + 2/this.testScrollImg.width;
uv[5] = ss[5];
uv[6] = ss[6] + 2/this.testScrollImg.width;
uv[7] = ss[7];
this.testScrollImg._bitmap.source.uv = uv;
}
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
qian
赞同来自:
你可以用这个试一下平铺