CCProgressTimerCCProgressTo&CCProgressFromTo vary from to

CCProgressTimer按照我的理解就是对一个精灵的封装。
@property的属性有三个:
(1)CCSprite sprite;
(2)float percenta ge;
(3)CCProgressTimerType type;
typedef enum {
/// RadialCounter-Clockwise
kCCProgressTimerTypeRadialCCW,
/// RadialClockWise
kCCProgressTimerTypeRadialCW,
///Horizontal Left-Right
kCCProgressTimerTypeHorizontalBarLR,
///Horizontal Right-Left
kCCProgressTimerTypeHorizontalBarRL,
/// VerticalBottom-top
kCCProgressTimerTypeVerticalBarBT,
/// VerticalTop-Bottom
kCCProgressTimerTypeVerticalBarTB,
} CCProgressTimerType;
该类对象和CCProgressTo&CCProgressFromTo结合,实现图片的进度显示效果。其实CCProgressTimer完全可以独立于ProgressTo和ProgressFrom,自己完成一个schedule,不断的修改percent变量,实现自己想要的效果。

角度变换


上下递变


左右递变


例如下面代码:
CCProgressTimer *progressTimer = [CCProgressTimerprogressWithFile:@"Icon.png"];
[selfaddChild:progressTimer];
progressTimer.position = ccp(512,384);
CCProgressTo*action = [CCProgressTo actionWithDuration:3.0f percent:100];
[progressTimer runAction:action];
它的作业也就如它的名字,用作progress。

针对CCW或CW的Type,其实通过一定的修改可以用作制作技能的CD效果的。
不过是将percent修改为从100到0。
-(id) init
{
// alwayscall "super" init
// Applerecommends to re-assign "self" with the "super" return value
if((self=[super init])) {//


CCProgressTimer *timer = [CCProgressTimerprogressWithFile:@"ICon.png"];
[selfaddChild:timer z:0 tag:0];
timer.position = ccp(300,300);
timer.percentage = 100;
timer.type =kCCProgressTimerTypeRadialCCW;
[selfscheduleUpdate];
//CCProgressTo *action = [CCProgressTo actionWithDuration:3.0fpercent:100];
// [timerrunAction:action];
}
returnself;
}

- (void) update:(ccTime)dt
{
CCProgressTimer *time = (CCProgressTimer *)[selfgetChildByTag:0];
time.percentage -=1;
if(time.percentage == 0) {
time.percentage = 100;
}
}

  

爱华网本文地址 » http://www.aihuau.com/a/25101016/290376.html

更多阅读

Windows To Go windows to go win7

Windows To Go——简介Windows 8操作系统企业版内含一个Windows To Go的功能,简单地讲就是可以使用u盘将Windows 8操作系统装在u盘,这个所谓的工作区,就是和Windows 8操作系统相差无几(和传统的u盘PE系统不一样)。但是,很多人尝试安装失败

开机显示boot from CDDVD,不能进入系统 dvd boot

开机显示boot from CDDVD,不能进入系统——简介百度知友提出:电脑不能开机,只显示boot from CDDVD(图一)boot from CDDVD(图二)有些知友安装完系统后,开机就显示boot from CDDVD,不能进入系统,有两种可能,一是安装完系统后,没有取出光盘,只要

by,beside,near和nextto的区别 beside 和 next to

三个词都是"在旁边,在附近,靠近"的意思:但是表示远近时候还是有区别的。从近到一般近到最近为到:NEAR >BESIDE> NEXT TObeside“在…旁边”一般指空间上 Come and sit beside me.near:“不远的,接近的”指空间或时间上 the near future不

声明:《CCProgressTimerCCProgressTo&CCProgressFromTo vary from to》为网友以後的路分享!如侵犯到您的合法权益请联系我们删除