Skip to content

TiledSharp Class Overview

Marshall Ward edited this page Apr 23, 2012 · 13 revisions

This is an overview of the classes and data types used by TiledSharp.

Principal classes

TmxMap is an abstraction of a TMX file and its associated data. It contains basic information about the map, such as the map size (in tiles) or the tile size (in pixels). It also contains the principal TMX data elements (TmxTileset, TmxLayer, TmxObjectGroup, TmxObject), which are organized into TmxLists.

TmxTileset objects contain data associated with tile appearance. Each tileset contains a reference to an image, which can be decomposed into a selection of individual tiles. The image reference can be either the name of an embedded resource or an explicit file path.

TmxLayer objects describe the tile map as a list, where each element contains a global tile ID for each grid point. The order is sequential, rather than as a two-dimensional array, although each element also stores its own coordinates.

TmxObjectGroup objects contain information about the Tiled "object layers". Object groups allow for organization of objects into separate layers.

TmxObject objects contain detailed information about the various Tiled objects (Locations, Tiles, Polygons, Polylines). TmxObject positions are in pixels, rather than tile position, since they are not constrained by the tile grid.

Supplemental classes and structures

TmxList is a KeyedCollection which stores lists of the principal TiledSharp classes. TiledLists are accessible by either their names or by index.

PropertyDict is a Dictionary with some nullable value support. It is used to store properties for various TiledSharp classes.