CCprogressTimer

手机游戏源码VIP金牌  一次购买全店免费!

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}

猜你喜欢

转载自blog.csdn.net/looffer/article/details/8952374