Load CSS tiles for a DOM tilemap.
npm install dom-tilesCheckout dom-tilemap for rendering these tiles into the DOM.
options are:- size Default: 16 Size of each tile in pixels.
- prefix Default: 'tile-' A prefix to give each CSS selector.
- tiles Default: null A set of tiles to load in at init.
- tilemap Default: null A ndarray tilemap to load in at init.
``js`
// Add a new tile named 'rock' that is a colored 'R'
var idx = tiles.add('rock', {
text: 'R',
bg: '#333',
color: '#fff',
})
`js``
// Add a tile map and add a tile from that texture atlas
var terrain = require('isabella-texture-pack')
tiles.addTilemap(terrain)
tiles.add('dirt', {
tilemap: [0, 2]
})