constructor(text, [font], [stroke], [background], [opacity], [x], [y])

Class: Text.

Description:

Constructor of Text shape. Color, Gradient, or background image are specified in "background" argument, because it's a Shape.

Parameters:

Name Type Default Description

text

string

Text to be drawn as shape

[font]

Font

Font object, such as {size: 13, name: "sans-serif", ...}.

[stroke]

Stroke

null

Stroke object.

[background]

string

"#000000"

Background string, CSS style. See Shape > background for details.

[opacity]

number

1

Opacity of the shape. Valid value is a decimal between 0 - 1.

[x]

number

0

X position of top-left corner of text

[y]

number

0

Y position of top-left corner of text

Also See: