【laya】增加刚体贴图

初始化一个刚体的代码如例:

this._gun = this.Matter.Bodies.rectangle(901, 301, 100, 100, {
isStatic: false,
frictionAir: 0.3, //空气摩擦力
density: 0.68, //密度
restitution: 0.8, //弹性
weight: 100,
render: {
visible: true, //开启渲染
sprite:
{
texture: "ui://GunUI//AK47", ///这个地址要在哪写??
xOffset: 25, // x 设置为中心点
yOffset: 15 // y 设置为中心点
}
}
});
this.Matter.World.add(this._engine.world, this._gun);
 
谢谢老板。
已邀请:

谷主

赞同来自:

大哥我不懂。

要回复问题请先登录注册