pub struct Tileset {Show 14 fields
pub source: PathBuf,
pub name: String,
pub tile_width: u32,
pub tile_height: u32,
pub spacing: u32,
pub margin: u32,
pub tilecount: u32,
pub columns: u32,
pub offset_x: i32,
pub offset_y: i32,
pub image: Option<Image>,
pub wang_sets: Vec<WangSet>,
pub properties: Properties,
pub user_type: Option<String>,
/* private fields */
}Expand description
A collection of tiles for usage in maps and template objects.
Also see the TMX docs.
Fields§
§source: PathBufThe path first used in a ResourceReader to load this tileset.
For embedded tilesets, this path will be the same as the template or map’s source.
name: StringThe name of the tileset, set by the user.
tile_width: u32The (maximum) width in pixels of the tiles in this tileset. Irrelevant for image collection tilesets.
tile_height: u32The (maximum) height in pixels of the tiles in this tileset. Irrelevant for image collection tilesets.
spacing: u32The spacing in pixels between the tiles in this tileset (applies to the tileset image). Irrelevant for image collection tilesets.
margin: u32The margin around the tiles in this tileset (applies to the tileset image). Irrelevant for image collection tilesets.
tilecount: u32The number of tiles in this tileset. Note that tile IDs don’t always have a connection with the tile count, and as such there may be tiles with an ID bigger than the tile count.
columns: u32The number of tile columns in the tileset. Editable for image collection tilesets, otherwise calculated using image width, tile width, spacing and margin.
offset_x: i32The x-offset to be used when drawing tiles of this tileset.
offset_y: i32The y-offset to be used when drawing tiles of this tileset.
image: Option<Image>A tileset can either:
- have a single spritesheet
imageintileset(“regular” tileset); - have zero images in
tilesetand oneimagepertile(“image collection” tileset).
- Source: tiled issue #2117
- Source:
columnsdocumentation
wang_sets: Vec<WangSet>All the wangsets present in this tileset.
properties: PropertiesThe custom properties of the tileset.
user_type: Option<String>The custom tileset type, arbitrarily set by the user.