CCPointArray Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | NSCopying |
| Declared in | CCActionCatmullRom.h |
Overview
A simple array containing CGPoint values wrapped in NSValue objects so they can be stored in an NSMutableArray. This class is only documented for reference.
CCPointArray is used internally by the following spline movement actions:
Note: The documentation of this class is provided as reference only since the above actions expose it, and require a CCPointArray object as input. Except for those actions you should refrain from using this class. It may be refactored.
Creating a Point Array
+ arrayWithCapacity:
Creates and initializes a Points array with capacity.
+ (id)arrayWithCapacity:(NSUInteger)capacityParameters
capacity |
Capacity of the array. |
|---|
Return Value
New point array.
See Also
Declared In
CCActionCatmullRom.h
– initWithCapacity:
Initializes a Points array with capacity.
- (id)initWithCapacity:(NSUInteger)capacityParameters
capacity |
Capacity of the array. |
|---|
Return Value
New point array.
See Also
Declared In
CCActionCatmullRom.h
Adding and Removing Points
– addControlPoint:
Appends a control point.
- (void)addControlPoint:(CGPoint)controlPointParameters
controlPoint |
Control point to append. |
|---|
Declared In
CCActionCatmullRom.h
– insertControlPoint:atIndex:
Inserts a controlPoint.
- (void)insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)indexParameters
controlPoint |
Control point to insert. |
|---|---|
index |
Index of point. |
Declared In
CCActionCatmullRom.h
– replaceControlPoint:atIndex:
Replaces an existing control point.
- (void)replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)indexParameters
controlPoint |
New control point. |
|---|---|
index |
Index of point to replace. |
Declared In
CCActionCatmullRom.h
– removeControlPointAtIndex:
Deletes a control point.
- (void)removeControlPointAtIndex:(NSUInteger)indexParameters
index |
Index of control point to delete. |
|---|
Declared In
CCActionCatmullRom.h
Accessing Points
– getControlPointAtIndex:
Retrieves a control point.
- (CGPoint)getControlPointAtIndex:(NSInteger)indexParameters
index |
Index of control point to retrieve. |
|---|
Return Value
A control point.
Declared In
CCActionCatmullRom.h
– count
Returns the number of control points in the array.
- (NSUInteger)countReturn Value
Number of control points.
Declared In
CCActionCatmullRom.h
Reversing the Order of Points
– reverse
Creates a new copy of the array, in reversed order. User is responsible for releasing this array.
- (CCPointArray *)reverseReturn Value
New point array.
Declared In
CCActionCatmullRom.h
– reverseInline
Reverses the current control point array.
- (void)reverseInlineDeclared In
CCActionCatmullRom.h