phaser - v3.90.0
    Preparing search index...

    Wrapper for a WebGL texture, containing all the information that was used to create it.

    A WebGLTexture should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLTextureWrapper instead.

    Index

    Constructors

    • Parameters

      • gl: WebGLRenderingContext

        WebGL context the texture belongs to.

      • mipLevel: number

        Mip level of the texture.

      • minFilter: number

        Filtering of the texture.

      • magFilter: number

        Filtering of the texture.

      • wrapT: number

        Wrapping mode of the texture.

      • wrapS: number

        Wrapping mode of the texture.

      • format: number

        Which format does the texture use.

      • pixels: object

        pixel data.

      • width: number

        Width of the texture in pixels.

      • height: number

        Height of the texture in pixels.

      • Optionalpma: boolean

        Does the texture have premultiplied alpha? Default true.

      • OptionalforceSize: boolean

        If true it will use the width and height passed to this method, regardless of the pixels dimension. Default false.

      • OptionalflipY: boolean

        Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload. Default false.

      Returns WebGLTextureWrapper

    Properties

    flipY: boolean

    Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload.

    forceSize: boolean

    Whether to use the width and height properties, regardless of pixel dimensions.

    format: number

    Which format does the texture use.

    gl: WebGLRenderingContext

    The WebGL context this WebGLTexture belongs to.

    height: number

    Height of the texture in pixels.

    isRenderTexture: boolean

    Whether this is used as a RenderTexture.

    magFilter: number

    Filtering of the texture.

    minFilter: number

    Filtering of the texture.

    mipLevel: number

    Mip level of the texture.

    pixels: object

    Pixel data. This is the source data used to create the WebGLTexture.

    pma: boolean

    Does the texture have premultiplied alpha?

    spectorMetadata: object

    The __SPECTOR_Metadata property of the WebGLTexture, used to add extra data to the debug SpectorJS integration.

    webGLTexture: WebGLTexture

    The WebGLTexture that this wrapper is wrapping.

    This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.

    width: number

    Width of the texture in pixels.

    wrapS: number

    Wrapping mode of the texture.

    wrapT: number

    Wrapping mode of the texture.

    Methods

    • Creates a WebGLTexture from the given parameters.

      This is called automatically by the constructor. It may also be called again if the WebGLTexture needs re-creating.

      Returns void

    • Deletes the WebGLTexture from the GPU, if it has not been already.

      Returns void

    • Updates the WebGLTexture from an updated source.

      This should only be used when the source is a Canvas or Video element.

      Parameters

      • source: object

        The source to update the WebGLTexture with.

      • width: number

        The new width of the WebGLTexture.

      • height: number

        The new height of the WebGLTexture.

      • flipY: boolean

        Should the WebGLTexture set UNPACK_MULTIPLY_FLIP_Y?

      • wrapS: number

        The new wrapping mode for the WebGLTexture.

      • wrapT: number

        The new wrapping mode for the WebGLTexture.

      • minFilter: number

        The new minification filter for the WebGLTexture.

      • magFilter: number

        The new magnification filter for the WebGLTexture.

      • format: number

        The new format for the WebGLTexture.

      Returns void