class Text
- Extends:
- Shape
Description:
Text shape is used to draw text as a shape. It can also have a Stroke, background, and everything like other shapes have.
In Text shape you can also specify font parameters, like name, size, underlines, italic, bold, strikethrough and more. Check out FontFamily enum for generic font family names that can be used for cross-platform compatibility.
Constructor
constructor(text, [font], [stroke=null], [background="#000000"], [opacity=1], [x=0], [y=0])
Constructor of Text shape. Color, Gradient, or background image are specified in "background" argument, because it's a Shape.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
Text to be drawn as shape |
|
|
|
Font object, such as {size: 13, name: "sans-serif", ...}. |
||
|
|
null |
Stroke object. |
|
|
|
string |
"#000000" |
Background string, CSS style. See Shape > background for details. |
|
|
number |
1 |
Opacity of the shape. Valid value is a decimal between 0 - 1. |
|
|
number |
0 |
X position of top-left corner of text |
|
|
number |
0 |
Y position of top-left corner of text |
Members
- [ readonly ] parent
