Struct quicksilver::geom::Tilemap [−][src]
pub struct Tilemap<T: Clone> { /* fields omitted */ }
A grid of Tile values
Methods
impl<T: Clone> Tilemap<T>
[src]
impl<T: Clone> Tilemap<T>
pub fn new(map_size: Vector, tile_size: Vector) -> Tilemap<T>
[src]
pub fn new(map_size: Vector, tile_size: Vector) -> Tilemap<T>
Create a map full of empty, non-solid tiles of a given size
pub fn with_data(
data: Vec<Tile<T>>,
map_size: Vector,
tile_size: Vector
) -> Tilemap<T>
[src]
pub fn with_data(
data: Vec<Tile<T>>,
map_size: Vector,
tile_size: Vector
) -> Tilemap<T>
Create a map with pre-filled data
pub fn width(&self) -> f32
[src]
pub fn width(&self) -> f32
Get the width of the map
pub fn height(&self) -> f32
[src]
pub fn height(&self) -> f32
Get the height of the map
pub fn size(&self) -> Vector
[src]
pub fn size(&self) -> Vector
Get the size of the map
pub fn region(&self) -> Rectangle
[src]
pub fn region(&self) -> Rectangle
Get the region the map takes up
pub fn tile_width(&self) -> f32
[src]
pub fn tile_width(&self) -> f32
Get the width of an individual tile
pub fn tile_height(&self) -> f32
[src]
pub fn tile_height(&self) -> f32
Get the height of an individual tile
pub fn tile_size(&self) -> Vector
[src]
pub fn tile_size(&self) -> Vector
Get the size of a tile
pub fn valid(&self, index: Vector) -> bool
[src]
pub fn valid(&self, index: Vector) -> bool
Check if a point is within the map bounds
pub fn shape_valid(&self, shape: Shape) -> bool
[src]
pub fn shape_valid(&self, shape: Shape) -> bool
Checks if a shape is valid in its entirety
pub fn get(&self, index: Vector) -> Option<&Tile<T>>
[src]
pub fn get(&self, index: Vector) -> Option<&Tile<T>>
Get the tile found at a given point, if it is valid
pub fn get_mut(&mut self, index: Vector) -> Option<&mut Tile<T>>
[src]
pub fn get_mut(&mut self, index: Vector) -> Option<&mut Tile<T>>
Get a mutable reference to a tile at a given point, if it is valid
pub fn set(&mut self, index: Vector, value: Tile<T>)
[src]
pub fn set(&mut self, index: Vector, value: Tile<T>)
Set the value at a given point
pub fn point_empty(&self, index: Vector) -> bool
[src]
pub fn point_empty(&self, index: Vector) -> bool
Find if a point's tile is empty
pub fn shape_empty(&self, shape: Shape) -> bool
[src]
pub fn shape_empty(&self, shape: Shape) -> bool
Finds if the area taken by a shape is empty
pub fn align_left(&self, x: f32) -> f32
[src]
pub fn align_left(&self, x: f32) -> f32
Align a given X value to the leftmost edge of a tile
pub fn align_right(&self, x: f32) -> f32
[src]
pub fn align_right(&self, x: f32) -> f32
Align a given X value to the rightmost edge of a tile
pub fn align_top(&self, y: f32) -> f32
[src]
pub fn align_top(&self, y: f32) -> f32
Align a given Y value to the topmost edge of a tile
pub fn align_bottom(&self, y: f32) -> f32
[src]
pub fn align_bottom(&self, y: f32) -> f32
Align a given Y value to the bottommost edge of a tile
pub fn move_until_contact(
&self,
bounds: Shape,
speed: Vector
) -> (Shape, Vector)
[src]
pub fn move_until_contact(
&self,
bounds: Shape,
speed: Vector
) -> (Shape, Vector)
Find the furthest a shape can move along a vector, and what its future speed should be
pub fn convert<U, F>(&self, conversion: F) -> Tilemap<U> where
U: Clone,
F: Fn(&T) -> U,
[src]
pub fn convert<U, F>(&self, conversion: F) -> Tilemap<U> where
U: Clone,
F: Fn(&T) -> U,
Convert a Tilemap into a map of a different type
Trait Implementations
impl<T: Clone + Clone> Clone for Tilemap<T>
[src]
impl<T: Clone + Clone> Clone for Tilemap<T>
fn clone(&self) -> Tilemap<T>
[src]
fn clone(&self) -> Tilemap<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Debug + Clone> Debug for Tilemap<T>
[src]
impl<T: Debug + Clone> Debug for Tilemap<T>