pub struct TileMap { /* private fields */ }Expand description
Grid-based 2D tilemap supporting O(visible) frustum-culled rendering and tile solidity queries.
Implementations§
Source§impl TileMap
Tile lookup, mutation, and world-space queries for TileMap.
impl TileMap
Tile lookup, mutation, and world-space queries for TileMap.
Sourcepub fn add_palette_entry(&mut self, entry: TilePaletteEntry) -> u16
pub fn add_palette_entry(&mut self, entry: TilePaletteEntry) -> u16
Sourcepub fn set_tile(&mut self, col: usize, row: usize, tile_id: u16)
pub fn set_tile(&mut self, col: usize, row: usize, tile_id: u16)
Sets the tile identifier at grid coordinate (col, row).
§Arguments
&Self- Mutable tilemap.usize- Column index.usize- Row index.u16- Tile identifier.
Sourcepub fn is_solid_at_world(&self, world_pt: Point) -> bool
pub fn is_solid_at_world(&self, world_pt: Point) -> bool
Sourcepub fn world_bounds(&self) -> Rect
pub fn world_bounds(&self) -> Rect
Source§impl TileMap
impl TileMap
pub fn get_columns(&self) -> usize
pub fn get_mut_columns(&mut self) -> &mut usize
pub fn set_columns(&mut self, val: usize) -> &mut Self
pub fn get_rows(&self) -> usize
pub fn get_mut_rows(&mut self) -> &mut usize
pub fn set_rows(&mut self, val: usize) -> &mut Self
pub fn get_tile_size(&self) -> f32
pub fn get_mut_tile_size(&mut self) -> &mut f32
pub fn set_tile_size(&mut self, val: f32) -> &mut Self
pub fn get_cells(&self) -> &Vec<u16>
pub fn get_mut_cells(&mut self) -> &mut Vec<u16>
pub fn set_cells(&mut self, val: Vec<u16>) -> &mut Self
pub fn get_palette(&self) -> &Vec<TilePaletteEntry>
pub fn get_mut_palette(&mut self) -> &mut Vec<TilePaletteEntry>
pub fn set_palette(&mut self, val: Vec<TilePaletteEntry>) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Forget for TileMap
impl Freeze for TileMap
impl Move for TileMap
impl RefUnwindSafe for TileMap
impl Send for TileMap
impl Sync for TileMap
impl Unpin for TileMap
impl UnsafeUnpin for TileMap
impl UnwindSafe for TileMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more