3

I tried to load a .tmx (Tile Map Editor) file into my project but I'm getting this error:

Cannot autodetect which importer to use for "Level1.tmx" There are no importers which handle this file type. Specify the importer that handles this file type in your project.

apiguy
  • 5,282
  • 1
  • 23
  • 24
Rekha
  • 41
  • 1
  • 1
  • 2
  • 1
    More context, please. What is a tmx file, and what are you trying to import it into? – Michael Petrotta Feb 24 '11 at 06:01
  • This is the second post I have seen in as many days with the title "Software Engineer". It's not your title we are interested in, but instead a short description of the problem. – Ed S. Feb 24 '11 at 06:01

4 Answers4

2

XNA does not load the file by default. There is a full TMX Map Loader for XNA projects located here http://windowsphonedevelopments.com/tmx-map-loader-xna-1-0/

TMX Map Loader XNA is a full XNA content pipeline library that allows you to load and process the data from the TMX source asset file and output the data as an intermediate format at design time (output to an .xnb file).

1

i found your question & this answer while looking for the same thing:

TiledSharp

A .NET C# library for importing Tiled TMX tile maps

https://github.com/marshallward/TiledSharp

Martin Olika
  • 2,223
  • 1
  • 12
  • 3
1

XNA does not support Tile Map Editor files by default. It is possible to load them into your project however. Some information about a custom loader can be found here:

http://nerdculture.org/2009/07/14/tiled-maps-for-xna-full-support-for-the-tiled-map-xml-specification/

The post is a bit old so I'm not certain it's going to work with the latest version of XNA, but it's definitely a good starting point.

apiguy
  • 5,282
  • 1
  • 23
  • 24
0

I found a tool called XTiled which handles loading and rendering of .tmx files from start to finish.

Here's the website: https://bitbucket.org/vinull/xtiled Example/Tutorial from the author: https://www.youtube.com/watch?v=qd0Yh50SPL4

With Tiled Sharp, I was able to load the tmx into memory, but there is no api for actually rendering tiles. You have to do it all yourself.

C. Tewalt
  • 2,271
  • 2
  • 30
  • 49