OpenFairyGUI API
    Preparing search index...

    Function maxRectsPack

    • Packs rectangles into one or more pages using the MaxRects algorithm.

      This is a faithful port of the FairyGUI editor's packing algorithm, including SIZE_SCHEME dimension search, multi-heuristic selection (BSSF/BLSF/BAF), and binary search for optimal dimensions.

      const results = maxRectsPack(
      [{ id: 'img1', width: 100, height: 80 }, { id: 'img2', width: 64, height: 64 }],
      { maxWidth: 2048, maxHeight: 2048, pot: true }
      );

      Parameters

      Returns PackResult[]