Skip to content

v0.10.1

Compare
Choose a tag to compare
@aleokdev aleokdev released this 14 Mar 17:16
7c072c9

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

New Contributors

Full Changelog: v0.10.0...v0.10.1