- CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
- cache->addSpriteFramesWithFile("test.plist", "test.png");
-
- /* 创建Sprite */
- CCSprite* s1 = CCSprite::createWithSpriteFrame(cache->spriteFrameByName("g_good.png"));
-
- s1->setPosition(ccp(100, 100));
- addChild(s1);
-
- CCSprite* s2 = CCSprite::createWithSpriteFrame(cache->spriteFrameByName("musicBtn.png"));
-
- s2->setPosition(ccp(300, 300));
- addChild(s2);
|