grid-cells
Computes grid cells coordinates
Usage
grid(width, height, numCellsX, numCellsY, margin)
Returns: List of numCellsX * numCellsY rectangles. [[x, y, w, h], ...]
Example
To get a grid like in the screenshot above
var grid = require('grid-cells');
var cells = grid(1024, 512, 4, 2, 10);
console.log(cells[0]); //-> [ 10, 10, 243, 241 ]
License
MIT, see LICENSE.md for details.