Phaser API Documentation

  Version: 
onDraw(target, [swapTarget], [altSwapTarget])

Description:

This method is called every time the batchSprite method is called and is passed a reference to the current render target.

If you override this method, then it should make sure it calls either the drawToGame or copyToGame methods as the final thing it does. However, you can do as much additional processing as you like prior to this.

Parameters:

name type arguments description
target Phaser.Renderer.WebGL.RenderTarget

The Render Target to draw to the game.

swapTarget Phaser.Renderer.WebGL.RenderTarget <optional>

The Swap Render Target, useful for double-buffer effects.

altSwapTarget Phaser.Renderer.WebGL.RenderTarget <optional>

The Swap Render Target, useful for double-buffer effects.

Since: 3.60.0