dtiled 0.1.0

Parse Tiled map files


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

DTiled: D language Tiled map parser.

DTiled is a small utility to parse Tiled maps using D. It currently supports Tiled's JSON format.

What is DTiled?

Currently, DTiled is a pretty thin wrapper around the data exported by Tiled.

It includes a few helper functions that make it easier to get information about the tiles in your map.

Currently, DTiled is intended as a tilemap loader rather than an in-game tilemap implementation.

For any non-trivial use of a tilemap, you likely have your own structure to represent the map in-game, DTiled is simply a helpful way to populate your map structure from a json file exported

What isn't DTiled?

DTiled is not a tilemap renderer.

DTiled describes how to render your map by answering questions like:

  • what tilemap does a given tile belong to?
  • what region of the tile atlas bitmap should be used to draw this tile?
  • where the tile should be positioned on the screen?

It does not actually render the map as I do not want to tie users to a particular graphics library, and you have likely already picked one to render the rest of your game.

D has bindings to a number of libraries that can render your map like:

There are also higher-level options like DGame.

I have created a simple example using DTiled with Allegro. If you create an example using your own favorite rendering library, let me know!

Development

DTiled is currently considered alpha, as I may change up the API if I decide on something I feel is cleaner of more useful.

DTiled's API may expand to provide higher-level helpers that consolidate the most useful information about a tilemap. This might take the form of a range-based API that iterates over all the tiles in

In the future, DTiled might expand to provide a generic TileMap structure that actually is intended for in-game use, and would help support common needs like querying which tile is at a given pixel position. It might even enable rendering via callbacks, allowing users to choose what actually does the rendering.

Tips

Tired of clicking export all the time in the Tiled editor? Tiled has an --export-map flag that can be used from the command line! Include a step in your build process to translate all tmx files to json files.

Authors:
  • rcorre
Dependencies:
jsonizer
Versions:
0.3.4 2022-Mar-25
0.3.3 2015-Dec-09
0.3.2 2015-Nov-29
0.3.1 2015-Nov-28
0.3.0 2015-Sep-30
Show all 10 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 459 downloads total

Score:
0.3
Short URL:
dtiled.dub.pm