先是创建的时候:
var mouseSprite = cc.Sprite.create("#mouse4.png");
mouseSprite.attr({
anchorX:0,
anchorY:0,
x:randomRPointX(),
y:randomPointY(),
scale:1
});
// mouseSprite.attr({x:randomRPointX(), y:randomPointY()});
// spzLayer.addChild(mouseSprite,0);
var running2Action = cc.RepeatForever.create(cc.Animate.create(animation2));
mouseSprite.runAction(running2Action);
mouses2.push(mouseSprite);
spriteSheet.addChild(mouseSprite);
然后设置的时候:
mouseSprite.setTexture(bloodTexture.texture);
但是报错:
“cc.Sprite.texture setter: Batched sprites should use the same texture as the batch node”
求助大神