Closed joseasv closed 9 years ago
So your the first person to start a new project from scratch with the importer and I believe the issue is that you need to add Newtonsoft.Json (http://www.newtonsoft.com/json) to the project otherwise the Importer can't parse the map, returning a null reference. I recommend downloading it using the NuGet package manager in Visual Studio.
Other issues that are easily fixed and I forget about: 1) Make sure to set the properties for all of the JSON and XNB files to 'Content' and 'Copy if newer' 2) Chances are the filepaths inside the JSON file that have the location of your tileset images (XNB files) are not correct and need to be changed. My image tag looks like this: "image": "your_tileset_name". Tiled will give you something by default. Notice that for XNBs I do not include any extension. 3) You have a problem somewhere with your filepaths and need to tweak them a bit.
Oops, sorry for the late reply. I added that json library and now it works just fine. Thanks and keep the good work!
Hello there. I've been looking for an easy way to load a Tiled map in MonoGame and your library is a godsend. Although, I've been trying to load a test map without luck. I'm using Visual Studio Express 2013 for Windows Desktop and MonoGame 3.2. The DemoGame project runs fine and even my test map gets loaded.
I create a MonoGame Windows Project, add the MapImporter.dll and add the Tiled map in json and the tileset png turned xnb to the Content folder (Using this http://www.monogame.net/documentation/?page=Using_The_Pipeline_Tool). Then, I load the map and texture in LoadContent():
And this is drawing call in Draw():
I run the program and I got this Exception: A first chance exception of type 'System.NullReferenceException' occurred in test.exe Additional information: Object reference not set to an instance of an object.
I even get this exception loading your NewBarkTown map in my test project.