For each object in the given object layer, run the given filter callback function. Any objects that pass the filter test (i.e. where the callback returns true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.
name | type | arguments | description |
---|---|---|---|
objectLayer | string | Phaser.Tilemaps.ObjectLayer |
The name of an object layer (from Tiled) or an ObjectLayer instance. |
|
callback | TilemapFilterCallback |
The callback. Each object in the given area will be passed to this callback as the first and only parameter. |
|
context | object | <optional> |
The context under which the callback should be run. |
An array of object that match the search, or null if the objectLayer given was invalid.