pub struct Map {
pub properties: HashMap<String, Property>,
pub tilesets: Vec<Arc<Tileset>>,
pub layers: Vec<Layer>,
pub width: u32,
pub height: u32,
pub tile_type: TileType,
pub background: [u8; 4],
}Expand description
A tiled map loaded from a .tmx file.
Fields§
§properties: HashMap<String, Property>Custom properties.
tilesets: Vec<Arc<Tileset>>Tilesets used in the map.
layers: Vec<Layer>Layers contained in the map.
width: u32The total width of the map, measured in tiles.
height: u32The total height of the map, measured in tiles.
tile_type: TileTypeThe rendering type of the map.
background: [u8; 4]Background color of the map.
Implementations§
Source§impl Map
impl Map
Sourcepub fn get_tileset(&self, gid: u32) -> Option<Arc<Tileset>>
pub fn get_tileset(&self, gid: u32) -> Option<Arc<Tileset>>
Retrieve the tileset associated with the global tile id (gid).
If no tileset is associated with the gid, None is returned.
Auto Trait Implementations§
impl Freeze for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more