Optional
style: Partial<ITextStyle>TextStyle properties to be set on the text. See PIXI.TextStyle.defaultStyle for the default values.
Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Protected
_Static
availableThe collection of installed fonts
Static
Readonly
defaultList of default options, these are largely the same as TextStyle, with the exception of whiteSpace, which is set to 'normal' by default.
Static
defaultDefault style options used for all TextStyle instances.
Alignment for multiline text, does not affect single line text
Indicates if lines can be wrapped within words, it needs wordWrap to be set to true.
Indicates if lines can be wrapped within words, it needs wordWrap to be set to true
Set a drop shadow for the text.
Set a drop shadow for the text
Set alpha for the drop shadow.
Set alpha for the drop shadow
Set a angle of the drop shadow.
Set a angle of the drop shadow
Set a shadow blur radius.
Set a shadow blur radius
A fill style to be used on the dropshadow e.g., 'red', '#00FF00'.
A fill style to be used on the dropshadow e.g., 'red', '#00FF00'
Set a distance of the drop shadow.
Set a distance of the drop shadow
A canvas fillstyle that will be used on the text e.g., 'red', '#00FF00'.
Can be an array to create a gradient e.g., ['#000000','#FFFFFF']
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN
A canvas fillstyle that will be used on the text e.g., 'red', '#00FF00'.
Can be an array to create a gradient, e.g., ['#000000','#FFFFFF']
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN
If fill is an array of colours to create a gradient, this array can set the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.
If fill is an array of colours to create a gradient, this array can set the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.
If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.
If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.
The font family, can be a single font name, or a list of names where the first is the preferred font.
The font family, can be a single font name, or a list of names where the first is the preferred font.
The font size (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')
The font size (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')
The space between lines.
The space between lines.
The amount of spacing between letters, default is 0.
The amount of spacing between letters, default is 0
The line height, a number that represents the vertical space that a letter uses.
The line height, a number that represents the vertical space that a letter uses
The lineJoin property sets the type of corner created, it can resolve spiked text issues. Default is 'miter' (creates a sharp corner).
The lineJoin property sets the type of corner created, it can resolve spiked text issues. Default is 'miter' (creates a sharp corner).
The miter limit to use when using the 'miter' lineJoin mode.
This can reduce or increase the spikiness of rendered text.
The miter limit to use when using the 'miter' lineJoin mode.
This can reduce or increase the spikiness of rendered text.
Occasionally some fonts are cropped. Adding some padding will prevent this from happening by adding padding to all sides of the text.
Occasionally some fonts are cropped. Adding some padding will prevent this from happening by adding padding to all sides of the text.
A canvas fillstyle that will be used on the text stroke, e.g., 'blue', '#FCFF00'
A canvas fillstyle that will be used on the text stroke, e.g., 'blue', '#FCFF00'
A number that represents the thickness of the stroke. A value of 0 will disable stroke.
Internal stylesheet contents, useful for creating rules for rendering
Trim transparent borders.
Trim transparent borders.
How newlines and spaces should be handled. Default is 'pre' (preserve, preserve).
value | New lines | Spaces |
---|---|---|
'normal' | Collapse | Collapse |
'pre' | Preserve | Preserve |
'pre-line' | Preserve | Collapse |
Determines whether newlines & spaces are collapsed or preserved "normal" (collapse, collapse), "pre" (preserve, preserve) | "pre-line" (preserve, collapse). It needs wordWrap to be set to true.
Indicates if word wrap should be used.
Indicates if word wrap should be used
The width at which text will wrap, it needs wordWrap to be set to true.
The width at which text will wrap, it needs wordWrap to be set to true
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.
CSS style(s) to add.
Clear the current font
Creates a new TextStyle object with the same values as this one. Note that the only the properties of the object are cloned.
New cloned TextStyle object
Because of how HTMLText renders, fonts need to be imported
Optional
options: Partial<IHTMLTextFontOptions>Resets all properties to the defaults specified in TextStyle.prototype._default
Internally converts all of the style properties into CSS equivalents.
The CSS style string, for setting style
property of root HTMLElement.
Generates a font style string to use for TextMetrics.measureFont()
.
Font style string, for passing to TextMetrics.measureFont()
Get the font CSS styles from the loaded font, If available.
Static
fromConvert a TextStyle to HTMLTextStyle
Used internally to restrict text style usage and convert easily to CSS.
Memberof
PIXI
Param: style
Style to copy.
Since
7.2.0