@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
16 lines (13 loc) • 441 B
JavaScript
import { MaxRectanglesPacker } from "./MaxRectanglesPacker.js";
/**
* Packs {@link AABB2} boxes into defined bounds
*
* @param {number} width
* @param {number} height
* @param {AABB2[]} boxes
* @returns {boolean} true if packing was successful, false otherwise
*/
export function packMaxRectangles(width, height, boxes) {
const packer = new MaxRectanglesPacker(width, height);
return packer.addMany(boxes);
}