PDA

View Full Version : TMX Maps



Cybermonkey
09-06-2014, 06:44 PM
Hi, does anyone know if there is a generic unit for loading TMX tiled maps? It should'nt be combined with any graphics/game engine though, so I could use it in my own SDL2 based engine.

code_glitch
09-06-2014, 08:16 PM
I do have a TMX loader though unfortunately it has a few limitations and is part of the prometheus loader. That said, the limitations are that it at the moment only does CSV and not base64 encoded tile codes but the Prometheus specific code is stuff is quite close to pseudo code on the most part. It doe depend on some functions in prometheus (though you could just move whats needed into a unit with the TMX code). At any rate - it does everything internally and is under 500 lines for the whole thing (it has property support and whatnot) so I guess there'd be no harm in looking at it to see if its of any use to you... The file you need can be found here: http://sourceforge.net/p/prometheuslib/git/ci/master/tree/PM_Maps.pas

Let me know if you run into any issues - I know a couple versions of my TMX loader developed some oddities though I can never remember from which branch those are from XD If you have any problems and are interested drop me a line somewhere (forum, mail, pm, sf anything) and I'll get it fixed up.

Cybermonkey
09-06-2014, 08:48 PM
Ok, thanks a lot, I will have a look into it.