Initializer

init(rect:)

Creates a shape node with a rectangular path.

Declaration

convenience init(rect: CGRect)

Parameters

rect

A rectangle, relative to the node’s origin.

Return Value

A new shape node.

See Also

Creating a Shape from a Rectangle

init(rectOf: CGSize)

Creates a shape node with a rectangular path centered on the node’s origin.

init(rect: CGRect, cornerRadius: CGFloat)

Creates a shape with a rectangular path that has rounded corners.

init(rectOf: CGSize, cornerRadius: CGFloat)

Creates a shape with a rectangular path that has rounded corners centered on the node’s position.