pub struct StyledSurface<'s, 'a> { /* private fields */ }Expand description
A Surface with a Style bound in, returned by Surface::with_style.
Every draw call omits the style argument the underlying Surface method would otherwise
need, using the bound style instead. Reach back to the underlying surface (e.g. to call
Surface::print_line, whose per-span styles make a bound style meaningless) via
StyledSurface::surface.
Implementations§
Source§impl<'a> StyledSurface<'_, 'a>
impl<'a> StyledSurface<'_, 'a>
Sourcepub const fn surface(&mut self) -> &mut Surface<'a>
pub const fn surface(&mut self) -> &mut Surface<'a>
Borrows the underlying Surface directly, for calls that need an explicit style (e.g.
Surface::print_line) or a capability StyledSurface doesn’t expose.
Sourcepub fn put(&mut self, pos: impl Into<Pos<u16>>, ch: char)
pub fn put(&mut self, pos: impl Into<Pos<u16>>, ch: char)
Surface::put using this view’s bound style.
Sourcepub fn print(&mut self, pos: impl Into<Pos<u16>>, text: &str)
pub fn print(&mut self, pos: impl Into<Pos<u16>>, text: &str)
Surface::print using this view’s bound style.
Sourcepub fn fill_rect(&mut self, rect: Rect<u16>, ch: char)
pub fn fill_rect(&mut self, rect: Rect<u16>, ch: char)
Surface::fill_rect using this view’s bound style.
Sourcepub fn put_span<S>(
&mut self,
pos: impl Into<Pos<u16>>,
rows: &[S],
) -> Option<()>
pub fn put_span<S>( &mut self, pos: impl Into<Pos<u16>>, rows: &[S], ) -> Option<()>
Surface::put_span using this view’s bound style.
Sourcepub fn put_span_uniform(
&mut self,
pos: impl Into<Pos<u16>>,
size: impl Into<Size<u16>>,
anchor: char,
fill: char,
) -> Option<()>
pub fn put_span_uniform( &mut self, pos: impl Into<Pos<u16>>, size: impl Into<Size<u16>>, anchor: char, fill: char, ) -> Option<()>
Surface::put_span_uniform using this view’s bound style.
Sourcepub fn put_offset(
&mut self,
pos: impl Into<Pos<u16>>,
offset: impl Into<Offset>,
ch: char,
)
pub fn put_offset( &mut self, pos: impl Into<Pos<u16>>, offset: impl Into<Offset>, ch: char, )
Surface::put_offset using this view’s bound style.
Sourcepub fn put_signed(&mut self, pos: (i32, i32), ch: char)
pub fn put_signed(&mut self, pos: (i32, i32), ch: char)
Surface::put_signed using this view’s bound style.
Sourcepub fn blit(&mut self, grid: &Grid, x: u16, y: u16)
pub fn blit(&mut self, grid: &Grid, x: u16, y: u16)
Surface::blit. Takes no style: grid’s own tiles carry their own.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Surface::clear. Takes no style: cleared cells reset to Tile::default.
Sourcepub fn clear_region(&mut self, rect: Rect<u16>)
pub fn clear_region(&mut self, rect: Rect<u16>)
Surface::clear_region. Takes no style: cleared cells reset to
Tile::default.
Sourcepub const fn width(&self) -> u16
pub const fn width(&self) -> u16
Surface::width of the underlying surface.
Sourcepub const fn height(&self) -> u16
pub const fn height(&self) -> u16
Surface::height of the underlying surface.
Sourcepub const fn area(&self) -> Rect<u16>
pub const fn area(&self) -> Rect<u16>
Surface::area of the underlying surface.
Sourcepub const fn clip_rect(&self) -> Rect<u16>
pub const fn clip_rect(&self) -> Rect<u16>
Surface::clip_rect of the underlying surface.
Sourcepub const fn local_area(&self) -> Rect<u16>
pub const fn local_area(&self) -> Rect<u16>
Surface::area of the underlying surface, translated to its own local coordinate
space (self.area().at_origin()).