Type Alias iced::Renderer

source ·
pub type Renderer<Theme = Theme> = Renderer<Theme>;
Expand description

The default renderer.

Aliased Type§

enum Renderer<Theme = Theme> {
    TinySkia(Renderer<Backend, Theme>),
    Wgpu(Renderer<Backend, Theme>),
}

Variants§

§

TinySkia(Renderer<Backend, Theme>)

§

Wgpu(Renderer<Backend, Theme>)

Available on crate feature wgpu only.

Trait Implementations§

§

impl<T> Renderer for Renderer<T>

Available on crate feature geometry only.
§

type Geometry = Geometry

The kind of geometry this renderer can draw.
§

fn draw(&mut self, layers: Vec<<Renderer<T> as Renderer>::Geometry, Global>)

Draws the given layers of Self::Geometry.
§

impl<T> Renderer for Renderer<T>

§

type Font = Font

The font type used.
§

type Paragraph = Paragraph

The Paragraph of this Renderer.
§

const ICON_FONT: Font = iced_tiny_skia::Renderer<T>::ICON_FONT

The icon font of the backend.
§

const CHECKMARK_ICON: char = '\u{f00c}'

The char representing a ✔ icon in the ICON_FONT.
§

const ARROW_DOWN_ICON: char = '\u{e800}'

The char representing a ▼ icon in the built-in ICON_FONT.
§

fn default_font(&self) -> <Renderer<T> as Renderer>::Font

Returns the default Self::Font.
§

fn default_size(&self) -> Pixels

Returns the default size of Text.
§

fn create_paragraph( &self, text: Text<'_, <Renderer<T> as Renderer>::Font> ) -> <Renderer<T> as Renderer>::Paragraph

Creates a new Paragraph laid out with the given Text.
§

fn resize_paragraph( &self, paragraph: &mut <Renderer<T> as Renderer>::Paragraph, new_bounds: Size<f32> )

Lays out the given Paragraph with some new boundaries.
§

fn load_font(&mut self, bytes: Cow<'static, [u8]>)

Loads a Self::Font from its bytes.
§

fn fill_paragraph( &mut self, text: &<Renderer<T> as Renderer>::Paragraph, position: Point, color: Color )

Draws the given Paragraph at the given position and with the given Color.
§

fn fill_text( &mut self, text: Text<'_, <Renderer<T> as Renderer>::Font>, position: Point, color: Color )

Draws the given Text at the given position and with the given Color.
§

fn update_paragraph( &self, paragraph: &mut Self::Paragraph, text: Text<'_, Self::Font> )

Updates a Paragraph to match the given Text, if needed.
§

impl<T> Renderer for Renderer<T>

Available on crate feature svg only.
§

fn dimensions(&self, handle: &Handle) -> Size<u32>

Returns the default dimensions of an SVG for the given Handle.
§

fn draw(&mut self, handle: Handle, color: Option<Color>, bounds: Rectangle<f32>)

Draws an SVG with the given Handle, an optional Color filter, and inside the provided bounds.
§

impl<T> Renderer for Renderer<T>

Available on crate feature image only.
§

type Handle = Handle

The image Handle to be displayed. Iced exposes its own default implementation of a Handle
§

fn dimensions(&self, handle: &Handle) -> Size<u32>

Returns the dimensions of an image for the given Handle.
§

fn draw(&mut self, handle: Handle, bounds: Rectangle<f32>)

Draws an image with the given Handle and inside the provided bounds.
§

impl<T> Renderer for Renderer<T>

§

type Theme = T

The supported theme of the Renderer.
§

fn with_layer( &mut self, bounds: Rectangle<f32>, f: impl FnOnce(&mut Renderer<T>) )

Draws the primitives recorded in the given closure in a new layer. Read more
§

fn with_translation( &mut self, translation: Vector<f32>, f: impl FnOnce(&mut Renderer<T>) )

Applies a translation to the primitives recorded in the given closure.
§

fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)

Fills a Quad with the provided Background.
§

fn clear(&mut self)

Clears all of the recorded primitives in the Renderer.