cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCProgressTimer Class Reference

#import <CCProgressTimer.h>

+ Inheritance diagram for CCProgressTimer:
+ Collaboration diagram for CCProgressTimer:

List of all members.

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_T2FvertexData
int vertexDataCount
CGPoint midpoint
CGPoint barChangeRate
float percentage
CCSpritesprite

Detailed Description

CCProgresstimer is a subclass of CCNode. It renders the inner sprite according to the percentage. The progress can be Radial, Horizontal or vertical.

Since:
v0.99.1

Member Function Documentation

- (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


Property Documentation

- (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

- (CCSprite*) sprite [read, write, retain]

The image to show the progress percentage

- (CCProgressTimerType) type [read, write, assign]

Change the percentage to change progress.


The documentation for this class was generated from the following file: