1、方式一

 

   CCSize s =CCDirector::sharedDirector()->getWinSize();

   CCTexture2D* texture =CCTextureCache::sharedTextureCache()->addImage("background.png");

   CCSprite* sp = CCSprite::createWithTexture(texture);

   sp->setPosition(ccp(s.width/2,s.height/2));

    this->addChild(sp)

2、方式二

 

   CCSprite* sp1 =CCSprite::create("s_hurt.png");

   this->addChild(sp1);

3、方式三

 

CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();

   cache->addSpriteFramesWithFile("Zombie_default.plist");

   cache->addSpriteFramesWithFile("re.plist");

   

   CCSprite* sp=CCSprite::createWithSpriteFrameName("Zombie20.png");

   sp->setPosition(ccp(500,205));

   sp->setTag(20);

    this->addChild(sp);