Phaser API Documentation

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

Description:

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

For example: getAll('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.

Parameters:

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.

Returns:
Description:

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

Type:
  • Array.
Since: 3.50.0