Renderer

Trait Renderer 

Source
pub trait Renderer {
    // Required methods
    fn fill_rect(&mut self, rect: Rect, color: Color);
    fn draw_text(&mut self, position: (i32, i32), text: &str, color: Color);
}
Expand description

Target-agnostic drawing interface.

Renderers are supplied to widgets during the draw phase. Implementations may target a physical display, an off-screen buffer or a simulator window.

Required Methods§

Source

fn fill_rect(&mut self, rect: Rect, color: Color)

Fill the given rectangle with a solid color.

Source

fn draw_text(&mut self, position: (i32, i32), text: &str, color: Color)

Draw UTF‑8 text with its baseline anchored at the provided position using the color.

Implementors§