API

Function enableSprite2DYSort

  • Enable stable ascending Y-sort for a pure Sprite2D layer.

    The draw key is positionPx.y + bias in +Y-down layer space. Smaller keys draw first; larger keys draw later and composite on top. Equal keys use a persistent insertion serial. Canonical instance storage, logical indices, and stable handle mappings are never reordered. Valid repeated calls return the installed state unchanged; defaultBias is validated on every call but is used only when creating state. Re-enabling after disable creates fresh state, resets active biases to the new default, and assigns insertion serials from zero in logical order.

    Parameters

    Returns Sprite2DYSortState

    Layer-owned CPU sort state.

    If the layer is depth-hosted or defaultBias is not finite.