Phaser API Documentation

getMatching([property], [value], [startIndex], [endIndex])


Returns all children in this Group that match the given criteria based on the property and value arguments.

For example: getMatching('visible', true) would return only children that have their visible property set.

Optionally, you can specify a start and end index. For example if the Group has 100 elements, and you set startIndex to 0 and endIndex to 50, it would return matches from only the first 50.


name type arguments description
property string <optional>

The property to test on each array element.

value * <optional>

The value to test the property against. Must pass a strict (===) comparison check.

startIndex number <optional>

An optional start index to search from.

endIndex number <optional>

An optional end index to search to.


An array of matching Group members. The array will be empty if nothing matched.

  • Array.
Since: 3.50.0