1.0.0 • Published 8 years ago
img-tile v1.0.0
img-tile
tile an
<img>from a given width and height

const tile = require("img-tile")
const load = require("img-load")
load("./tiles.png", (err, image) => {
if (err) throw err
let tiles = tile(image, 16, 16)
for (let tile of tiles) {
document.body.appendChild(tile)
}
})usage
tile(image, width, height) -> images
Splits the given image into individual <canvas> elements of the dimensions described by width and height.
image: TheHTMLImageElementto be splitwidth: The desired width of each resulting<canvas>elementheight: The desired height of each resulting<canvas>element
1.0.0
8 years ago
