Class TextureUtils

Utils for texture creation and manipulation.

Constructors

Methods

Constructors

Methods

  • Create a new texture filled with a CSS style.

    Can be color, gradient or pattern. Supports all options supported in the fillStyle of the canvas API.

    Parameters

    • color: string | CanvasGradient | CanvasPattern = '#000000'

      Style to apply to the texture surface.

    • width: number = 1

      Width of the canvas in pixels.

    • height: number = 1

      Height of the canvas in pixels.

    Returns Texture