Inherits from CCNode : CCResponder : NSObject
Declared in CCProgressNode.h

Overview

CCProgressNode displays a sprite with a progressive reveal.

Notes

  • Progress type can currently be Radial, Horizontal or vertical.
  • Midpoint is used to modify the start position:

    • Radial type the mid point changes the center point.
    • Bar type the midpoint changes the bar growth, it expands from the center but clamps to the sprites edge:
      • Left -> Right use (0,0)
      • Right -> Left use (1,y)
      • Bottom -> Top use (x,0)
      • Top -> Bottom use (x,1)
  • Progress percentage is 0 -> 100.

  • Bar change rate allows the bar type to move the component at a specific rate.
    • Set the rate to zero to make sure it stays at 100%
    • Example: If you want a Left -> Right bar and also have the height grow set the rate to (0,1) and modpoint to (0,0.5f)

Tasks

Accessing the Progress Node Attributes

Creating a CCProgressNode Object

Initializing a CCProgressNode Object

Properties

barChangeRate

Bar change rate.

@property (nonatomic, readwrite) CGPoint barChangeRate

Declared In

CCProgressNode.h

midpoint

Progress start position.

@property (nonatomic, readwrite) CGPoint midpoint

Declared In

CCProgressNode.h

percentage

Progress percentage.

@property (nonatomic, readwrite) float percentage

Declared In

CCProgressNode.h

reverseDirection

Reverse progress direction. 
@property (nonatomic, readwrite) BOOL reverseDirection

Declared In

CCProgressNode.h

sprite

The Sprite to use.

@property (nonatomic, readwrite, strong) CCSprite *sprite

Declared In

CCProgressNode.h

type

Progress type. 
@property (nonatomic, readwrite) CCProgressNodeType type

Declared In

CCProgressNode.h

Class Methods

progressWithSprite:

Creates and returns a progress node object using the specified sprite value.

+ (id)progressWithSprite:(CCSprite *)sprite

Parameters

sprite

The CCSprite to use.

Return Value

The CCProgressNode Object.

Declared In

CCProgressNode.h

Instance Methods

initWithSprite:

Initializes and returns a progress node object using the specified sprite value.

- (id)initWithSprite:(CCSprite *)sprite

Parameters

sprite

The CCSprite to use.

Return Value

An initialized CCProgressNode Object.

Declared In

CCProgressNode.h