Properties:
Name | Type | Description |
---|---|---|
anchor |
PointData |
The anchor point of the text. |
renderMode |
"canvas" | "html" | "bitmap" |
the render mode - |
resolution |
number |
The resolution of the text. |
roundPixels |
boolean |
Whether or not to round the x/y position. |
style |
TextStyle | HTMLTextStyleOptions | HTMLTextStyle |
The text style |
text |
TextString |
The copy for the text object. To split a line you can use '\n'. |
Example
const text = new Text({
text: 'Hello Pixi!',
style: {
fontFamily: 'Arial',
fontSize: 24,
fill: 0xff1010,
align: 'center',
}
});
Extends
Members
anchor PointData
The anchor point of the text.
the render mode - canvas
renders to a single canvas, html
renders using css, bitmap
uses a bitmap font
The resolution of the text.
Whether or not to round the x/y position.
style TextStyle | HTMLTextStyleOptions | HTMLTextStyle
The text style
The copy for the text object. To split a line you can use '\n'.