tileset 0.0.2

Tailset definition, and supports importing multiple formats
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::GridAtlas;
use image::{GenericImageView, RgbaImage, SubImage};

pub struct GridBackgroundAtlas {
    image: RgbaImage,
}

impl GridAtlas for GridBackgroundAtlas {
    fn cell_size(&self) -> u32 {
        self.image.width()
    }

    fn get_cell(&self, _: bool, _: bool, _: bool, _: bool, _: u32) -> SubImage<&RgbaImage> {
        self.image.view(0, 0, self.image.width(), self.image.height())
    }
}