Phaser API Documentation

  Version: 
clear([x], [y], [width], [height], [update])

Description:

Clears the given region of this Canvas Texture, resetting it back to transparent. If no region is given, the whole Canvas Texture is cleared.

Parameters:

name type arguments Default description
x number <optional> 0

The x coordinate of the top-left of the region to clear.

y number <optional> 0

The y coordinate of the top-left of the region to clear.

width number <optional>

The width of the region.

height number <optional>

The height of the region.

update boolean <optional> true

Update the internal ImageData buffer and arrays.

Returns:
Description:

The Canvas Texture.

Since: 3.7.0