-
Notifications
You must be signed in to change notification settings - Fork 56
Home
Bayle Jonathan edited this page Jun 10, 2014
·
24 revisions
Loads .tmx tiled maps in your games.
TMX is intended to be included in your project, then you should add your variables in the structures like bitmap pointers and whatever you need.
This project depends on Zlib, Jansson and LibXml2.
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.
mkdir build
cd build
cmake ..
make && make install
See the Building on windows wiki page.
#include <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;
}
Jansson, Zlib and LibXML2 are all thread safe.
TMX is thread safe except its tmx_strerr
function, which uses a global to store the error message.
Need more help?
Talk with me on Tiled's discord server, my nick is Mr-Hide