Extends
Methods
Add a style override, this can be any CSS property
it will override any built-in style. This is the
property and the value as a string (e.g., color: red).
This will override any other internal style.
| Name | Type | Description |
|---|---|---|
value |
string |
CSS style(s) to add. |
Example
style.addOverride('background-color: red');
Remove any overrides that match the value.
| Name | Type | Description |
|---|---|---|
value |
string |
CSS style to remove. |
Example
style.removeOverride('background-color: red');
Inherited Properties
From class TextStyle
_fill ConvertedFillStyle inherited
_stroke ConvertedStrokeStyle inherited
align 'left' | 'center' | 'right' | 'justify' inherited
See TextStyle.align
- Default Value:
- "left"
breakWords boolean inherited
- Default Value:
- false
dropShadow TextDropShadow inherited
fill string | Array<string> | number | Array<number> | CanvasGradient | CanvasPattern inherited
See TextStyle.fill
- Default Value:
- "black"
fontFamily string | Array<string> inherited
- Default Value:
- "Arial"
fontSize number | string inherited
- Default Value:
- 26
fontStyle 'normal' | 'italic' | 'oblique' inherited
- Default Value:
- "normal"
fontVariant 'normal' | 'small-caps' inherited
- Default Value:
- "normal"
fontWeight 'normal' | 'bold' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' inherited
- Default Value:
- "normal"
leading number inherited
- Default Value:
- 0
letterSpacing number inherited
- Default Value:
- 0
lineHeight number inherited
- Default Value:
- 0
padding number inherited
- Default Value:
- 0
stroke string | number inherited
See TextStyle.stroke
- Default Value:
- undefined
textBaseline 'alphabetic' | 'top' | 'hanging' | 'middle' | 'ideographic' | 'bottom' inherited
- Default Value:
- "alphabetic"
whiteSpace 'normal' | 'pre' | 'pre-line' inherited
- Default Value:
- "pre"
wordWrap boolean inherited
- Default Value:
- false
wordWrapWidth number inherited
- Default Value:
- 100
Inherited Methods
From class TextStyle
destroy (options) inherited
Destroys this text style.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
options |
TypeOrBool<TextureDestroyOptions> | false |
Options parameter. A boolean will act as if all options have been set to that value |
|
options.texture |
boolean |
<optional> |
false |
Should it destroy the texture of the this style |
options.textureSource |
boolean |
<optional> |
false |
Should it destroy the textureSource of the this style |