cocos2d-x学习之进度条

/逐渐显示一个图片的动作,第二个参数是百分比

CCProgressTo *to1 = CCProgressTo::actionWithDuration(2, 100);

CCProgressTo *to2 = CCProgressTo::actionWithDuration(2, 100);

 

//建立CCProgressTimer对象,利用文件PathSister

CCProgressTimer *left = CCProgressTimer::progressWithFile(s_pPathSister1);

 

//顺时针旋转

left->setType( kCCProgressTimerTypeRadialCW );

//逆时针旋转

//left->setType( kCCProgressTimerTypeRadialCCW );

//水平的从左到右:kCCProgressTimerTypeHorizontalBarLR

//水平的从右到左:kCCProgressTimerTypeHorizontalBarRL

//垂直的从下往上:kCCProgressTimerTypeVerticalBarBT

//垂直的从上往下:kCCProgressTimerTypeVerticalBarTB

addChild(left);

left->setPosition(CCPointMake(100, s.height/2));

left->runAction( CCRepeatForever::actionWithAction(to1));

你可能感兴趣的:(cocos2d-x学习之进度条)