setText(text, immediate) → {Phaser.Text}
The text to be displayed by this Text object.
Use a \n to insert a carriage return and split the text.
The text will be rendered with any style currently set.
Use the optional immediate
argument if you need the Text display to update immediately.
If not it will re-create the texture of this Text object during the next time the render
loop is called.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
text | string | <optional> | The text to be displayed. Set to an empty string to clear text that is already present. | |
immediate | boolean | <optional> | false | Update the texture used by this Text object immediately (true) or automatically during the next render loop (false). |
Returns
This Text instance.
- Source code: gameobjects/Text.js (Line 1252)
Please login to continue.