auto texture = SpriteBatchNode::create(“play.png”);
for (int i = 0;i < 10; i++)
{
auto sp = Sprite::createWithTexture(texture->getTexture());
sp->setPosition(VisibleRect::leftBottom() + Vec2(CCRANDOM_0_1() * 500, CCRANDOM_0_1() * 500));
texture->addChild(sp);
}
this->addChild(texture);
和
for (int i = 0;i < 10; i++)
{
auto sp = Sprite::create(“play.png”);
sp->setPosition(VisibleRect::leftBottom() + Vec2(CCRANDOM_0_1() * 500, CCRANDOM_0_1() * 500));
this->addChild(sp);
}
2种方法创建出来的渲染字数一样?求解