Line
Line
is a layer that displays a straight line between a start point and an end point. This is a convenience layer that is the equivalent to a Path
layer containing a moveTo
, lineTo
and endPath
instruction sequence.
container.appendLineSublayer(
startPoint=(50, 50),
endPoint=(450, 150),
strokeWidth=20,
strokeColor=(1, 0, 0, 1)
)
Topics
Discussion
Properties
Refer to the properties concepts section for an overview of properties.
|
Set the value of multiple properties by name. |
|
Set property |
|
Create a context manager that allows setting multiple properties in an efficient way. |
Identification
|
Get the name assigned to this layer during |
|
Set |
|
Set |
Geometry
Refer to the geometry concepts section for an overview of geometry.
Get the anchor of the layer. |
|
|
Set the anchor of the layer. |
Get the position of this layer. |
|
|
Set the position of this layer. |
|
Get the size of this layer. |
|
Set the Size of this layer. |
Transformations
Get a list of all transformations. |
|
|
Add a transformation with |
|
Remove the transformation with |
|
Add a translate transformation with |
|
Add a scale transformation with |
|
Add a rotation transformation with |
|
Add a skew transformation with |
|
Add a transformation with |
Remove the transformation with |
|
Add a sublayer translate transformation with |
|
|
Add a sublayer scale transformation with |
|
Add a sublayer scale transformation with |
|
Add a sublayer skew transformation with |
Frame
Get if the layer is visible. |
|
|
Set if the layer is visible. |
Get if the layer hides any sublayer data outside of its frame. |
|
|
set if the layer hides any sublayer data outside of its frame. |
Get the opacity of this layer. |
|
|
Set the opacity of this layer, |
Get the background color for this layer. |
|
|
Set the background color for this layer. |
Get the border color for this layer. |
|
|
Set the border color for this layer. |
Get the border width for this layer. |
|
|
Set the border width for this layer. |
Get this corner radius of this layer. |
|
|
Set the corner radius of this layer. |
Shadow
Get the shadow color for this layer. |
|
|
Set the shadow color for this layer. |
Get the shadow opacity for this layer. |
|
|
Set the shadow opacity for this layer. |
Get the shadow offset for this layer. |
|
|
Set the shadow offset for this layer. |
Get the shadow blur radius for this layer. |
|
|
Set the shadow blur radius for this layer. |
Filters
Refer the filter documentation in Base for complete details.
Set the compositing filter for the layer. |
|
|
Set the compositing filter for the layer. |
Get a list of the filters for this layer. |
|
|
Set a list of the filters for this layer. |
|
Append a filter to this layer. |
|
Get the filter with |
|
Remove the filter with |
Clear all background filters from this layer. |
|
Get a list of the background filters for this layer. |
|
|
Set a list of the background filters for this layer. |
|
Append a background filter to this layer. |
|
Get the background filter with |
|
Remove the background filter with |
Points
- Line.getStartPoint()
Get the start point of the line.
- Line.setStartPoint(point)
Set the start point of the line.
- Line.getEndPoint()
Get the end point of the line.
- Line.setEndPoint(point)
Set the end point of the line.
Path
|
Get the path assigned to this layer as a |
|
Set the path assigned to this layer. |
Get the fill color for this layer. |
|
|
Set the fill color for this layer. |
Get the stroke color for this layer. |
|
|
Set the stroke color for this layer. |
Get the stroke width for this layer. |
|
|
Set the stroke width for this layer. |
Get if the stroke width for this layer should always visually be the value of |
|
Set if the stroke width for this layer should always visually be the value of |
|
Get the stroke join style for this layer. |
|
|
Set the stroke join style for this layer. |
Get the stroke cap style for this layer. |
|
|
Set the stroke join cap for this layer. |
Get the stroke dash pattern for this layer. |
|
|
Set the stroke dash pattern for this layer. |
Get the start symbol settings for the path. |
|
|
Set the settings for a |
Get the end symbol settings for the path. |
|
|
Set the settings for a |
Animation
Refer to the animation concepts section for an overview of animation.
Remove all animations from this layer. |
|
|
Stop the animation with the |
Get if animation is currently paused for this layer. |
|
Pause the animation of this layer. |
|
Resume the animation of the layer. |
Sublayers
Refer to the layer hierarchy concepts section for an overview of sublayers.
|
Place a hold on adding the sublayers to this layer’s CALayer until the context manager exits. |
Get all sublayers within this layer. |
|
|
Get the sublayer with |
Remove all sublayers within this layer. |
|
|
Remove the given sublayer from the layer. |
|
Append an instantiated sublayer to this layer. |
|
Append a sublayer to this layer. |
|
Append a base layer. |
|
Append a path layer. |
|
Append a line layer. |
|
Append a oval layer. |
|
Append a rectangle layer. |
|
Append an image layer. |
|
Append a text box. |
|
Append a text line. |
|
Append a symbol. |
|
This creates a context manager that provides a sublayer creation syntax that supports a subset of the DrawBot API. |
Superlayers
Refer to the layer hierarchy concepts section for an overview of superlayers.
Get the Container that this layer belongs to. |
|
Get the layer that this layer belongs to. |
Hit Testing
CoreAnimation Object
Get the CALayer that this object wraps. |