Struct simple_tilemap::TilesetOptions
source · pub struct TilesetOptions {
pub tile_size: (u32, u32),
pub offset: (u32, u32),
pub spacing: (u32, u32),
pub key_color: Option<Color>,
}Expand description
Options used when creating a tileset.
Fields§
§tile_size: (u32, u32)Size (width x height) of a single tile.
offset: (u32, u32)Offset (x, y) - first tile’s top left corner.
spacing: (u32, u32)Spacing (x, y) - distance between tiles.
key_color: Option<Color>Key color aka mask/background color. Gets ignored when rendering the tile.
Implementations§
source§impl TilesetOptions
impl TilesetOptions
sourcepub const fn with_offset(self, offset_x: u32, offset_y: u32) -> Self
pub const fn with_offset(self, offset_x: u32, offset_y: u32) -> Self
Specify offset.
sourcepub const fn with_margin(self, margin_x: u32, margin_y: u32) -> Self
pub const fn with_margin(self, margin_x: u32, margin_y: u32) -> Self
Specify spacing.
sourcepub const fn with_key_color(self, key_color: Color) -> Self
pub const fn with_key_color(self, key_color: Color) -> Self
Specify key color.
Trait Implementations§
source§impl Clone for TilesetOptions
impl Clone for TilesetOptions
source§fn clone(&self) -> TilesetOptions
fn clone(&self) -> TilesetOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TilesetOptions
impl Debug for TilesetOptions
source§impl PartialEq for TilesetOptions
impl PartialEq for TilesetOptions
source§fn eq(&self, other: &TilesetOptions) -> bool
fn eq(&self, other: &TilesetOptions) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for TilesetOptions
impl StructuralEq for TilesetOptions
impl StructuralPartialEq for TilesetOptions
Auto Trait Implementations§
impl RefUnwindSafe for TilesetOptions
impl Send for TilesetOptions
impl Sync for TilesetOptions
impl Unpin for TilesetOptions
impl UnwindSafe for TilesetOptions
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