tmx-loader

4.3.0 • Public • Published

Webpack tmx loader

NPM

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 = require('tmx!./map.tmx');
// => 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 = require('tmx?tilepath=./tilemap.tsx!./map.tmx'); //load tilemap

Credits

Readme

Keywords

Package Sidebar

Install

npm i tmx-loader

Weekly Downloads

1

Version

4.3.0

License

none

Last publish

Collaborators

  • deniau.antonin