Hi,
I am planning to implement batch node animation using set of PNGs (instead of using a spritesheet generated from external tool) by the following way:-
i) Generate animation from the PNG set.
ii) Generate a texture which is combination of all the PNG to be used in the animation.
iii) Use the texture generated in step (ii) to generate batch node.
Please tell what will be the disadvantages of using this approach vs the approach of using spritesheet generated by an external tool.
@Kevin
Through the approach i have mentioned i am trying to remove the use of an external tool to create a sprite sheet. So would like to know will this approach will produce any performance issues ??
No. CCSpriteBatchNode can only speed up the performance if its child leaves (via batchNode->addChild(CCNode*)) use the same texture.
As the matter of fact, we check this condition in CCSpriteBatchNode::addChild(CCNode *child, int zOrder, int tag)
// check CCSprite is using the same texture id
CCAssert(pSprite->getTexture()->getName() == m_pobTextureAtlas->getTexture()->getName(), "");
How about this… WHY are you trying to not use the 3rd party tool?
If you make a plist manually (you can do that, it’s just XML) and use a single texture, you will have the exact same performance as if you used a program to make the plist. It will just be a lot more work.
If you do not use a plist than you have no way of getting the “frames” out of the master png and cannot use batch nodes.