Phaser API Documentation

  Version: 
copy(srcTileX, srcTileY, width, height, destTileX, destTileY, [recalculateFaces])

Description:

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.

Parameters:

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

true if the faces data should be recalculated.

Returns:
Description:

This Tilemap Layer object.

Since: 3.50.0