init(shape:frame:rotation:fillColor:strokeColor:lineWidth:opacity:startLineMarker:endLineMarker:attributedText:allowedInteractions:autoresizing:id:)
Initializes and returns a new shape markup from the specified parameters.
Declaration
init(shape: ShapeMarkup.Shape, frame: CGRect, rotation: CGFloat = 0.0, fillColor: CGColor? = nil, strokeColor: CGColor? = nil, lineWidth: CGFloat = 1.0, opacity: CGFloat = 1.0, startLineMarker: ShapeMarkup.LineMarker = .none, endLineMarker: ShapeMarkup.LineMarker = .none, attributedText: AttributedString = Foundation.AttributedString(), allowedInteractions: MarkupInteractions = .all, autoresizing: MarkupAutoresizing = [], id: MarkupID<ShapeMarkup> = MarkupID())Parameters
- shape:
The shape to create.
- frame:
The frame of the shape.
- rotation:
The rotation in radians of the shape. Defaults to
0.0(no rotation). - fillColor:
The fill color of the shape. Defaults to
nil(no fill). - strokeColor:
The stroke color of the shape’s outline. Defaults to
nil(no stroke). - lineWidth:
The width of the shape’s stroke. Defaults to
1.0. - opacity:
The opacity of the shape, ranging from
0.0(fully transparent) to1.0(fully opaque). Defaults to1.0. - startLineMarker:
The marker style for the start of the line. Defaults to
.none. Only applicable for open shape paths. - endLineMarker:
The marker style for the end of the line. Defaults to
.none. Only applicable for open shape paths. - attributedText:
The attributed text displayed inside this shape. Defaults to the empty string.
- allowedInteractions:
The flags controlling the interactions users can perform. Defaults to
.all. - autoresizing:
The flags controlling autoresize behavior. Defaults to
[]. - id:
The identity of the shape. Defaults to a unique id.