Skip to content

PokeD/TMXParserPCL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCL Tiled Map File Parser

TMXParserPCL is C# library for parsing Tiled Map's TMX files.

nugetpkg

Usage:

// -- Load a file how you want in PCL
var fileStream = File.Open("map.tmx", FileMode.Open);

var map = Map.Load(fileStream);


// If TileSet is an external file
var loadedExternalTileSets = new List<TileSet>();
var loadedImages = new List<Bitmap>();
foreach (var tileSet in map.TileSets)
{
  // -- Load a file how you want in PCL
  var fileStream = File.Open(tileSet.Source, FileMode.Open);
  
  var tileSetLoaded = TileSet.LoadExternal(fileStream, tileSet);

  // -- Load a file how you want in PCL
  var pictureStream = File.Open(tileSetLoaded.Image.Source, FileMode.Open);
  var picture = new Bitmap(pictureStream);
  loadedImages.Add(picture);

  loadedExternalTileSets.Add(tileSetLoaded);
}

There isn't really an other way to load external TileSets, it's needed to be serialized second time

About

Tiled map file parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%