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