Phaser API Documentation

  Version: 
each(callback, [context], [args])

Description:

Passes all Game Objects in this Container to the given callback.

A copy of the Container is made before passing each entry to your callback. This protects against the callback itself modifying the Container.

If you know for sure that the callback will not change the size of this Container then you can use the more performant Container.iterate method instead.

Parameters:

name type arguments description
callback function

The function to call.

context object <optional>

Value to use as this when executing callback.

args * <optional>

Additional arguments that will be passed to the callback, after the child.

Returns:
Description:

This Container instance.

Examples:
Since: 3.4.0