Group#getRandomExists()

getRandomExists(startIndex, endIndex) → {any}

Returns a random child from the Group that has exists set to true.

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
startIndex integer <optional>
0

The first child index to start the search from.

endIndex integer <optional>

The last child index to search up to.

Returns
any -

A random child of this Group that exists.

Source code: core/Group.js (Line 2372)
doc_phaser
2017-02-14 10:51:20
Comments
Leave a Comment

Please login to continue.