Phaser API Documentation

  Version: 
draw(x, y, source, [update])

Description:

Draws the given Image or Canvas element to this CanvasTexture, then updates the internal ImageData buffer and arrays.

Parameters:

name type arguments Default description
x number

The x coordinate to draw the source at.

y number

The y coordinate to draw the source at.

source HTMLImageElement | HTMLCanvasElement

The element to draw to this canvas.

update boolean <optional> true

Update the internal ImageData buffer and arrays.

Returns:
Description:

This CanvasTexture.

Since: 3.13.0