Implements
Methods
Name | Type | Attributes | Description |
---|---|---|---|
options |
TextOptions | string | ||
resolution |
number |
<optional> |
|
style |
TextStyle |
<optional> |
|
_textKey |
string |
<optional> |
Returns:
Type | Description |
---|---|
Texture |
Renders text to its canvas, and updates its texture.
By default this is used internally to ensure the texture is correct before rendering, but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text, and then shared across multiple Sprites.
Name | Type | Description |
---|---|---|
text |
string | |
style |
TextStyle | |
resolution |
number | |
canvasAndContext |
CanvasAndContext |
Returns a texture that was created wit the above getTexture
function.
Handy if you are done with a texture and want to return it to the pool.
Name | Type | Description |
---|---|---|
texture |
Texture |
The texture to be returned. |