pub struct GlyphStyle {
pub range: RangeLook,
pub flash: FlashLook,
pub cursor: CursorLook,
pub threat: ThreatLook,
pub side_cells: i32,
}Expand description
How the glyph skin shows ranges, flashes, the cursor and the threat marks, and how many cells it leaves at the sides of its area.
Fields§
§range: RangeLookHow a range shows on its tiles.
flash: FlashLookHow a tile whose terrain just changed shows.
cursor: CursorLookHow the cursor shows.
threat: ThreatLookWhat colors the threat arrows and marks are.
side_cells: i32The cells left clear at each side of the area: the tiles that fit between them are centred across it (room for the cursor’s marks beside the first and last tile).
Implementations§
Source§impl GlyphStyle
impl GlyphStyle
Sourcepub const PLAIN: Self
pub const PLAIN: Self
The glyph skin’s own look: ranges tint, flashes blend, the cursor pulses, the threat marks are highlighted, no side cells.
Sourcepub fn view_tiles(&self, area: Rect) -> (i32, i32)
pub fn view_tiles(&self, area: Rect) -> (i32, i32)
How many tiles, across × down, fit in an area of area cells
between its side cells: two cells to a tile across, one down. An
odd cell is left over.
Sourcepub fn layout<U>(&self, scene: &MapScene<U>, area: Rect) -> Layout
pub fn layout<U>(&self, scene: &MapScene<U>, area: Rect) -> Layout
Where scene’s tiles go in area: as many as fit, centred across
it, from its top.
Sourcepub fn draw_tiles<U>(
&self,
looks: &Looks<'_>,
buf: &mut GlyphBuffer,
scene: &MapScene<U>,
layout: &Layout,
)
pub fn draw_tiles<U>( &self, looks: &Looks<'_>, buf: &mut GlyphBuffer, scene: &MapScene<U>, layout: &Layout, )
Draws every tile of layout: its terrain (tiles off the map are
left as they are, blank); a tile whose terrain just changed flashes;
its ranges show on it; and a tile that would change is drawn as the
terrain it would become instead.
Sourcepub fn draw_cursor<U>(
&self,
ink: CursorInk,
buf: &mut GlyphBuffer,
scene: &MapScene<U>,
layout: &Layout,
area: Rect,
)
pub fn draw_cursor<U>( &self, ink: CursorInk, buf: &mut GlyphBuffer, scene: &MapScene<U>, layout: &Layout, area: Rect, )
Draws the scene’s cursor in ink, if it is on a tile of layout
in area.
Sourcepub fn threat_colors(&self, looks: &Looks<'_>, colors: &MapColors) -> Colors
pub fn threat_colors(&self, looks: &Looks<'_>, colors: &MapColors) -> Colors
The colors of the threat arrows and marks in looks, for a skin of
colors.
Trait Implementations§
Source§impl Clone for GlyphStyle
impl Clone for GlyphStyle
Source§fn clone(&self) -> GlyphStyle
fn clone(&self) -> GlyphStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more