pub struct TwoPartTileSet { /* private fields */ }Expand description
An implementation of TileSet that expects a hash map of tile foregrounds and a single background image.
This implementation automatically combines background and foreground on the fly. Also, it assumes “realistic” light for the rendered tiles (i.e. for rotated tiles, it mirrors the background, so it always seems like the light is coming from once source).
Implementations§
Source§impl TwoPartTileSet
impl TwoPartTileSet
Sourcepub fn new(
front: RgbaImage,
tile_map: HashMap<Tile, RgbaImage>,
) -> Result<Self, TileSetCreationError>
pub fn new( front: RgbaImage, tile_map: HashMap<Tile, RgbaImage>, ) -> Result<Self, TileSetCreationError>
Creates a new TwoPartTileSet instance using given background image and a map of tile foregrounds.
Trait Implementations§
Source§impl Debug for TwoPartTileSet
impl Debug for TwoPartTileSet
Source§impl TileSet for TwoPartTileSet
impl TileSet for TwoPartTileSet
Source§fn tile_image(&self, hand_tile: &HandTile) -> TileImageResult
fn tile_image(&self, hand_tile: &HandTile) -> TileImageResult
Returns an image of given tile, taking into account the tile placement
(rotation). Read more
Source§fn tile_width(&self) -> u32
fn tile_width(&self) -> u32
Returns tile width, in pixels. Must be the same for all images.
Source§fn tile_height(&self) -> u32
fn tile_height(&self) -> u32
Returns tile height, in pixels. Must be the same for all images.
Auto Trait Implementations§
impl Freeze for TwoPartTileSet
impl RefUnwindSafe for TwoPartTileSet
impl Send for TwoPartTileSet
impl Sync for TwoPartTileSet
impl Unpin for TwoPartTileSet
impl UnsafeUnpin for TwoPartTileSet
impl UnwindSafe for TwoPartTileSet
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