公共代码
CCProgressTo *to = CCProgressTo::create(5.0f,100); //参数1:时间,参数2:百分比
CCProgressTimer *timer = CCProgressTimer::create(CCSprite::create("CloseSelected.png"));
timer->setPosition(ccp(size.width*0.2,size.height/2));
addChild(timer);
1、扇形
timer->setType(kCCProgressTimerTypeRadial); //扇形:kCCProgressTimerTypeRadial
timer->runAction(to);
2、条形
timer->setType(kCCProgressTimerTypeBar);
timer->setBarChangeRate(ccp(1,0));//设置横向,纵向是(0,1)
timer->setMidpoint(ccp(0,0)); //设置从左往右移动,(1,0)是从右往左
timer->runAction(to);