Expand description
tego is a simple library for loading Tiled maps.
It aims to provide a simple, yet flexible API, without forcing any special image format to the user or assuming that data is provided as a file.
As a starting point, load a map using any of the from_* functions provided in the Map type. And inspect the Layers inside of it.
let path = std::path::Path::new("example-maps/default/default_map.tmx");
let mymap = tego::Map::from_file(&path)?;
println!(
"Map {} is {} by {} pixels.", path.display(),
mymap.size.x * mymap.tile_size.x, mymap.size.y * mymap.tile_size.y
);
Modules§
- math
- Module to contain some simple math primitives for working with pixel coordinates.
Structs§
- Color
- An 8 bit RGB color with alpha value.
- File
Provider - Provider that reads the data from files on the file system.
- GID
- Global Tile ID A GID acts as an index into any tileset referenced in the map
- Group
Layer - A layer to group multiple sub-layers
- Map
- The Map struct is the top level container for all relevant data inside of a Tiled map. A Map consists of TileSets and Layers. Stacking the layers in iteration order creates the final map image. Each layer contains indices (GIDs) referencing a specific tile in a tile sets.
- Object
- An element of an ObjectLayer. Objects do not need to be aligned to the normal tile grid. Objects can have different kinds, (e.g. rect, ellipse, text). See ObjectKind for more info.
- Object
Layer - An ObjectLayer is a container of Objects. Objects are not aligned to the tile grid, and can be used to include extra information in a map.
- Property
- Property
Container - Resource
Manager - Tile
Iterator - Tile
Layer - TileSet
- Version
- Version number consisting out of a MAJOR and MINOR version number, followed by an optional PATCH
Enums§
- Error
- Image
Storage - Layer
- This enum contains the different types of layers that can be found in a map
- Object
Kind - Orientation
- Property
Value - Renderorder
Traits§
- Image
Loader - Provider
- Trait to provide external data.