[]请教文档中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}]);
 
我发现这样没用。
已邀请:

cuixueying

赞同来自:

你的方法是在哪里看到的,目前最新的接口是

111.png

 

rainysky

赞同来自:

@cuixueying
是带着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

赞同来自:

看了下JS源码里有这么一段:
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

赞同来自:

你直接传一个二维的数组就行了,数组内容是x和y的位置信息就了[[1,2]]

Chuan

赞同来自:

刚好做到这里,直接定义
var npcpos:Array<any> = [];
再向里面push(x,y);
npcpos.push( 6.5 * i, 7.5 * i);
再drawTexture就好了;
npcpoint.graphics.drawTextures(texture, npcpos)
 

188*****200

赞同来自:

5年了 依旧没有解决。。。

要回复问题请先

商务合作
商务合作