Skip to content
baylej edited this page Apr 5, 2013 · 24 revisions

Loads .tmx tiled maps in you games.

TMX is intended to be included in your project, then you should add you variables in the structures like bitmap pointers and whatever you need.

Dependencies

This project depends on Zlib, Jansson and LibXml2.

Compiling

This project uses cmake as a build system builder. You can either use cmake or cmake-gui.

You can disable XML support by setting WANT_XML to off, the same way with WANT_JSON you can disable JSON support.

On linux :

mkdir build
cd build
cmake ..
make && make install

On windows :

See the Building on windows wiki page.

Usage

#include <tmx/tmx.h>

int main(void) {
  tmx_map map = tmx_load("path/map.tmx");
  if (!map) {
    tmx_perror("tmx_load");
    return 1;
  }
  /* ... */
  tmx_free(map);
  return 0;
}
Clone this wiki locally