class Line
- Extends:
- Shape
Description:
A Line shape that extends the Shape class.
Line is a geometric line that doesn't have an area to be filled. For the line to be visible you specify the stroke size to be more that 0.
Line points are relative to the position of the Line shape. If you daw multiple lines that are related to each other, make sure to set same position for each of the lines.
Constructor
constructor(stroke, opacity, [x=0], [y=0], [point1], [point2])
Creates an instance of a Line shape.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
A border of the shape. |
||
|
|
number |
1 |
Opacity of the shape (0 to 1). |
|
|
number |
0 |
Horizontal position from the left edge. |
|
|
number |
0 |
Vertical position from the top edge. |
|
|
number |
An object with X and Y coordinates {x: number, y: number}. |
|
|
|
number |
An object with X and Y coordinates {x: number, y: number}. |
Members
- [ readonly ] parent
Methods
From this class:
Inherited from Shape:
- add()
- anchor()
- angle()
- background()
- intersect()
- intersects()
- opacity()
- position()
- stroke()
- subtract()
- visible()
- x()
- y()
