3.18 CCProgressTo 进度计时器
CCProgressTimer * pross = CCProgressTimer::create(CCSprite::create("Icon.png")); pross->setPosition(ccp(100,180)); //设置进度条的样式 扇形
pross->setType( kCCProgressTimerTypeRadial); //设置进度值范围[0,100] pross->setPercentage(100); //反进度计时 pross->setReverseProgress(true); addChild(pross); CCProgressTo *to1 = CCProgressTo::create(2, 100); pross->runAction( CCRepeatForever::create(to1)); //一直循环 CCProgressTimer * prossR = CCProgressTimer::create(CCSprite::create("Icon.png")); prossR->setPosition(ccp(210,180)); //设置进度条的样式 条形
prossR->setType( kCCProgressTimerTypeBar ); //设置计时器运动方向
/*
ccp(0,y); 左 -> 右
ccp(1,y); 右 -> 左
ccp(x,0); 底部 -> 顶部
ccp(x,1); 顶部 -> 底部
*/
prossR->setMidpoint(ccp(0,1)); //设置计时器的宽高起始比例 ccp(1,1)起始计时器的宽高为0 ccp(0,0) 起始计时器的宽高为100%
prossR->setBarChangeRate(ccp(0, 1)); addChild(prossR); CCProgressTo *to2 = CCProgressTo::create(2, 100); prossR->runAction( CCSequence::create(to2,NULL));//循环一次
Dreams are one of those things that keep you going and happy!!!