为什么我用了CCSpriteBatchNode也没降低帧数

qq726302776
Sun, 29 Dec 2013 02:32:53 +0000

同样是5000个sprite，加了CCSpriteBatchNode和没加效果是一样的。为什么？

QQ图片20131229102716.jpg797×508

CCSpriteBatchNode* batchNode = CCSpriteBatchNode::create(“runner.png”);
batchNode->setPosition(CCPointZero);

for(int i = 0;i < 5000;++i){
float x = CCRANDOM_0_1()*1280;
float y = CCRANDOM_0_1()720;
CCSprite testIcon = CCSprite::createWithTexture(batchNode->getTexture());
testIcon->setPosition( ccp(x, y) );
batchNode->addChild(testIcon);

}

this->addChild(batchNode);

QQ图片20131229102816.jpg812×509

for(int i = 0;i < 5000;++i){
float x = CCRANDOM_0_1()*1280;
float y = CCRANDOM_0_1()720;
CCSprite testIcon = CCSprite::create(“runner.png”);
testIcon->setPosition( ccp(x, y) );
this->addChild(testIcon);

}

阅读整个主题