CCProgressTimer Class Reference
| Inherits from | CCNodeRGBA : CCNode : NSObject |
| Declared in | CCProgressTimer.h |
Overview
CCProgresstimer is a subclass of CCNode. It renders the inner sprite according to the percentage. The progress can be Radial, Horizontal or vertical.
Tasks
Other Methods
-
type
propertyChange the percentage to change progress. -
reverseDirectionproperty -
vertexDataproperty -
vertexDataCountproperty -
midpoint
propertyMidpoint 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) -
barChangeRate
propertyThis 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); -
percentagePercentages are from 0 to 100
property -
spriteThe image to show the progress percentage
property -
+ progressWithSprite:Creates a progress timer with the sprite as the shape the timer goes through
-
– initWithSprite:Initializes a progress timer with the sprite as the shape the timer goes through
Other Methods
-
+ progressWithFile:Creates a progress timer with an image filename as the shape the timer goes through
-
– initWithFile:Initializes a progress timer with an image filename as the shape the timer goes through
-
+ progressWithTexture:Creates a progress timer with the texture as the shape the timer goes through
-
– initWithTexture:Creates a progress timer with the texture as the shape the timer goes through
Properties
barChangeRate
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);
@property (nonatomic, readwrite) CGPoint barChangeRateDeclared In
CCProgressTimer.hmidpoint
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)
@property (nonatomic, readwrite) CGPoint midpointDeclared In
CCProgressTimer.hpercentage
Percentages are from 0 to 100
@property (nonatomic, readwrite) float percentageDeclared In
CCProgressTimer.hsprite
The image to show the progress percentage
@property (nonatomic, readwrite, retain) CCSprite *spriteDeclared In
CCProgressTimer.hClass Methods
progressWithFile:
Creates a progress timer with an image filename as the shape the timer goes through
+ (id)progressWithFile:(NSString *)filenameDeclared In
CCProgressTimer.hInstance Methods
initWithFile:
Initializes a progress timer with an image filename as the shape the timer goes through
- (id)initWithFile:(NSString *)filenameDeclared In
CCProgressTimer.h