![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCProgressTimer.h>
Public Member Functions | |
(id) | - initWithSprite: |
Static Public Member Functions | |
(id) | + progressWithSprite: |
Protected Attributes | |
CCProgressTimerType | _type |
float | _percentage |
CCSprite * | _sprite |
int | _vertexDataCount |
ccV2F_C4B_T2F * | _vertexData |
CGPoint | _midpoint |
CGPoint | _barChangeRate |
BOOL | _reverseDirection |
Properties | |
CCProgressTimerType | type |
BOOL | reverseDirection |
ccV2F_C4B_T2F * | vertexData |
int | vertexDataCount |
CGPoint | midpoint |
CGPoint | barChangeRate |
float | percentage |
CCSprite * | sprite |
CCProgresstimer is a subclass of CCNode. It renders the inner sprite according to the percentage. The progress can be Radial, Horizontal or vertical.
- (id) initWithSprite: | (CCSprite *) | sprite |
Initializes a progress timer with the sprite as the shape the timer goes through
+ (id) progressWithSprite: | (CCSprite *) | sprite |
Creates a progress timer with the sprite as the shape the timer goes through
- (CGPoint) barChangeRate [read, write, assign] |
This allows the bar type to move the component at a specific rate Set the component to 0 to make sure it stays at 100%. For example you want a left to right bar but not have the height stay 100% Set the rate to be ccp(0,1); and set the midpoint to = ccp(0,.5f);
- (CGPoint) midpoint [read, write, assign] |
Midpoint is used to modify the progress start position. If you're using radials type then the midpoint changes the center point If you're using bar type the the midpoint changes the bar growth it expands from the center but clamps to the sprites edge so: you want a left to right then set the midpoint all the way to ccp(0,y) you want a right to left then set the midpoint all the way to ccp(1,y) you want a bottom to top then set the midpoint all the way to ccp(x,0) you want a top to bottom then set the midpoint all the way to ccp(x,1)
- (float) percentage [read, write, assign] |
Percentages are from 0 to 100
- (CCProgressTimerType) type [read, write, assign] |
Change the percentage to change progress.