Skip to content

CleanPolyline

Juju Adams edited this page Mar 22, 2021 · 10 revisions

 

CleanPolyline(pointArray)

Returns: Polyline struct

Name Datatype Purpose
pointArray array Array of x/y coordinate pairs for sequential points on the polyline

N.B. A shape will only draw when you call the .Draw() method. Polylines tend not to cope well with very sharp angles and very short distances so be careful about the geometry you're trying to draw.

 

Polyline structs have the following methods:

 

.Draw()

Returns: N/A (undefined)

Name Datatype Purpose
None

 

.Blend(color, alpha)

Returns: self

Name Datatype Purpose
color 24-bit color Color of the line
alpha number Alpha value of the line

 

.BlendExt(array)

Returns: self

Name Datatype Purpose
array array Array of color/alpha pairs corresponding to points on the polyline

Multi-vertex blending uses triangle-based interpolation and can look ugly with large differences in colour. Use with caution!

 

.Thickness(pixels)

Returns: self

Name Datatype Purpose
pixels number Width of the line

 

.Cap(startType, endType)

Returns: self

Name Datatype Purpose
startType string Cap type for the start of the line, either "none", "square", "round", or "closed"
endType string Cap type for the end of the line, either "none", "square", "round", "closed"

If either cap type is "closed" then the polyline will be a closed loop with no caps.

 

.Join(type)

Returns: self

Name Datatype Purpose
type string Join type, either "none", "miter", "bevel", or "round"