cocos2d-x大批相同精灵一次渲染

 
 
CCSpriteBatchNode* batchNode = CCSpriteBatchNode::create("sprite.png");
        this->addChild(batchNode);

        for (int i = 0; i < 1000; ++i) {
            CCSprite* xiaoruo = CCSprite::create("sprite.png");
            xiaoruo->setPosition(ccp(CCRANDOM_0_1()*1000, CCRANDOM_0_1()*640));
            batchNode->addChild(xiaoruo);
        }
        CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();

你可能感兴趣的:(cocos2d-x大批相同精灵一次渲染)