class Stroke

Description:

Stroke (border) of any Shape (objects that extend Shape class).

Constructor

constructor([width=1], [background=#000000], [alignment], [cap], [join], [miterLimit=10], [dashSize=null], [dashGapSize=null], [dashPhase=0])

Create an instance of a Stroke object.

Parameters:

Name Type Default Description

[width]

number

1

Specifies the thickness of the line. Default is 1 pixel thick.

[background]

string

#000000

Stroke color. e.g. #008800. Setting gradients and a background image will be also possible in future.

[alignment]

Stroke.Alignment

Where stroke line is drawn: outside of shape, on the edge, or inside. Default is Center. Valid values: Stroke.Alignment.Outside, Stroke.Alignment.Center, Stroke.Alignment.Inside.

[cap]

Stroke.Cap

Defines the end cap style of the line. Default is Square. Valid values: Stroke.Cap.Square, Stroke.Cap.Butt, Stroke.Cap.Round.

[join]

Stroke.Join

Specifies the line join style. Default is Miter. Valid values: Stroke.Join.Miter, Stroke.Join.Bevel, Stroke.Join.Round.

[miterLimit]

number

10

Applicable when join is set to JOIN_MITER. It controls the maximum miter length. If the miter length exceeds this limit, the join is beveled instead.

[dashSize]

number

null

Size of a dash in a dash pattern,

[dashGapSize]

number

null

Size of gaps between dashes in dash pattern

[dashPhase]

number

0

Specifies the starting point of the dash pattern. It determines where in the dash pattern the line starts. A positive value shifts the pattern to the right, and a negative value shifts it to the left.

Members

Methods

From this class: