Phaser API Documentation

  Version: 
onBatch([gameObject])

Description:

By default this is an empty method hook that you can override and use in your own custom pipelines.

This method is called every time the batchQuad or batchTri methods are called. If this was as a result of a Game Object, then the Game Object reference is passed to this hook too.

This hook is called after the quad (or tri) has been added to the batch, so you can safely call 'flush' from within this.

Note that Game Objects may call batchQuad or batchTri multiple times for a single draw, for example the Graphics Game Object.

Parameters:

name type arguments description
gameObject Phaser.GameObjects.GameObject <optional>

The Game Object that invoked this pipeline, if any.

Since: 3.50.0