Sorting order
Also called: draw order, z-order
Related terms: sorting layer, Y-sort, painter's algorithm
2D sprites are drawn one after another, and later ones cover earlier ones. This is the painter's algorithm. Sorting layers and order numbers fix the sequence: background, characters, effects, UI.
In top-down games, Y-sorting draws sprites that are lower on the screen later. A character can then walk behind a tree and in front of it with no extra work.
- Further reading
- Unity Manual: 2D rendering order