Giter VIP home page Giter VIP logo

tiledsharp's Introduction

TiledSharp

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

Note to current users

I am considering some minor changes to the TiledSharp API. See the GitHub issue for more information.

About TiledSharp

TiledSharp is a .NET C# library for importing TMX tilemaps and TSX tilesets generated by Tiled, a tile map generation tool. The data is saved as a TmxMap object, whose structure closely resembles the original TMX file.

As a generic TMX and TSX parser, TiledSharp does not render the maps or depend on any external framework beyond .NET, such as Windows, XNA/MonoGame, Unity, or PSM. However, it can be used as an interface between TMX data and external games.

Usage

To import a TMX file into your C# application:

  • Include a reference to TiledSharp. You can either incorporare it directory into your own project, or you can pre-compile it and include the DLL.
  • Import the TiledSharp namespace (optional):

    using TiledSharp;
  • Create a Map object using the constructor:

    var map = new TmxMap("someMap.tmx");

    TiledSharp supports both resource names and file paths, and should work as expected in most situations. For more details, please consult the wiki.

  • Access the TMX data using the Map fields. Principal classes can be accessed by either name or index:

    var map = new TmxMap("someMap.tmx");
    var version = map.Version;
    var myTileset = map.Tilesets["myTileset"];
    var myLayer = map.Layers[2];
    var hiddenChest = map.ObjectGroups["Chests"].Objects["hiddenChest"];

Map data fields correspond closely to the TMX file structure. For a complete listing, see the documentation.

Although TiledSharp can manage elements with the same name, it is not recommended. For more information, see the TmxList specification.

Examples

Notes

TiledSharp parses XML files produced by Tiled, an open-source (GPL) tile map editor developed and maintained by Thorbjørn Lindeijer.

Licensing

TiledSharp is distributed under the Apache 2.0 License. The code can be used freely in any project, including commercial software, and does not place any restrictions on your own code. But any changes to TiledSharp must be documented explicitly.

Attribution is not necessary, but always appreciated.

Contact

Marshall Ward <[email protected]>

tiledsharp's People

Contributors

marshallward avatar paramecium13 avatar kubagdynia avatar codemyst avatar miaodadao avatar josh1billion avatar shawncowles avatar travisgesslein avatar hu9o avatar zarickan avatar sharparam avatar eropple avatar f1tz81 avatar kevinbalz avatar rlalance avatar temeez avatar bjorn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.