pub struct GlyphSkin {
pub colors: MapColors,
pub walk: WalkSpeeds,
pub foot_px: i32,
pub style: GlyphStyle,
}Expand description
A grid map as colored glyphs: each tile its terrain’s two glyphs, the ranges tinting their background (in its plain style).
Fields§
§colors: MapColorsThe palette’s names of the path’s, the cursor’s and the threat arrows’ colors.
walk: WalkSpeedsHow fast a walk is shown.
foot_px: i32How many pixels at the foot of a tile the units’ own marks use (a game’s HP bar): the cursor’s lower arms stay above them.
style: GlyphStyleHow ranges, flashes, the cursor and the threat marks show, and the cells left at the sides. (The sprite skin’s glyph ground is always in the plain style.)
Implementations§
Source§impl GlyphSkin
impl GlyphSkin
Sourcepub const fn new(colors: MapColors, walk: WalkSpeeds, foot_px: i32) -> Self
pub const fn new(colors: MapColors, walk: WalkSpeeds, foot_px: i32) -> Self
The skin of colors in the plain style, showing a walk at walk,
its cursor’s lower arms above the foot_px pixels at a tile’s foot.
Sourcepub const fn styled(self, style: GlyphStyle) -> Self
pub const fn styled(self, style: GlyphStyle) -> Self
The same skin in style.
Sourcepub fn cursor_ink(&self, looks: &Looks<'_>) -> CursorInk
pub fn cursor_ink(&self, looks: &Looks<'_>) -> CursorInk
How its cursor looks in looks’ colors.
Sourcepub fn draw_cursor<U>(
&self,
looks: &Looks<'_>,
buf: &mut GlyphBuffer,
scene: &MapScene<U>,
layout: &Layout,
)
pub fn draw_cursor<U>( &self, looks: &Looks<'_>, buf: &mut GlyphBuffer, scene: &MapScene<U>, layout: &Layout, )
Draws the scene’s cursor, if it is on a tile of layout, as the
plain style does.
Trait Implementations§
impl Copy for GlyphSkin
Source§impl<U> GridSkin<U> for GlyphSkin
impl<U> GridSkin<U> for GlyphSkin
Source§fn paint(
&self,
looks: &Looks<'_>,
scene: &MapScene<U>,
area: Rect,
units: &dyn UnitPainter<U>,
buf: &mut GlyphBuffer,
)
fn paint( &self, looks: &Looks<'_>, scene: &MapScene<U>, area: Rect, units: &dyn UnitPainter<U>, buf: &mut GlyphBuffer, )
Terrain, then the ranges on it, then what lies under the units
(UnitPainter::paint_under), the units, the path, what lies over
them (UnitPainter::paint_over) and the cursor; over them all,
the threat arrows and marks.
Source§fn tile_size(&self) -> (i32, i32)
fn tile_size(&self) -> (i32, i32)
Source§fn view_tiles(&self, area: Rect) -> (i32, i32)
fn view_tiles(&self, area: Rect) -> (i32, i32)
area cells.Source§fn grid(&self, scene: &MapScene<U>, area: Rect) -> Grid
fn grid(&self, scene: &MapScene<U>, area: Rect) -> Grid
scene’s tiles go when it is painted into area.