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() -> drawable 

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

transform:

The transformation matrix.

drawables:

The drawables to transform.

path

path() -> drawable 

Creates a path drawable from path segements.

segments:

The segments to create the path from.

close:

Default: false

If true the path will be closed.

fill:

Default: none

The color to fill the path with.

stroke:

Default: none

The stroke of the path.

content

content() -> drawable 

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() -> drawable 

Creates a path drawable in the shape of an ellipse.

The xx position of the ellipse.

The yy position of the ellipse.

The zz position of the ellipse.

The radius of the ellipse in the xx axis.

The radius of the ellipse in the yy axis.

fill:

Default: none

The color to fill the ellipse with.

stroke:

Default: none

The stroke of the ellipse's path.

arc

arc() -> drawable 

Creates a path drawable in the shape of an arc.

The xx position of the start of the arc.

The yy position of the start of the arc.

The zz 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 xx axis.

The radius of the arc in the yy axis.

mode:

Default: "OPEN"

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:

Default: none

The color to fill the arc with.

stroke:

Default: none

The stroke of the arc's path.