[][src]Struct quicksilver::geom::Tilemap

pub struct Tilemap<T: Clone> { /* fields omitted */ }

A grid of Tile values

Methods

impl<T: Clone> Tilemap<T>[src]

pub fn new(
    map_size: impl Into<Vector>,
    tile_size: impl Into<Vector>
) -> Tilemap<T>
[src]

Create a map full of empty, non-solid tiles of a given size

pub fn with_data(
    data: Vec<Tile<T>>,
    map_size: impl Into<Vector>,
    tile_size: impl Into<Vector>
) -> Tilemap<T>
[src]

Create a map with pre-filled data

pub fn width(&self) -> f32[src]

Get the width of the map

pub fn height(&self) -> f32[src]

Get the height of the map

pub fn size(&self) -> Vector[src]

Get the size of the map

pub fn region(&self) -> Rectangle[src]

Get the region the map takes up

pub fn tile_width(&self) -> f32[src]

Get the width of an individual tile

pub fn tile_height(&self) -> f32[src]

Get the height of an individual tile

pub fn tile_size(&self) -> Vector[src]

Get the size of a tile

pub fn valid(
    &self,
    index: impl Into<Vector>
) -> bool
[src]

Check if a point is within the map bounds

pub fn shape_valid(
    &self,
    shape: impl Shape
) -> bool
[src]

Checks if a shape is valid in its entirety

pub fn get(
    &self,
    index: impl Into<Vector>
) -> Option<&Tile<T>>
[src]

Get the tile found at a given point, if it is valid

pub fn get_mut(
    &mut self,
    index: impl Into<Vector>
) -> Option<&mut Tile<T>>
[src]

Get a mutable reference to a tile at a given point, if it is valid

pub fn set(
    &mut self,
    index: impl Into<Vector>,
    value: Tile<T>
)
[src]

Set the value at a given point

pub fn point_empty(
    &self,
    index: impl Into<Vector>
) -> bool
[src]

Find if a point's tile is empty

pub fn shape_empty(
    &self,
    shape: &impl Shape
) -> bool
[src]

Finds if the area taken by a shape is empty

pub fn align_left(&self, x: f32) -> f32[src]

Align a given X value to the leftmost edge of a tile

pub fn align_right(&self, x: f32) -> f32[src]

Align a given X value to the rightmost edge of a tile

pub fn align_top(&self, y: f32) -> f32[src]

Align a given Y value to the topmost edge of a tile

pub fn align_bottom(&self, y: f32) -> f32[src]

Align a given Y value to the bottommost edge of a tile

#[must_use]
pub fn move_until_contact<U: Shape>(
    &self,
    bounds: U,
    speed: impl Into<Vector>
) -> (U, Vector)
[src]

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]

Convert a Tilemap into a map of a different type

Trait Implementations

impl<T: Clone + Clone> Clone for Tilemap<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug + Clone> Debug for Tilemap<T>[src]

impl<T: Clone> Serialize for Tilemap<T> where
    T: Serialize
[src]

impl<'de, T: Clone> Deserialize<'de> for Tilemap<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Send for Tilemap<T> where
    T: Send

impl<T> Sync for Tilemap<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]