text(x, y, text, style, group) → {Phaser.Text}
Creates a new Text object.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x | number | <optional> | 0 | The x coordinate of the Text. The coordinate is relative to any parent container this text may be in. |
y | number | <optional> | 0 | The y coordinate of the Text. The coordinate is relative to any parent container this text may be in. |
text | string | <optional> | '' | The text string that will be displayed. |
style | object | <optional> | The style object containing style attributes like font, font size , etc. | |
group | Phaser.Group | <optional> | Optional Group to add the object to. If not specified it will be added to the World group. |
Returns
The newly created text object.
- Source code: gameobjects/GameObjectFactory.js (Line 318)
Please login to continue.