Phaser API Documentation

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

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 description
x number <optional>

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

y number <optional>

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.

Returns:
Description:

The Canvas Texture.

Since: 3.7.0