Trait UiBuilder

Source
pub trait UiBuilder {
    // Required method
    fn do_ui(&mut self, ui: &Ui<Self>);

    // Provided method
    fn pre_render(&mut self, _ctx: &mut CurrentContext<'_>) { ... }
}
Expand description

The main trait that the user must implement to create a UI.

Required Methods§

Source

fn do_ui(&mut self, ui: &Ui<Self>)

User the ui value to create a UI frame.

This is equivalent to the Dear ImGui code between NewFrame and EndFrame.

Provided Methods§

Source

fn pre_render(&mut self, _ctx: &mut CurrentContext<'_>)

This function is run after do_ui but before rendering.

It can be used to clear the framebuffer, or prerender something.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§