ShelfPack

index.js

Create a new ShelfPack bin allocator.

Uses the Shelf Best Height Fit algorithm from http://clb.demon.fi/files/RectangleBinPack.pdf

ShelfPack(w: [number], h: [number], options: [Object])
Parameters
w ([number] (default 64) ) Initial width of the sprite
h ([number] (default 64) ) Initial width of the sprite
options ([Object])
Name Description
options.autoResize [boolean] (default false) If true , the sprite will automatically grow
Example
var sprite = new ShelfPack(64, 64, { autoResize: false });
Instance Members
pack (bins, [options])
packOne (w, h)
clear ()
resize (w, h)