Tilemap#copy()

copy(x, y, width, height, layer) → {array}

Copies all of the tiles in the given rectangular block into the tilemap data buffer.

Parameters
Name Type Argument Description
x integer

X position of the top left of the area to copy (given in tiles, not pixels)

y integer

Y position of the top left of the area to copy (given in tiles, not pixels)

width integer

The width of the area to copy (given in tiles, not pixels)

height integer

The height of the area to copy (given in tiles, not pixels)

layer integer | string | Phaser.TilemapLayer <optional>

The layer to copy the tiles from.

Returns
array -

An array of the tiles that were copied.

Source code: tilemap/Tilemap.js (Line 1543)
doc_phaser
2017-02-14 11:15:09
Comments
Leave a Comment

Please login to continue.