Properties:
Name | Type | Description |
---|---|---|
anchor |
PointData | number |
The anchor point of the text. |
resolution |
number |
The resolution of the text. |
roundPixels |
boolean |
Whether or not to round the x/y position. |
style |
TextStyle | TextStyle<Partial> | TextStyleOptions | HTMLTextStyle | Partial<HTMLTextStyle> | HTMLTextStyleOptions |
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 | number
The anchor point of the text.
The resolution of the text.
Whether or not to round the x/y position.
style TextStyle | TextStyle<Partial> | TextStyleOptions | HTMLTextStyle | Partial<HTMLTextStyle> | HTMLTextStyleOptions
The text style
text TextString
The copy for the text object. To split a line you can use '\n'.