TiledLib for XNA throws an ArgumentException on load

Essentially, I'm trying to load / draw a map from a Tiled map using Nick Gravelyn TiledLib. The map is saved in Tiled XML format. However, when I try to load a map with a line

TiledLib.Map map = Content.Load<TiledLib.Map>("Maps/Map1");

he throws out ArgumentException. All this manifests itself in the Tile itself:
enter image description here

The source of the XML map looks like this (not published directly to StackOverflow for obvious size reasons).

At first it worked (with a fairly simple map using only one set of graphic elements), but when I edited it to include a little more material, he suddenly started to do it. Could this be due to my use of tile objects?

EDIT: I was able to figure out that using tile objects was not the culprit; this map structure still creates the same error.

+3
source share
2 answers

you get an exception because you will not name objects on the map, this will throw an ArgumentException in TiledLib. So, to solve this problem, you need to go back to the Tiled program, (re) edit this map and select each object on the map and give it a name (not a property, but a name), and then export the map again and (re) import it into game content. This should fix the problem.

BTW: , . : png ​​ , , CollideLayer CollideLayer , , , CollideLayer . , .

+3

, , XML ,

<tile gid="0"/>

. , . , TileLib

<data encoding="base64" compression="gzip">

H4sIAAAAAAAAC2NmYGBgpjKmFkA2jxCNrg + bHD7z0PWSYx428wmZjW4 + qf7Fxyc3PnDFJS3jdzCbx4QFg8QZScTUzmcgDACR4mfdwAMAAA ==

, . "gid" ( id?) , , . , - . . . "gid" .

( - ?), , "gid" , .

-2

All Articles