Added layerY for depth sorting.