为什么从CCSpriteFrameCache创建的sprite能添加到CCSpriteBatchNode
在《如何使用动画和精灵表单 Cocos2d-x 2.1.4 》中介绍了如何使用plist文件创建精灵和动画,使用方法直接参考如下代码:
bool HelloWorld::init(){ bool bRet = false; do { CC_BREAK_IF(!CCLayer::init());
//1) Cache the sprite frames and texture
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("AnimBear.plist");
//2) Create a sprite batch node
CCSpriteBatchNode *spriteSheet = CCSpriteBatchNode::create("AnimBear.png");
this->addChild(spriteSheet);
//3) Gath
...