Tiled Maps for XNA – Full support for the Tiled Map XML specification!
So yesterday I came across a very basic loader for Tiled Maps (*.tmx) made with the Tiled Map Editor. It only supported the basics–Tileset loading and Layer rendering–so I took it upon myself to complete the loader by adding support for the rest of the features that were left out;
-added ProhibitDtd = false, so you don’t need to remove the doctype line after each time you edit the map.
-changed everything to use SortedLists for named referencing–so much easier
-added objectgroups
-added movable and resizable objects
-added object images
-added meta property support to maps, layers, object groups and objects
-added support for non-binary encoded layer data
-added layer and object group transparency
I created a simple demo to show off some of the features. You should see a partially transparent object with a resized image of Ness (Earthbound) on top of a partially transparent layer of grass with the words “Tile Maps Rule” written in rock with a pulsating opacity. Use the arrow keys to move Ness around. All objects and object groups can have their X and Y coordinates set dynamically, so you can do cool stuff like parallax clouds drifting overhead.





Hello
I didn’t get the transparency working…are you sure you implemented it?
Ich made a map with one layer und in the tileset i can see that there are some transparents tiles, so i choose the right color while i imported the tileset
but when i use this map in your example, than the tiles are purple and not trancparency
can you help me?
thx
That’s part of the tileset file, not the map file. I don’t have any support for tileset files yet. I might do that later.
hmm
what about this new feature: “-added layer and object group transparency” ?
hmm in the map file there is a node e.g. “trans=ff00ff” in the same line where the tileset source is.
michi´s last blog ..GMX Lottozahlen
That’s referring to the opacity setting that can be set on each layer or object group using the slider above the layer list.
ok now i got it.
hmm, maybe i make a transparentcy extension.
so that the color which is defined in the editor as trancparent