Documentation
    Preparing search index...

    Function groupSpritesByTexture

    • Groups consecutive items that share a texture into runs (§55 atlas grouping; §65's "texture atlas grouping" remainder).

      Does not reorder. Two sprites that share a texture but are separated by a third stay in two runs — merging them would change draw order. A packer that wants one run per texture sorts first; this helper only reports the runs the current order already has.

      const runs = groupSpritesByTexture(sprites);
      // [{ texture: atlas, start: 0, count: 3 }, { texture: other, start: 3, count: 1 }]

      Parameters

      Returns SpriteTextureRun[]