Phaser API Documentation

  Version: 

Member of: Phaser.Utils.Array

<static> SetAll(array, property, value, [startIndex], [endIndex])

Description:

Scans the array for elements with the given property. If found, the property is set to the value.

For example: SetAll('visible', true) would set all elements that have a visible property to false.

Optionally you can specify a start and end index. For example if the array had 100 elements, and you set startIndex to 0 and endIndex to 50, it would update only the first 50 elements.

Parameters:

name type arguments description
array array

The array to search.

property string

The property to test for on each array element.

value *

The value to set the property to.

startIndex number <optional>

An optional start index to search from.

endIndex number <optional>

An optional end index to search to.

Returns:
Description:

The input array.

Type:
  • array
Since: 3.4.0
Source: src/utils/array/SetAll.js (Line 9)