Skip to content
Nonlinear Ideas edited this page Jan 6, 2015 · 12 revisions

Map Tiler

The Map Tiler is a python script designed to turn a map constructed from multiple layers into a tileset and xml file that can be used in the Tiled Map Editor.


Table of Contents


Features

  • Automatically merges duplicate tiles by checking for one of eight transformations (flipX, flipY, flipDiag).
  • Allows you to specify a rectangle in the input image to use for processing.
  • Allows you specify files individually on the command line or by a pattern or both.
  • Allows you to specify the output file names.
  • Generates tilesets as a power of 2 in width x height. You can force it to be square or not.
  • The script can generate"rooms" if you tell it what layers are "floors", "walls", "doors", and "portals". Room "tiles" are created and put into a "ROOMS" layer in Tiled. Room tiles are random colors. Room tiles have a "ROOM" property on them with room number (0..) as the value. The room generator looks at portals and doors that go over an EDGE, not just the tile.
  • MIT Licensed

Usage

See front matter in MapTiler.py file.


Dependencies

  • Uses the Python Image Library
  • Uses docopt for the options parsing. The file is included in the project.

Future Work

  • There is an option to "merge" changes into an existing .tmx file. The idea was that on the first pass through, you would create the layers and then when you changed your artwork, you could then re-run the script with minimal impact to data you put into Tiled. This has varied levels of success, so use it with caution.

Known Issues

  • None.

Screenshots

Results from Jan 5, 2015 Screen Shot on Jan 5, 2015.

Clone this wiki locally