Classes
Methods
font(fontName) → {TextPrimitive}
Specify the name of the font used for the text.
Parameters:
Name | Type | Description |
---|---|---|
fontName |
string | the name of the font to use |
- Source:
Returns:
- Type
- TextPrimitive
font(fontName) → {TextPrimitive}
Specify the name of the font used for the text.
Parameters:
Name | Type | Description |
---|---|---|
fontName |
string | the name of the font to use |
- Source:
Returns:
- Type
- TextPrimitive
measureWidth() → {number}
Calculates the width of the text in pixels with
the currently assigned properties.
WARNING: can be slow and probably always is
- Source:
Returns:
- the width of the text in pixels
- Type
- number
measureWidth() → {number}
Calculates the width of the text in pixels with
the currently assigned properties.
WARNING: can be slow and probably always is
- Source:
Returns:
- the width of the text in pixels
- Type
- number
size(fontSize) → {TextPrimitive}
Specify the font size in pixels.
Parameters:
Name | Type | Description |
---|---|---|
fontSize |
number | the font size in pixels |
- Source:
Returns:
- Type
- TextPrimitive
size(fontSize) → {TextPrimitive}
Specify the font size in pixels.
Parameters:
Name | Type | Description |
---|---|---|
fontSize |
number | the font size in pixels |
- Source:
Returns:
- Type
- TextPrimitive
text(text) → {TextPrimitive}
Specify the string that the text displays.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the string to display |
- Source:
Returns:
- Type
- TextPrimitive
text(text) → {TextPrimitive}
Specify the string that the text displays.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the string to display |
- Source:
Returns:
- Type
- TextPrimitive