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

stroke

Stroke

A border of the shape.

opacity

number

1

Opacity of the shape (0 to 1).

[x]

number

0

Horizontal position from the left edge.

[y]

number

0

Vertical position from the top edge.

[point1]

number

An object with X and Y coordinates {x: number, y: number}.

[point2]

number

An object with X and Y coordinates {x: number, y: number}.

Members

Methods

From this class:

Inherited from Shape:

Also See: