use std::u32; use rgb::RGBA; use super::layer_tile::LayerTile; #[derive(Debug)] pub struct LayerChunk { pub x: u32, pub y: u32, pub width: u32, pub height: u32, pub data: Vec, } #[derive(Debug)] pub enum LayerData { Tiles(Vec), Chunks(Vec), } #[derive(Debug)] pub struct Layer { /// Unique ID of the layer. Each layer that added to a map gets a unique id. Even if a layer is /// deleted, no layer ever gets the same ID. Can not be changed in Tiled. (since Tiled 1.2) pub id: u32, /// The name of the layer. (defaults to “”) pub name: String, /// The x coordinate of the layer in tiles. Defaults to 0 and can not be changed in Tiled. pub x: u32, /// The y coordinate of the layer in tiles. Defaults to 0 and can not be changed in Tiled. pub y: u32, /// The width of the layer in tiles. Always the same as the map width for fixed-size maps. pub width: u32, /// The height of the layer in tiles. Always the same as the map height for fixed-size maps. pub height: u32, /// The opacity of the layer as a value from 0 to 1. Defaults to 1. pub opacity: f32, /// Whether the layer is shown (1) or hidden (0). Defaults to 1. pub visible: bool, /// A tint color that is multiplied with any tiles drawn by this layer in #AARRGGBB or #RRGGBB format (optonal). pub tintcolor: Option>, /// Horizontal offset for this layer in pixels. Defaults to 0. (since 0.14) pub offsetx: u32, /// Vertical offset for this layer in pixels. Defaults to 0. (since 0.14) pub offsety: u32, // /// Horizontal parallax factor for this layer. Defaults to 1. (since 1.5) // pub parallaxx: ? // /// Vertical parallax factor for this layer. Defaults to 1. (since 1.5) // pub parallaxy: ? pub properties: Option, pub data: LayerData, }