Module ui

Source
Expand description

User interface rendering.

§Getting Started

First we create a context, then we create a Ui, which we can use to “stage” our paths, text, etc:

use renderling::ui::prelude::*;
use glam::Vec2;

let ctx = futures_lite::future::block_on(Context::headless(100, 100));
let mut ui = Ui::new(&ctx);

let _path = ui
    .path_builder()
    .with_stroke_color([1.0, 1.0, 0.0, 1.0])
    .with_rectangle(Vec2::splat(10.0), Vec2::splat(60.0))
    .stroke();

let frame = ctx.get_next_frame().unwrap();
ui.render(&frame.view());
frame.present();

Modules§

prelude
A prelude for user interface development, meant to be glob-imported.
sdf
2d signed distance fields.

Structs§

Cache
A text cache maintained mostly by ab_glyph.
FillOptions
FontArc
Font implementor that wraps another concrete Font + 'static type storing in an Arc.
FontId
Id for a font.
GlyphCache
A cache of glyphs.
ImageId
An image identifier.
Section
An object that contains all the info to render a varied section of text. That is one including many parts with differing fonts/scales/colors bowing to a single layout.
StrokeOptions
Text
SectionText + extra.
Ui
A 2d user interface renderer.
UiImage
UiPath
UiPathBuilder
UiText
UiTextBuilder
UiTransform
A two dimensional transformation.

Enums§

LineCap
Line cap as defined by the SVG specification.
LineJoin
Line join as defined by the SVG specification.
UiError