[]请教文档中Graphic.drawTextures方法第二个参数的具体参数格式
Graphic
drawTextures () method public function drawTextures(tex:Texture, pos:Array):void批量绘制同样纹理。
Parameters
tex:Texture — 纹理。
pos:Array — 绘制次数和坐标。
请教第二个参数pos的具体格式
是带着s的drawTextures,批量绘制同样纹理。
是把
x X 轴偏移量。
y Y 轴偏移量。
width 宽度。
height 高度。
m 矩阵信息。
把这几个参数组成一个json对象,然后再把多个json组成数组传入吗?
像这样吗drawTextures(texture, [{x:0, y:0, width:128, height:64}, {x:128, y:0, width:128, height:64}]);
我发现这样没用。
drawTextures () method public function drawTextures(tex:Texture, pos:Array):void批量绘制同样纹理。
Parameters
tex:Texture — 纹理。
pos:Array — 绘制次数和坐标。
请教第二个参数pos的具体格式
是带着s的drawTextures,批量绘制同样纹理。
是把
x X 轴偏移量。
y Y 轴偏移量。
width 宽度。
height 高度。
m 矩阵信息。
把这几个参数组成一个json对象,然后再把多个json组成数组传入吗?
像这样吗drawTextures(texture, [{x:0, y:0, width:128, height:64}, {x:128, y:0, width:128, height:64}]);
我发现这样没用。
没有找到相关结果
已邀请:
要回复问题请先登录
6 个回复
cuixueying
赞同来自:
rainysky
赞同来自:
是带着s的drawTextures,批量绘制同样纹理。
是把
x X 轴偏移量。
y Y 轴偏移量。
width 宽度。
height 高度。
m 矩阵信息。
把这几个参数组成一个json对象,然后再把多个json组成数组传入吗?
像这样吗drawTextures(texture, [{x:0, y:0, width:128, height:64}, {x:128, y:0, width:128, height:64}]);
我发现这样没用。
qgpcybs
赞同来自:
drawTextures=function(t,e){if(t&&t.loaded&&t.bitmap&&t.source){var i=t.uv,n=t.bitmap.width,s=t.bitmap.height;this.drawImageS(t.bitmap.source,i[0]*n,i[1]*s,(i[2]-i[0])*n,(i[5]-i[3])*s,t.offsetX,t.offsetY,t.width,t.height,e)}}
不过乱七八糟的。。。我本来想做场景过渡的,还是自己写算了。。。
Laya_XS
赞同来自:
Chuan
赞同来自:
var npcpos:Array<any> = [];
再向里面push(x,y);
npcpos.push( 6.5 * i, 7.5 * i);
再drawTexture就好了;
npcpoint.graphics.drawTextures(texture, npcpos)
188*****200
赞同来自: