pub struct MapPicture {
pub scene: Rc<GlyphBuffer>,
pub tile_px: (i32, i32),
}Expand description
A whole map as a skin painted it, to pan over.
Fields§
§scene: Rc<GlyphBuffer>The picture: just big enough for the map.
tile_px: (i32, i32)One tile’s size in the picture, in pixels.
Implementations§
Source§impl MapPicture
impl MapPicture
Sourcepub fn paint<U>(
looks: &Looks<'_>,
skin: &dyn GridSkin<U>,
units: &dyn UnitPainter<U>,
scene: &MapScene<U>,
console: ConsoleSpec,
blank: Cell,
) -> Option<Self>
pub fn paint<U>( looks: &Looks<'_>, skin: &dyn GridSkin<U>, units: &dyn UnitPainter<U>, scene: &MapScene<U>, console: ConsoleSpec, blank: Cell, ) -> Option<Self>
All of scene (a view of a whole map, from its first tile) painted
by skin, its units by units, into a buffer of console’s cells
just big enough, cleared to blank first. None if the skin can’t
place the scene’s first tile (a scene of no tiles).
Sourcepub fn painted(
tile_px: (i32, i32),
tiles: (i32, i32),
console: ConsoleSpec,
blank: Cell,
paint: impl FnOnce(&mut GlyphBuffer),
) -> Self
pub fn painted( tile_px: (i32, i32), tiles: (i32, i32), console: ConsoleSpec, blank: Cell, paint: impl FnOnce(&mut GlyphBuffer), ) -> Self
A picture of tiles tiles (across × down) of tile_px pixels each,
painted by paint into a buffer of console’s cells just big
enough (rounded up to whole cells), cleared to blank first: for a
painter that isn’t a GridSkin.
Trait Implementations§
Source§impl Clone for MapPicture
impl Clone for MapPicture
Source§fn clone(&self) -> MapPicture
fn clone(&self) -> MapPicture
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MapPicture
impl Debug for MapPicture
Source§impl PartialEq for MapPicture
impl PartialEq for MapPicture
impl StructuralPartialEq for MapPicture
Auto Trait Implementations§
impl !Send for MapPicture
impl !Sync for MapPicture
impl Freeze for MapPicture
impl RefUnwindSafe for MapPicture
impl Unpin for MapPicture
impl UnsafeUnpin for MapPicture
impl UnwindSafe for MapPicture
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