mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
20 lines
680 B
C#
20 lines
680 B
C#
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
namespace MonoGame.Extended.Content.Pipeline.Tiled
|
|
{
|
|
[ContentImporter(".tmx", DefaultProcessor = "TiledMapProcessor", DisplayName = "Tiled Map Importer - MonoGame.Extended")]
|
|
public class TiledMapImporter : ContentImporter<TmxMap>
|
|
{
|
|
public override TmxMap Import(string filename, ContentImporterContext context)
|
|
{
|
|
using (var reader = new StreamReader(filename))
|
|
{
|
|
var serializer = new XmlSerializer(typeof(TmxMap));
|
|
return (TmxMap)serializer.Deserialize(reader);
|
|
}
|
|
}
|
|
}
|
|
}
|