I'm trying to create a hex map. I can't do so from a file, because the versions of Tiled that actually supported hex map editing appear to have been lost in history. If I want to create a regular tiled map (not from a file), do I just use clojure's java interop to create these objects and pass them along? It appears tiled-map*, which all the helper functions use, was written with this in mind, because it acts as the identity function when its argument isn't a string. This just isn't the standard documented way of using those functions. Right?
Would there be any desire perhaps to just have nullary versions of the same functions create empty maps? That does leave us with the issue of the scale argument... I was kind of expecting it to work more like:
(orthogonal-tiled-map (load-map "level1.tmx") (/ 1 8))
(orthogonal-tiled-map "level1.tmx" (/ 1 8))
But perhaps it is too late to mess with these APIs?
(The other reason I don't want to load from a file is because I'm hoping to procedurally generate the maps :))
Yeah I intentionally had tiled-map* return the argument if it wasn't a string, so you could pass your own TiledMap object that you create with java interop. I haven't documented it, but there's nothing wrong with doing it that way. If there's a way I can make it easier in play-clj, let me know.
I just added the ability to create new tiled maps, layers, and cells like this:
(tiled-map-layer* width height tile-width tile-height)
You can run methods on them with the relevant functions like tiled-map!. I'll close the issue, but let me know if there's anything else that is missing for making tiled maps programmatically.