v0.10.1
This update fixes a small documentation issue and adds a more streamlined way of loading assets.
The old methods for loading maps and tilesets have been deprecated.
Before:
use tiled::{FilesystemResourceCache, Map};
fn main() {
let map = Map::parse_file(
"assets/tiled_base64_zlib.tmx",
&mut FilesystemResourceCache::new(),
)
.unwrap();
println!("{:?}", map);
println!("{:?}", map.tilesets()[0].get_tile(0).unwrap().probability);
}
Now:
use tiled::Loader;
fn main() {
let mut loader = Loader::new();
let map = loader.load_tmx_map("assets/tiled_base64_zlib.tmx").unwrap();
println!("{:?}", map);
println!("{:?}", map.tilesets()[0].get_tile(0).unwrap().probability);
let tileset = loader.load_tsx_tileset("assets/tilesheet.tsx").unwrap();
assert_eq!(*map.tilesets()[0], tileset);
}
See the docs for more detail.
What's Changed
- Make malformed tileset attributes error more accurate by @mswiger in #194
- Add loader type by @aleokdev in #193
New Contributors
Full Changelog: v0.10.0...v0.10.1