pub struct ChunkData { /* private fields */ }
Expand description
Part of an infinite tile layer’s data.
Has only the tile data contained within and not a reference to the map it is part of.
In 99.99% of cases you’ll actually want to use Chunk
.
Implementations§
Source§impl ChunkData
impl ChunkData
Sourcepub const WIDTH: u32 = 16u32
pub const WIDTH: u32 = 16u32
Infinite layer chunk width. This constant might change between versions, not counting as a breaking change.
Sourcepub const HEIGHT: u32 = 16u32
pub const HEIGHT: u32 = 16u32
Infinite layer chunk height. This constant might change between versions, not counting as a breaking change.
Sourcepub const TILE_COUNT: usize = 256usize
pub const TILE_COUNT: usize = 256usize
Infinite layer chunk tile count. This constant might change between versions, not counting as a breaking change.
Sourcepub fn get_tile_data(&self, x: i32, y: i32) -> Option<&LayerTileData>
pub fn get_tile_data(&self, x: i32, y: i32) -> Option<&LayerTileData>
Obtains the tile data present at the position given relative to the chunk’s top-left-most tile.
If the position given is invalid or the position is empty, this function will return None
.
If you want to get a LayerTile
instead, use Chunk::get_tile()
.