Skip to main content

Module api

Module api 

Source
Expand description

§Pane

A RON-driven retained UI library for wgpu applications.

Layouts are defined in .ron files and hot-reloaded at runtime. Pane handles all rendering, input, animation, and state — your app just reads actions and drives values.

§Three usage modes

ModeUse when
runPane owns the window and event loop entirely
overlay / PaneOverlayYou own wgpu; Pane renders into your frame
headless / PaneHeadlessNo GPU — logic, state, and events only (tests, servers)

§Quick start (overlay)

let mut ui = pane::overlay("ui/main.ron", &device, &queue, surface_format, None);

// in your event loop:
ui.handle_event(&window_event, width as f32, height as f32);

// in your render pass:
for action in ui.draw(&mut encoder, &view, width as f32, height as f32) {
    match action {
        PaneAction::Custom(id) => println!("button pressed: {id}"),
        PaneAction::Slider(id, val) => println!("{id} = {val}"),
        _ => {}
    }
}

Structs§

PaneHeadless
A Pane UI instance with no GPU or window — logic, state, and actions only.
PaneOverlay
A Pane UI instance that renders into an existing wgpu surface.
StandaloneHandle
A handle passed to the run_with callback each frame, allowing you to call toast notifications and other runtime APIs from standalone mode.

Enums§

PaneAction
An event emitted by the UI in response to user interaction.
WriteValue
The value to set when calling PaneOverlay::write or PaneHeadless::write.

Functions§

headless
Create a PaneHeadless instance — no GPU required.
overlay
Create a PaneOverlay that renders into your existing wgpu surface.
run
Run Pane as a standalone application, owning the window and event loop.
run_with
Like run, but gives you a StandaloneHandle each frame to call write, toast, etc.