How to use CCProgressTimer in Cocos2D to show progress?

By | April 7, 2012

The progress timer takes a
sprite and, based on a percentage, displays only a part of it to visualize some kind of
progress in your game.

CCProgressTimer* timer = [CCProgressTimer progressWithFile:@"progress.png"];
timer.type = kCCProgressTimerTypeRadialCCW;
timer.percentage = 0;
[self addChild:timer z:1 tag: my_tag];
// The update is needed for the progress timer.
[self scheduleUpdate];

You can choose between radial, vertical, and horizontal progress timers. But the timer doesn’t update itself. You have to change the timer’s percentage value frequently to update the progress.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Reply

Your email address will not be published. Required fields are marked *