node package manager


Render a tilemap from an ndarray to the DOM


Render a tilemap from a ndarray to the DOM.

options are:

  • width Default: window.innerWidth Width of the tilemap in pixels.
  • height Default: window.innerHeight Height of the tilemap in pixels.
  • size Default: 16 Size of each tile in pixels.
  • prefix Default: 'tile-' A className prefix.

Call at each animation frame. It will update any coordinates within map.update.

Set a coordinate to a tile id.

Set an array coordinates.

Get a tile id at given coordinate.

Sets all tiles to 0.

Will loop through the entire ndarray and set all tiles.

The parent DOM element of all the child tiles.

The ndarray controlling the tilemap.

Set to an array of coordinates [[10, 12], [5, 6]] and upon next tick those tile coordinates will be updated.

A list of all child tiles.

  • 0.1.0 - initial release

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.