打开然后将图片拖入
点击
回到项目中,添加现有项,得到
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("spriteframe.plist"); CCSpriteFrame* pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("12.png"); CCSprite *pSprite = CCSprite::spriteWithSpriteFrame(pFrame); pSprite->setPosition(ccp(CCDirector::sharedDirector()->getWinSize().width*0.5,CCDirector::sharedDirector()->getWinSize().height*0.5)); addChild(pSprite);