Here the windows build with sourcecode:
http://www.crushnet.org/TempFiles/tmw/tmxcopy.zip
Usage:
The program is command line based. The usage is:
Code: Select all
tmxcopy sourceFile x y width height targetFile x y [outputFile]
When you want to copy the lower right corner (20x20 tiles) of mapA.tmx to the upper left corner of mapB.tmx you would open map A with tiled and check at which coordinates the area you want to copy begins. Let's say mapA is 120x130 tiles. Then the area you want to copy would begin at 100:110 and would be 20x20 tiles large. So the first part of the command is:
Code: Select all
tmxcopy mapA.tmx 100 110 20 20
Code: Select all
mapB.tmx 0 0
Code: Select all
tmxcopy mapA.tmx 100 110 20 20 mapB.tmx 0 0
Code: Select all
tmxcopy mapA.tmx 100 110 20 20 mapB.tmx 0 0 temp.tmx
The program works so far but there are still some minor problems:
-Only tested for TMW-compilant maps. I don't guarantee that it works with Tiled maps that are made for other games and thus use different features. It is assumed that the target map and the source maps have the same number of layers, for example.
-Compressed maps (tmx.gz) can not be handled yet (but compressed or uncompressed layers work properly)
-When the target map has an object layer it is moved to the bottom of the layer list of the map (no problem for the game but inconvenient for editing). Objects on the source map are ignored.
-Layer data of output file isn't gzip-compressed yet
-Created TMX file is a bit malformated (but working properly)
You can work around the last 2 problems easily by opening and saving the map in Tiled.