Struct imgui::Ui [] [src]

pub struct Ui<'ui> { /* fields omitted */ }

Methods

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'a> Ui<'a>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Pushes a value to the item width stack.

[src]

Pops a value from the item width stack.

Aborts

The current process is aborted if the item width stack is empty.

[src]

Runs a function after temporarily pushing a value to the item width stack.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Pushes an identifier to the ID stack.

[src]

Pops an identifier from the ID stack.

Aborts

The current process is aborted if the ID stack is empty.

[src]

Runs a function after temporarily pushing a value to the ID stack.

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Constructs a new color editor builder.

[src]

Constructs a new color picker builder.

[src]

Constructs a new color button builder.

[src]

Initialize current options (generally on application startup) if you want to select a default format, picker type, etc. Users will be able to change many settings, unless you use .options(false) in your widget builders.

impl<'ui> Ui<'ui>
[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Construct a tooltip window that can have any kind of content.

Typically used with Ui::is_item_hovered() or some other conditional check.

Examples

fn user_interface(ui: &Ui) {
    ui.text("Hover over me");
    if ui.is_item_hovered() {
        ui.tooltip(|| {
            ui.text_colored((1.0, 0.0, 0.0, 1.0), im_str!("I'm red!"));
        });
    }
}

[src]

Construct a tooltip window with simple text content.

Typically used with Ui::is_item_hovered() or some other conditional check.

Examples

fn user_interface(ui: &Ui) {
    ui.text("Hover over me");
    if ui.is_item_hovered() {
        ui.tooltip_text("I'm a tooltip!");
    }
}

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Creates a radio button for selecting an integer value. Returns true if pressed.

Example

ui.radio_button(im_str!("Item 1"), &mut selected_radio_value, 1);
ui.radio_button(im_str!("Item 2"), &mut selected_radio_value, 2);
ui.radio_button(im_str!("Item 3"), &mut selected_radio_value, 3);

[src]

Creates a radio button that shows as selected if the given value is true. Returns true if pressed.

Example

if ui.radio_button_bool(im_str!("Cats"), radio_button_test == "cats") {
    radio_button_test = "cats".to_string();
}
if ui.radio_button_bool(im_str!("Dogs"), radio_button_test == "dogs") {
    radio_button_test = "dogs".to_string();
}

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

impl<'ui> Ui<'ui>
[src]

[src]

Calculate the size required for a given text string.

hide_text_after_double_hash allows the user to insert comments into their text, using a double hash-tag prefix. This is a feature of imgui.

wrap_width allows you to request a width at which to wrap the text to a newline for the calculation.

impl<'ui> Ui<'ui>
[src]

[src]

Creates a progress bar. Fraction is the progress level with 0.0 = 0% and 1.0 = 100%.

Example

ui.progress_bar(0.6)
    .size((100.0, 12.0))
    .overlay_text(im_str!("Progress!"))
    .build();

impl<'ui> Ui<'ui>
[src]

[src]

Creates a child frame. Size is size of child_frame within parent window.

Example

ui.window(im_str!("ChatWindow"))
    .title_bar(true)
    .scrollable(false)
    .build(|| {
        ui.separator();

        ui.child_frame(im_str!("child frame"), (400.0, 100.0))
            .show_borders(true)
            .always_show_vertical_scroll_bar(true)
            .build(|| {
                ui.text_colored((1.0, 0.0, 0.0, 1.0), im_str!("hello mate!"));
            });
});

impl<'ui> Ui<'ui>
[src]

[src]

Runs a function after temporarily pushing a value to the style stack.

Example

ui.with_style_var(StyleVar::Alpha(0.2), || {
    ui.text(im_str!("AB"));
});

[src]

Runs a function after temporarily pushing an array of values into the stack. Supporting multiple is also easy since you can freely mix and match them in a safe manner.

Example

ui.with_style_vars(&styles, || {
    ui.text(im_str!("A"));
    ui.text(im_str!("B"));
    ui.text(im_str!("C"));
    ui.text(im_str!("D"));
});

impl<'ui> Ui<'ui>
[src]

[src]

Runs a function after temporarily pushing a value to the color stack.

Example

ui.with_color_var(ImGuiCol::Text, (1.0, 0.0, 0.0, 1.0), || {
    ui.text_wrapped(im_str!("AB"));
});

[src]

Runs a function after temporarily pushing an array of values to the color stack.

Example

let red = (1.0, 0.0, 0.0, 1.0);
let green = (0.0, 1.0, 0.0, 1.0);
ui.with_color_vars(&vars, || {
    ui.text_wrapped(im_str!("AB"));
});

impl<'ui> Ui<'ui>
[src]

[src]

Returns true if the last item is being hovered by the mouse.

Examples

fn user_interface(ui: &Ui) {
    ui.text("Hover over me");
    let is_hover_over_me_text_hovered = ui.is_item_hovered();
}