mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Docs update (#2166)
This commit is contained in:
parent
33604901c4
commit
2cd76b7617
1 changed files with 4 additions and 0 deletions
|
@ -1596,8 +1596,12 @@ Phaser.Group.prototype.forEachDead = function (callback, callbackContext) {
|
|||
* Sort the children in the group according to a particular key and ordering.
|
||||
*
|
||||
* Call this function to sort the group according to a particular key value and order.
|
||||
*
|
||||
* For example to depth sort Sprites for Zelda-style game you might call `group.sort('y', Phaser.Group.SORT_ASCENDING)` at the bottom of your `State.update()`.
|
||||
*
|
||||
* Internally this uses a standard JavaScript Array sort, so everything that applies there also applies here, including
|
||||
* alphabetical sorting, mixing strings and numbers, and Unicode sorting. See MDN for more details.
|
||||
*
|
||||
* @method Phaser.Group#sort
|
||||
* @param {string} [key='z'] - The name of the property to sort on. Defaults to the objects z-depth value.
|
||||
* @param {integer} [order=Phaser.Group.SORT_ASCENDING] - Order ascending ({@link Phaser.Group.SORT_ASCENDING SORT_ASCENDING}) or descending ({@link Phaser.Group.SORT_DESCENDING SORT_DESCENDING}).
|
||||
|
|
Loading…
Add table
Reference in a new issue