Phaser API Documentation

  Version: 
pushBatch(texture)

Description:

Takes the given WebGLTexture and determines what to do with it.

If there is no current batch (i.e. after a flush) it will create a new batch from it.

If the texture is already bound, it will return the current texture unit.

If the texture already exists in the current batch, the unit gets reset to match it.

If the texture cannot be found in the current batch, and it supports multiple textures, it's added into the batch and the unit indexes are advanced.

Parameters:

name type description
texture WebGLTexture

The WebGLTexture assigned to this batch entry.

Returns:
Description:

The texture unit that was bound.

Type:
  • number
Since: 3.60.0