compareDrawRank
compareDrawRank(
a,b):number
Defined in: render/layerOrder.ts:75
Positive when
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
a ended up in FRONT of
b — the order the frame resolved, for anything that has to answer “which of these is on top” outside the renderer.
The sorting layer normally decides, because a higher layer is simply painted later. Two DEPTH layers are the exception, and not a special case bolted on: a depth layer resolves per PIXEL, so an opaque draw at a nearer z occludes what a later layer puts over it — that is the whole point of the 2.5D opt-in, and it is what a paired pixel check proves (near sprite in the LOWER layer, still in front). Ranking those two by layer would answer with the sprite that the depth buffer rejected.