立 1 在body的render属性下有个opacity属性,理论上应该是透明度,但是设置无效?2 在body的render属性下有个sprite有个texture是设置纹理,但是在初始化后无法重置为其他图片纹理?
立 birdOptions = { frictionStatic: 0, frictionAir: 0, friction: 0, restitution: 1, density: 1, mass: 1, collisionFilter: { group: -2 }, render: { opacity: 0.5, sprite: { texture: 'ui/icon_06.png', xOffset: 116 / 2, yOffset: 98 / 2 - 2 } } this._body = Matter.Bodies.rectangle(WinWidth / 4, WinHeight / 2, 75, 70, birdOptions); 第一个问题是透明度opacity设置无效第二个问题:上面这个是初始化,后面在游戏过程中想要改变texture,比如:this._body.render.sprite.texture = 'ui/icon_07.png'; 这样是不行的