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)capacity
Parameters
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)capacity
Parameters
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)controlPoint
Parameters
controlPoint |
Control point to append. |
---|
Declared In
CCActionCatmullRom.h
– insertControlPoint:atIndex:
Inserts a controlPoint.
- (void)insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index
Parameters
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)index
Parameters
controlPoint |
New control point. |
---|---|
index |
Index of point to replace. |
Declared In
CCActionCatmullRom.h
– removeControlPointAtIndex:
Deletes a control point.
- (void)removeControlPointAtIndex:(NSUInteger)index
Parameters
index |
Index of control point to delete. |
---|
Declared In
CCActionCatmullRom.h
Accessing Points
– getControlPointAtIndex:
Retrieves a control point.
- (CGPoint)getControlPointAtIndex:(NSInteger)index
Parameters
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)count
Return 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 *)reverse
Return Value
New point array.
Declared In
CCActionCatmullRom.h
– reverseInline
Reverses the current control point array.
- (void)reverseInline
Declared In
CCActionCatmullRom.h