pub struct Tileset {Show 13 fields
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§
§name: String
The name of the tileset, set by the user.
tile_width: u32
The (maximum) width in pixels of the tiles in this tileset. Irrelevant for image collection tilesets.
tile_height: u32
The (maximum) height in pixels of the tiles in this tileset. Irrelevant for image collection tilesets.
spacing: u32
The spacing in pixels between the tiles in this tileset (applies to the tileset image). Irrelevant for image collection tilesets.
margin: u32
The margin around the tiles in this tileset (applies to the tileset image). Irrelevant for image collection tilesets.
tilecount: u32
The 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: u32
The number of tile columns in the tileset. Editable for image collection tilesets, otherwise calculated using image width, tile width, spacing and margin.
offset_x: i32
The x-offset to be used when drawing tiles of this tileset.
offset_y: i32
The y-offset to be used when drawing tiles of this tileset.
image: Option<Image>
A tileset can either:
- have a single spritesheet
image
intileset
(“regular” tileset); - have zero images in
tileset
and oneimage
pertile
(“image collection” tileset).
- Source: tiled issue #2117
- Source:
columns
documentation
wang_sets: Vec<WangSet>
All the wangsets present in this tileset.
properties: Properties
The custom properties of the tileset.
user_type: Option<String>
The custom tileset type, arbitrarily set by the user.