1.0.0 • Published 6 years ago

tileset.js v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

Introduction

Online demo

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

Clike me!

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