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.
-
reverseDirection
property -
vertexData
property -
vertexDataCount
property -
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);
-
percentage
Percentages are from 0 to 100
property -
sprite
The 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 barChangeRate
Declared In
CCProgressTimer.h
midpoint
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 midpoint
Declared In
CCProgressTimer.h
percentage
Percentages are from 0 to 100
@property (nonatomic, readwrite) float percentage
Declared In
CCProgressTimer.h
sprite
The image to show the progress percentage
@property (nonatomic, readwrite, retain) CCSprite *sprite
Declared In
CCProgressTimer.h
Class Methods
progressWithFile:
Creates a progress timer with an image filename as the shape the timer goes through
+ (id)progressWithFile:(NSString *)filename
Declared In
CCProgressTimer.h
Instance Methods
initWithFile:
Initializes a progress timer with an image filename as the shape the timer goes through
- (id)initWithFile:(NSString *)filename
Declared In
CCProgressTimer.h