clear(x, y, width, height) → {Phaser.BitmapData}
Clears the BitmapData context using a clearRect.
You can optionally define the area to clear.
If the arguments are left empty it will clear the entire canvas.
You may need to call BitmapData.update after this in order to clear out the pixel data,
but Phaser will not do this automatically for you.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x | number | <optional> | 0 | The x coordinate of the top-left of the area to clear. |
y | number | <optional> | 0 | The y coordinate of the top-left of the area to clear. |
width | number | <optional> | The width of the area to clear. If undefined it will use BitmapData.width. | |
height | number | <optional> | The height of the area to clear. If undefined it will use BitmapData.height. |
Returns
This BitmapData object for method chaining.
- Source code: gameobjects/BitmapData.js (Line 463)
Please login to continue.