![]() |
API 0.9.5
|
#import <CPBezierPath.h>
Instance Methods | |
(void) | - appendBezierPath: |
(void) | - appendBezierPathWithOvalInRect: |
(void) | - appendBezierPathWithPoints:count: |
(void) | - appendBezierPathWithRect: |
(void) | - appendBezierPathWithRoundedRect:xRadius:yRadius: |
(void) | - closePath |
(CGPoint) | - currentPoint |
(void) | - curveToPoint:controlPoint1:controlPoint2: |
(unsigned) | - elementCount |
(void) | - fill |
(id) | - init |
(BOOL) | - isEmpty |
(void) | - lineToPoint: |
(float) | - lineWidth |
(void) | - moveToPoint: |
(void) | - removeAllPoints |
(void) | - setLineWidth: |
(void) | - stroke |
Class Methods | |
(CPBezierPath) | + bezierPath |
(CPBezierPath) | + bezierPathWithOvalInRect: |
(CPBezierPath) | + bezierPathWithRect: |
(float) | + defaultLineWidth |
(void) | + fillRect: |
(void) | + setDefaultLineWidth: |
(void) | + strokeLineFromPoint:toPoint: |
(void) | + strokeRect: |
A CPBezierPath allows you to create paths for drawing to the screen using a simpler API than CoreGraphics. Paths can form any shape, including regular polygons like squares and triangles; circles, arcs; or complex line segments.
A path can be stroked and filled using the relevant method. The currently active fill and stroke color will be used, which can be set by calling setFill: and setStroke: on any CPColor object (or set: for both).
Definition at line 2 of file CPBezierPath.h.
- (void) appendBezierPath: | (NSBezierPath *) | other |
Append the contents of a CPBezierPath object.
Definition at line 277 of file CPBezierPath.j.
- (void) appendBezierPathWithOvalInRect: | (CGRect) | rect |
Append an oval path; oval is drawn within the rectangular path.
Definition at line 261 of file CPBezierPath.j.
- (void) appendBezierPathWithPoints: | (CPArray) | points | |
count: | (unsigned) | count | |
Append a series of line segments.
Definition at line 245 of file CPBezierPath.j.
- (void) appendBezierPathWithRect: | (CGRect) | rect |
Append a rectangular path.
Definition at line 253 of file CPBezierPath.j.
- (void) appendBezierPathWithRoundedRect: | (CGRect) | rect | |
xRadius: | (float) | xRadius | |
yRadius: | (float) | yRadius | |
Append a rounded rectangular path.
Definition at line 269 of file CPBezierPath.j.
+ (CPBezierPath) bezierPath |
Create a new CPBezierPath object.
Definition at line 55 of file CPBezierPath.j.
+ (CPBezierPath) bezierPathWithOvalInRect: | (CGRect) | rect |
Create a new CPBezierPath object initialized with an oval path drawn within a rectangular path.
Definition at line 63 of file CPBezierPath.j.
+ (CPBezierPath) bezierPathWithRect: | (CGRect) | rect |
Create a new CPBezierPath object initialized with a rectangular path.
Definition at line 75 of file CPBezierPath.j.
- (void) closePath |
Create a line segment between the first and last points in the subpath, closing it.
Definition at line 170 of file CPBezierPath.j.
- (CGPoint) currentPoint |
Get the current point.
Definition at line 237 of file CPBezierPath.j.
- (void) curveToPoint: | (CGPoint) | endPoint | |
controlPoint1: | (CGPoint) | controlPoint1 | |
controlPoint2: | (CGPoint) | controlPoint2 | |
Add a cubic Bezier curve to the path.
Definition at line 162 of file CPBezierPath.j.
+ (float) defaultLineWidth |
Get default line width.
Definition at line 87 of file CPBezierPath.j.
- (unsigned) elementCount |
Get the total number of elements.
Definition at line 221 of file CPBezierPath.j.
- (void) fill |
Fill the path with the current fill color.
Definition at line 191 of file CPBezierPath.j.
+ (void) fillRect: | (CGRect) | aRect |
Fill rectangular path with current fill color.
Definition at line 103 of file CPBezierPath.j.
- (id) init |
Create a new CPBezierPath object using the default line width.
Definition at line 132 of file CPBezierPath.j.
- (BOOL) isEmpty |
Check if receiver is empty, returns appropriate Boolean value.
Definition at line 229 of file CPBezierPath.j.
- (void) lineToPoint: | (CGPoint) | point |
Append a straight line to the path.
Definition at line 154 of file CPBezierPath.j.
- (float) lineWidth |
Get the line width.
Definition at line 205 of file CPBezierPath.j.
- (void) moveToPoint: | (CGPoint) | point |
Moves the current point to another location.
Definition at line 146 of file CPBezierPath.j.
- (void) removeAllPoints |
Remove all path elements; clears path.
Definition at line 285 of file CPBezierPath.j.
+ (void) setDefaultLineWidth: | (float) | width |
Set default line width.
Definition at line 95 of file CPBezierPath.j.
- (void) setLineWidth: | (float) | lineWidth |
Set the line width.
Definition at line 213 of file CPBezierPath.j.
- (void) stroke |
Draw a line along the path with the current stroke color and default drawing attributes.
Definition at line 178 of file CPBezierPath.j.
+ (void) strokeLineFromPoint: | (CGPoint) | point1 | |
toPoint: | (CGPoint) | point2 | |
Using the current stroke color and default drawing attributes, strokes a line between two points.
Definition at line 119 of file CPBezierPath.j.
+ (void) strokeRect: | (CGRect) | aRect |
Using the current stroke color and default drawing attributes, strokes a counterclockwise path beginning at the rectangle's origin.
Definition at line 111 of file CPBezierPath.j.