How do I import .tmx (Tile Map Editor) file into my XNA Project

10,565

Solution 1

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).

Solution 2

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

Solution 3

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.

Share:
10,565
Admin
Author by

Admin

Updated on July 16, 2022

Comments

  • Admin
    Admin almost 2 years

    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.