1、 CCProgressTo *to1 = CCProgressTo::create(2, 100);
create(float duration,float percent);
参数1是到达参数2所定百分比的时间。参数2是预定到达百分比。
2. CCProgressTimer *left = CCProgressTimer::create(CCSprite::create(s_pPathSister1));
3.left->setType( kCCProgressTimerTypeRadial );
type有两种类型:kCCProgressTimerTypeRadial =放射状,kCCProgressTimerTypeBar=条状。
4.放射状:kCCProgressTimerTypeRadial 对应可设置函数:
<1> right->setReverseProgress(true);
true=顺时针 false=逆时针
<2> right->setMidpoint(ccp(0.5f, 0.5f));
设置旋转中心点,里面的的参数与anchorpoint的参数设置一样是比例关系。
5.条状:kCCProgressTimerTypeBar对应可设置函数
<1> left->setMidpoint(ccp(0.5f, 0.5f));
<2> left->setBarChangeRate(ccp(1, 1));
上面两个参数要结合使用,如果只使用setMidpoint讲不会参摄渐变效果,直接显示精灵。
setBarChangeRate可看成设置变化方向,值为1或0,cpp(1,0)代表X方向双向渐变,Y方向不变,cpp(0,1)同理。
记录于2014年5月4号