Class: GenerateTextureSystem

GenerateTextureSystem

System that manages the generation of textures from the renderer

Do not instantiate these plugins directly. It is available from the renderer.textureGenerator property.

Implements

Methods

generateTexture (options) Texture

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
Texture a shiny new texture of the container passed in