Implements
Methods
generateTexture (options) RenderTexture
A Useful function that returns a texture of the display object that can then be used to create sprites This can be quite useful if your container is complicated and needs to be reused multiple times.
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
GenerateTextureOptions | Container |
Generate texture options. |
|
options.container |
Container |
<optional> |
If not given, the renderer's resolution is used. |
options.region |
Rectangle |
The region of the container, that shall be rendered, |
|
options.resolution |
number |
<optional> |
The resolution of the texture being generated. if no region is specified, defaults to the local bounds of the container. |
options.textureSourceOptions |
GenerateTextureSourceOptions |
<optional> |
Texture options for GPU. |
Returns:
| Type | Description |
|---|---|
| RenderTexture | a shiny new texture of the container passed in |