Webpack tmx loader
A Webpack plugin for loading tmx files (for example .tmx).
Installation
Install via npm:
npm install --save tmx-loader
Usage
You can require tmx map like this:
var data = ;// => returns map.tmx content as json parsed object
The loader will translate the map.tmx
file into a JSON Object.
Usage with webpack.config
To require tmx files like this: require('map.tmx')
, you can add the tmx-loader to your webpack config:
module :loaders :test: /\.tmx?$/ loader: 'tmx-loader' //will load all .tmx files with tmx-loader by default
Options
tilepath
Tells the loader which tilemap is used to display the data. Default: ''
Examples:
var data = ; //load tilemap
Credits
- TMX parsing done with node-tmx-parser by Andrew Kelley