Phaser API Documentation

  Version: 
sortByDepth(childA, childB)

Description:

Compare the depth of two Game Objects.

Parameters:

name type description
childA Phaser.GameObjects.GameObject

The first Game Object.

childB Phaser.GameObjects.GameObject

The second Game Object.

Returns:
Description:

The difference between the depths of each Game Object.

Type:
  • number
Since: 3.50.0