Copies the tiles in the source rectangular area to a new destination (all specified in tile coordinates) within the layer. This copies all tile properties & recalculates collision information in the destination region.
If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers.
name | type | arguments | Default | description |
---|---|---|---|---|
srcTileX | number |
The x coordinate of the area to copy from, in tiles, not pixels. |
||
srcTileY | number |
The y coordinate of the area to copy from, in tiles, not pixels. |
||
width | number |
The width of the area to copy, in tiles, not pixels. |
||
height | number |
The height of the area to copy, in tiles, not pixels. |
||
destTileX | number |
The x coordinate of the area to copy to, in tiles, not pixels. |
||
destTileY | number |
The y coordinate of the area to copy to, in tiles, not pixels. |
||
recalculateFaces | boolean | <optional> | true |
|
layer | string | number | Phaser.Tilemaps.TilemapLayer | <optional> |
The tile layer to use. If not given the current layer is used. |
Returns this, or null if the layer given was invalid.