Trait easy_imgui::UiBuilder

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

    // Provided methods
    fn build_custom_atlas(&mut self, _atlas: &mut FontAtlasMut<'_, Self>) { ... }
    fn pre_render(&mut self) { ... }
}
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 build_custom_atlas(&mut self, _atlas: &mut FontAtlasMut<'_, Self>)

This function is run the first time an ImGui context is used to create the font atlas.

You can force new call by invalidating the current atlas by calling Context::invalidate_font_atlas.

source

fn pre_render(&mut self)

This function is run after do_ui but before rendering.

It can be used to clear the framebuffer.

Object Safety§

This trait is not object safe.

Implementors§