Phaser API Documentation

  Version: 
createTexture2D(mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, [pma], [forceSize], [flipY])

Description:

A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture.

Parameters:

name type arguments Default description
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.

pma boolean <optional> true

Does the texture have premultiplied alpha?

forceSize boolean <optional> false

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

flipY boolean <optional> false

Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload.

Returns:
Description:

The WebGLTexture that was created.

Type:
  • WebGLTexture
Since: 3.0.0