Phaser API Documentation

  Version: 
setTexture2D([texture])

Description:

Sets the texture to be bound to the next available texture unit and returns the unit id.

Parameters:

name type arguments description
texture WebGLTexture <optional>

WebGLTexture that will be assigned to the current batch. If not given uses whiteTexture.

Returns:
Description:

The assigned texture unit.

Type:
  • number
Examples:
Since: 3.50.0