Skip to main content

drawable

A dictionary that contains path or content data that will actually get drawn by the canvas. Can also be an array of this type.

apply-transform​

apply-transform() 

Applies a transform to drawables. If a single drawable is given it will be returned in a single element array</Type>.

transform:

​

The transformation matrix.

drawables:

​

The drawables to transform.

apply-tags​

apply-tags() 

Adds tags to one or more drawables.

drawables:

​

A single drawable or an array of type:drawable.

..tags:

​

The list of tags to add to the drawable

filter-tagged​

filter-tagged() 

Filter out all drawables that have one of the given tags assigned.

drawables:

​

A single drawable or an array of type:drawables.

..tags:

​

The list of tags to use as a filter.

path​

path() 

Creates a path drawable from path segements.

segments:

​

The segments to create the path from.

close:

​

If true the path will be closed.

fill:

​

The color to fill the path with.

fill-rule:

​

One of “even-odd” or “non-zero”.

stroke:

​

The stroke of the path.

line-strip​

line-strip() 

Construct a line-strip from a list of points

points:

​

Array of points

close:

​

fill:

​

stroke:

​

fill-rule:

​

content​

content() 

Creates a content drawable.

The position of the drawable.

width:

​

The width of the drawable.

height:

​

The height of the drawable.

border:

​

A segment to define the border of the drawable with.

The content of the drawable.

ellipse​

ellipse() 

Creates a path drawable in the shape of an ellipse.

The 𝑥 position of the ellipse.

The 𝑦 position of the ellipse.

The 𝑧 position of the ellipse.

The radius of the ellipse in the 𝑥 axis.

The radius of the ellipse in the 𝑦 axis.

fill:

​

The color to fill the ellipse with.

stroke:

​

The stroke of the ellipse’s path.

arc​

arc() 

Creates a path drawable in the shape of an arc.

The 𝑥 position of the start of the arc.

The 𝑦 position of the start of the arc.

The 𝑧 position of the start of the arc.

start:

​

The angle along an ellipse to start drawing the arc from.

stop:

​

The angle along an ellipse to stop drawing the arc at.

The radius of the arc in the 𝑥 axis.

The radius of the arc in the 𝑦 axis.

mode:

​

How to draw the arc: "OPEN" leaves the path open, "CLOSED" closes the arc by drawing a straight line between the end of the arc and its start, "PIE" also closes the arc by drawing a line from its end to its origin then to its start.

fill:

​

The color to fill the arc with.

stroke:

​

The stroke of the arc’s path.