Stage::setSorter()
Sets a custom sorter for the sprites. Use enableYSort() to enable the sorting of sprites using the y-coordinates. This overwrites goToBackLayer(), goToFrontLayer(), goLayersBackwards() and goLayersForwards().
Syntax
Java
.setSorter(sorter)
Parameters
| Name | Data Type | Description |
|---|---|---|
| sorter | Comparator<Sprite> | the comparator used to sort the sprites |
Return
void
