第一种:
CCSprite *s2=CCSprite::create("Icon.png");//是较暗的图片
s2->setPosition(ccp(200,200));
s2->setOpacity(50);
addChild(s2,0);
CCSprite *s=CCSprite::create("Icon.png");//是较亮的图片
CCProgressTo* to = CCProgressTo::create(5.0f, 100);
CCProgressTimer *pt=CCProgressTimer::create(s);
pt->setPosition(ccp(200,200));
pt->setType(cocos2d::CCProgressTimerType(kCCProgressTimerTypeRadial));
//pt->setType(cocos2d::CCProgressTimerType(kCCProgressTimerTypeBar));
this->addChild(pt,1);
CCProgressTo *t=CCProgressTo::create(8,100);
pt->runAction(CCRepeatForever::create(t));
CCSprite* ccps = CCSprite::create("Icon.png");
ccps->setPosition(ccp(size.width*0.8, size.height/2));
addChild(ccps);
第二种:
CCSprite* sp1 = CCSprite::create("Icon.png");
sp1->setPosition(ccp(size.width/2,size.height/2));
CCProgressTo* to = CCProgressTo::create(5.0f, 100);
CCProgressTimer* timer = CCProgressTimer::create(sp1);
timer->setPosition(ccp(size.width / 2, size.height / 2));
addChild(timer);
timer->setType(kCCProgressTimerTypeRadial);
timer->runAction(to);
addChild(sp1);
sp1->setOpacity(100);
CCSprite* ccps = CCSprite::create("Icon.png");
ccps->setPosition(ccp(size.width / 2, size.height*0.8));
addChild(ccps);
我认为第一种的效果比较好