Phaser API Documentation

<static> SetCollisionByExclusion(indexes, collides, recalculateFaces, layer)


Sets collision on all tiles in the given layer, except for tiles that have an index specified in the given array. The collides parameter controls if collision will be enabled (true) or disabled (false). Tile indexes not currently in the layer are not affected.


name type description
indexes Array.<number>

An array of the tile indexes to not be counted for collision.

collides boolean

If true it will enable collision. If false it will clear collision.

recalculateFaces boolean

Whether or not to recalculate the tile faces after the update.

layer Phaser.Tilemaps.LayerData

The Tilemap Layer to act upon.