Struct ct_tilemap::SubLayer
source · pub struct SubLayer { /* private fields */ }Expand description
A sublayer within a layer of a tilemap.
Implementations§
source§impl SubLayer
impl SubLayer
sourcepub fn set_default(&mut self, default: &[u8])
pub fn set_default(&mut self, default: &[u8])
Set the default value of the sublayer, resizing all cells to its length.
The default value is truncated to 4 bytes if larger.
If the new default value is larger than the old one, all cells are zero padded to the new length.
If the new default is smaller, all cells are truncated to its length.
This will only not reallocate if the length of the new default is the same as the old one!
sourcepub fn get(&self, (x, y): (u32, u32)) -> Option<&[u8]>
pub fn get(&self, (x, y): (u32, u32)) -> Option<&[u8]>
Get a cell by position. Returns None if out of bounds.
Trait Implementations§
source§impl PartialEq for SubLayer
impl PartialEq for SubLayer
impl Eq for SubLayer
impl StructuralEq for SubLayer
impl StructuralPartialEq for SubLayer
Auto Trait Implementations§
impl RefUnwindSafe for SubLayer
impl Send for SubLayer
impl Sync for SubLayer
impl Unpin for SubLayer
impl UnwindSafe for SubLayer
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