Texture

class cee.Texture()

Factory for creating texture objects

Methods

static cee.Texture.fromHTMLImageElement()

static

fromHTMLImageElement(htmlImageElement: HTMLImageElement, textureOptions: TextureOptions): Texture

Creates a texture image object from an HTMLImageElement

Note: A general rule is that both dimensions must be a power of two.

To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:

const texture = cee.Texture.fromImageData(imageData,
    { generateMipmaps: false,
      wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE,
      minFilter: cee.TextureMinFilter.LINEAR
    });

Parameters

htmlImageElement: HTMLImageElement

textureOptions: TextureOptions

Returns: Texture

static cee.Texture.fromImageData()

static

fromImageData(imageData: ImageData, textureOptions: TextureOptions): Texture

Creates a texture image object from ImageData

Note: A general rule is that both dimensions must be a power of two.

To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:

const texture = cee.Texture.fromImageData(imageData,
    { generateMipmaps: false,
      wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE,
      minFilter: cee.TextureMinFilter.LINEAR
    });

Parameters

imageData: ImageData

textureOptions: TextureOptions

Returns: Texture