#tilemap #parser #clickteam

ct-tilemap

A library to help parse ClickTeam Tilemap files

4 stable releases

1.1.2 Dec 9, 2023
1.0.0 Dec 9, 2023

#734 in Parser implementations

MIT/Apache

49KB
1K SLoC

Simple library to handle Clickteam TileMap files.

use ct_tilemap::{TileMap, Tile};

fn main() {
    let mut tilemap = TileMap::read(
        /* .. */
    )?;

    for layer in tilemap.layers.iter_mut() {
        layer.resize(8, 8);
        layer[(0, 0)] = Tile {id: 0x1234};
        layer[(0, 1)] = Tile {position: [5, 3]};
        let sublayer = layer.add_sublayer(b"YES");
        sublayer[(3, 3)].copy_from_slice(b"NO!");
    }

    tilemap.write(
        /* .. */
    )?;
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3.5MB
~56K SLoC