setCollisionByExclusion(indexes, collides, layer, recalculate)
Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
The collides
parameter controls if collision will be enabled (true) or disabled (false).
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
indexes | array | An array of the tile IDs to not be counted for collision. | ||
collides | boolean | <optional> | true | If true it will enable collision. If false it will clear collision. |
layer | number | string | Phaser.TilemapLayer | <optional> | The layer to operate on. If not given will default to this.currentLayer. | |
recalculate | boolean | <optional> | true | Recalculates the tile faces after the update. |
- Source code: tilemap/Tilemap.js (Line 917)
Please login to continue.