Phaser API Documentation

  Version: 
sort(property, [handler])

Description:

Sort the contents of this Container so the items are in order based on the given property. For example: sort('alpha') would sort the elements based on the value of their alpha property.

Parameters:

name type arguments description
property string

The property to lexically sort by.

handler function <optional>

Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.

Returns:
Description:

This Container instance.

Since: 3.4.0