Skip to content

Texture ​

The Texture class represents a render target texture and related image helpers.


Methods ​

constructor(w: number, h: number)Texture ​

Creates a new Texture instance.

  • wnumber - The w.
  • hnumber - The h.

Returned:


SetSize(w: number, h: number)void ​

Sets the size.

  • wnumber - The w.
  • hnumber - The h.

GetSize()[number, number] ​

Retrieves the size.

Returned:

  • [number, number] - The requested size.

Clear(color?: Color)this ​

default color is transparent black, image should be loaded

  • colorColor (optional) - The color value to use.

Returned:

  • this - The current instance for chaining.

GetIndex()number ​

Retrieves the index.

Returned:

  • number - The requested index.

GetImage()Image ​

Retrieves the image.

Returned:

  • Image - The requested image.

ApplyBlur(blurRadius: number, textureCompressionScale: number)this ​

Provides access to apply blur.

  • blurRadiusnumber - The blur radius.
  • textureCompressionScalenumber - The texture compression scale.

Returned:

  • this - The current instance for chaining.