World#getAll()

getAll(property, value, startIndex, endIndex) → {any}

Returns all children in this Group.

You can optionally specify a matching criteria using the property and value arguments.

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

Optionally you can specify a start and end index. For example if this Group had 100 children,
and you set startIndex to 0 and endIndex to 50, it would return a random child from only
the first 50 children in the Group.

Parameters
Name Type Argument Default Description
property string <optional>

An optional property to test against the value argument.

value any <optional>

If property is set then Child.property must strictly equal this value to be included in the results.

startIndex integer <optional>
0

The first child index to start the search from.

endIndex integer <optional>

The last child index to search up until.

Returns
any -

A random existing child of this Group.

Inherited From
Source code: core/Group.js (Line 2392)
doc_phaser
2017-02-14 11:20:55
Comments
Leave a Comment

Please login to continue.