1.0.0 • Published 6 years ago
tileset.js v1.0.0
Introduction
A simple tool which can help you crop tileset and show a part of it on your page like doing it with your game engine.
Online Demo
How to use
// First, new a TileSet instance with properties of 'src', 'width' ,'height' of a tile
const ts = new TileSet('./assets/img/map.png', 32, 32)
// Then, using the method below to append it to an exist tag, the properties mean the 'id', 'x', 'y', the tile position on the tileset
ts.appendTo('one',5,5)
ts.appendTo('two',4,5)
ts.appendTo('three',8,14)
For detail please check the demo or source code
1.0.0
6 years ago