CCprogressTimer

Lets talk about the major changes:

Instantiation:
+ (id) progressWithSprite:(CCSprite*) sprite;
- (id) initWithSprite:(CCSprite*) sprite;

You can now do that by passing a sprite and that sprite can be from a sprite frame. Note that this is a MAJOR change so REALLY use the new properties to get the right progress look.

I've reduced the progress types to Radial and Bar and you change its look through the new properties I've added.

So lets look at the new properties.
reverse
If you want a counter-clockwise radial indicator then you can set the reverse property rather than setting the type like before. This reverse property allowed me to have a cool effect for bar progress timer types.

midpoint
Midpoint can also change the look of the radial/bar progression. It should usually be at {0.5, 0.5} so the radial looks like a clock. Modifying the midpoint moves the center around.

This is more important for the bar types since we can have more variety by modifying the midpoint. You can now have bar start at the left (0,0), right (1,0), top (0,1), or bottom (0,1). Actually anything in between as well.

barChangeRate
barChangeRate only works on the bar types and what it does is modify the rate that x and y would change due to the percentage.
So if you want a horizontal bar then the bar rate would be {1, 0} which means x will move at the rate of 1 percentage but y can't move at all (since it's 0).
With that kinda idea in mind, we can create a vertical bar like so: {0, 1}.
Or even a weird bar that can move both in the x and y but maybe slower on the y {1, 0.5}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值