Class
Path
public class Path : CanvasObject
Relationships
Superclass
CanvasObject
Initializers
init(fillMode:)
public init(fillMode:FillMode = .stroke)
Creates a new, empty Path
init(source:)
public init(source:Path)
Creates a new copy of the specified path
init(points:fillMode:)
public convenience init(points:[Point], fillMode:FillMode = .stroke)
Creates a Path
by moving to the first point in the array,
then drawing lines to each subsequent point,
and then closing the path
init(rect:radius:fillMode:)
public convenience init(rect:Rect, radius:Int = 0, fillMode:FillMode = .stroke)
Creates a Path
for a rounded rectangle and then closes the path
Parameters
Name | Type | Description |
---|---|---|
rect | Rect |
The |
radius | Int |
The radius for each corner; 0 indicates no rounding |
fillMode | FillMode |
The fillMode to use when rendering the |
Properties
fillMode
public var fillMode : FillMode
Methods
moveTo(_:)
public func moveTo(_ point:Point)
lineTo(_:)
public func lineTo(_ point:Point)
linesTo(_:)
public func linesTo(_ points:[Point])
rect(_:)
public func rect(_ rect:Rect)
arc(center:radius:startAngle:endAngle:antiClockwise:)
public func arc(center:Point, radius:Int, startAngle:Double=0.0, endAngle:Double=2.0*Double.pi,
antiClockwise:Bool = false)
arcTo(controlPoint1:controlPoint2:radius:)
public func arcTo(controlPoint1:Point, controlPoint2:Point, radius:Int)
quadraticCurveTo(controlPoint:endPoint:)
public func quadraticCurveTo(controlPoint:Point, endPoint:Point)
bezierCurveTo(controlPoint1:controlPoint2:endPoint:)
public func bezierCurveTo(controlPoint1:Point, controlPoint2:Point, endPoint:Point)
close()
public func close()