[−][src]Struct paddle::quicksilver_compat::geom::Tilemap
A grid of Tile values
Implementations
impl<T: Clone> Tilemap<T>
[src]
pub fn new(
map_size: impl Into<Vector>,
tile_size: impl Into<Vector>
) -> Tilemap<T>
[src]
map_size: impl Into<Vector>,
tile_size: impl Into<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: impl Into<Vector>,
tile_size: impl Into<Vector>
) -> Tilemap<T>
[src]
data: Vec<Tile<T>>,
map_size: impl Into<Vector>,
tile_size: impl Into<Vector>
) -> Tilemap<T>
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]
&self,
bounds: U,
speed: impl Into<Vector>
) -> (U, 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]
U: Clone,
F: Fn(&T) -> U,
Convert a Tilemap into a map of a different type
Trait Implementations
impl<T: Clone> Clone for Tilemap<T>
[src]
impl<T: Debug + Clone> Debug for Tilemap<T>
[src]
impl<'de, T: Clone> Deserialize<'de> for Tilemap<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: Clone> Serialize for Tilemap<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for Tilemap<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Tilemap<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Tilemap<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Tilemap<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Tilemap<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Activity for T where
T: Any,
[src]
T: Any,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,