BitmapData#clear()

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)
doc_phaser
2017-02-14 10:36:50
Comments
Leave a Comment

Please login to continue.