Struct aflak_imgui::Ui [−][src]
pub struct Ui<'ui> { /* fields omitted */ }
Methods
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn imgui(&self) -> &ImGui
[src]
pub fn imgui(&self) -> &ImGui
pub fn want_capture_mouse(&self) -> bool
[src]
pub fn want_capture_mouse(&self) -> bool
pub fn want_capture_keyboard(&self) -> bool
[src]
pub fn want_capture_keyboard(&self) -> bool
pub fn framerate(&self) -> f32
[src]
pub fn framerate(&self) -> f32
pub fn metrics_allocs(&self) -> i32
[src]
pub fn metrics_allocs(&self) -> i32
pub fn metrics_render_vertices(&self) -> i32
[src]
pub fn metrics_render_vertices(&self) -> i32
pub fn metrics_render_indices(&self) -> i32
[src]
pub fn metrics_render_indices(&self) -> i32
pub fn metrics_active_windows(&self) -> i32
[src]
pub fn metrics_active_windows(&self) -> i32
pub fn render<F, E>(self, f: F) -> Result<(), E> where
F: FnMut(&Ui, DrawList) -> Result<(), E>,
[src]
pub fn render<F, E>(self, f: F) -> Result<(), E> where
F: FnMut(&Ui, DrawList) -> Result<(), E>,
pub fn show_user_guide(&self)
[src]
pub fn show_user_guide(&self)
pub fn show_default_style_editor(&self)
[src]
pub fn show_default_style_editor(&self)
pub fn show_style_editor<'p>(&self, style: &'p mut ImGuiStyle)
[src]
pub fn show_style_editor<'p>(&self, style: &'p mut ImGuiStyle)
pub fn show_test_window(&self, opened: &mut bool)
[src]
pub fn show_test_window(&self, opened: &mut bool)
: please use show_demo_window instead
pub fn show_demo_window(&self, opened: &mut bool)
[src]
pub fn show_demo_window(&self, opened: &mut bool)
pub fn show_metrics_window(&self, opened: &mut bool)
[src]
pub fn show_metrics_window(&self, opened: &mut bool)
impl<'a> Ui<'a>
[src]
impl<'a> Ui<'a>
pub unsafe fn current_ui() -> Option<&'a Ui<'a>>
[src]
pub unsafe fn current_ui() -> Option<&'a Ui<'a>>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn window<'p>(&self, name: &'p ImStr) -> Window<'ui, 'p>
[src]
pub fn window<'p>(&self, name: &'p ImStr) -> Window<'ui, 'p>
pub fn get_window_size(&self) -> (f32, f32)
[src]
pub fn get_window_size(&self) -> (f32, f32)
Get current window's size in pixels
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn push_item_width(&self, width: f32)
[src]
pub fn push_item_width(&self, width: f32)
Pushes a value to the item width stack.
pub fn pop_item_width(&self)
[src]
pub fn pop_item_width(&self)
Pops a value from the item width stack.
Aborts
The current process is aborted if the item width stack is empty.
pub fn with_item_width<F>(&self, width: f32, f: F) where
F: FnOnce(),
[src]
pub fn with_item_width<F>(&self, width: f32, f: F) where
F: FnOnce(),
Runs a function after temporarily pushing a value to the item width stack.
pub fn separator(&self)
[src]
pub fn separator(&self)
pub fn new_line(&self)
[src]
pub fn new_line(&self)
pub fn same_line(&self, pos_x: f32)
[src]
pub fn same_line(&self, pos_x: f32)
pub fn same_line_spacing(&self, pos_x: f32, spacing_w: f32)
[src]
pub fn same_line_spacing(&self, pos_x: f32, spacing_w: f32)
pub fn spacing(&self)
[src]
pub fn spacing(&self)
pub fn columns<'p>(&self, count: i32, id: &'p ImStr, border: bool)
[src]
pub fn columns<'p>(&self, count: i32, id: &'p ImStr, border: bool)
pub fn next_column(&self)
[src]
pub fn next_column(&self)
pub fn get_column_index(&self) -> i32
[src]
pub fn get_column_index(&self) -> i32
pub fn get_column_offset(&self, column_index: i32) -> f32
[src]
pub fn get_column_offset(&self, column_index: i32) -> f32
pub fn set_column_offset(&self, column_index: i32, offset_x: f32)
[src]
pub fn set_column_offset(&self, column_index: i32, offset_x: f32)
pub fn get_column_width(&self, column_index: i32) -> f32
[src]
pub fn get_column_width(&self, column_index: i32) -> f32
pub fn get_columns_count(&self) -> i32
[src]
pub fn get_columns_count(&self) -> i32
pub fn dummy<S: Into<ImVec2>>(&self, size: S)
[src]
pub fn dummy<S: Into<ImVec2>>(&self, size: S)
Fill a space of size
in pixels with nothing on the current window.
Can be used to move the cursor on the window.
pub fn get_cursor_screen_pos(&self) -> (f32, f32)
[src]
pub fn get_cursor_screen_pos(&self) -> (f32, f32)
Get cursor position on the screen, in screen coordinates. This sets the point on which the next widget will be drawn.
This is especially useful for drawing, as the drawing API uses screen coordiantes.
pub fn set_cursor_screen_pos<P: Into<ImVec2>>(&self, pos: P)
[src]
pub fn set_cursor_screen_pos<P: Into<ImVec2>>(&self, pos: P)
Set cursor position on the screen, in screen coordinates. This sets the point on which the next widget will be drawn.
pub fn get_cursor_pos(&self) -> (f32, f32)
[src]
pub fn get_cursor_pos(&self) -> (f32, f32)
Get cursor position on the screen, in window coordinates.
pub fn set_cursor_pos<P: Into<ImVec2>>(&self, pos: P)
[src]
pub fn set_cursor_pos<P: Into<ImVec2>>(&self, pos: P)
Set cursor position on the screen, in window coordinates. This sets the point on which the next widget will be drawn.
pub fn get_content_region_avail(&self) -> (f32, f32)
[src]
pub fn get_content_region_avail(&self) -> (f32, f32)
Get available space left between the cursor and the edges of the current window.
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn push_id(&self, id: i32)
[src]
pub fn push_id(&self, id: i32)
Pushes an identifier to the ID stack.
pub fn pop_id(&self)
[src]
pub fn pop_id(&self)
Pops an identifier from the ID stack.
Aborts
The current process is aborted if the ID stack is empty.
pub fn with_id<F>(&self, id: i32, f: F) where
F: FnOnce(),
[src]
pub fn with_id<F>(&self, id: i32, f: F) where
F: FnOnce(),
Runs a function after temporarily pushing a value to the ID stack.
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn text<T: AsRef<str>>(&self, text: T)
[src]
pub fn text<T: AsRef<str>>(&self, text: T)
pub fn text_colored<'p, A>(&self, col: A, text: &'p ImStr) where
A: Into<ImVec4>,
[src]
pub fn text_colored<'p, A>(&self, col: A, text: &'p ImStr) where
A: Into<ImVec4>,
pub fn text_disabled<'p>(&self, text: &'p ImStr)
[src]
pub fn text_disabled<'p>(&self, text: &'p ImStr)
pub fn text_wrapped<'p>(&self, text: &'p ImStr)
[src]
pub fn text_wrapped<'p>(&self, text: &'p ImStr)
pub fn label_text<'p>(&self, label: &'p ImStr, text: &'p ImStr)
[src]
pub fn label_text<'p>(&self, label: &'p ImStr, text: &'p ImStr)
pub fn bullet(&self)
[src]
pub fn bullet(&self)
pub fn bullet_text<'p>(&self, text: &'p ImStr)
[src]
pub fn bullet_text<'p>(&self, text: &'p ImStr)
Make a invisible event. Can be used to conveniently catch events when mouse hovers or click the area covered by this invisible button.
pub fn checkbox<'p>(&self, label: &'p ImStr, value: &'p mut bool) -> bool
[src]
pub fn checkbox<'p>(&self, label: &'p ImStr, value: &'p mut bool) -> bool
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn input_text<'p>(
&self,
label: &'p ImStr,
buf: &'p mut ImString
) -> InputText<'ui, 'p>
[src]
pub fn input_text<'p>(
&self,
label: &'p ImStr,
buf: &'p mut ImString
) -> InputText<'ui, 'p>
pub fn input_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32
) -> InputFloat<'ui, 'p>
[src]
pub fn input_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32
) -> InputFloat<'ui, 'p>
pub fn input_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> InputFloat2<'ui, 'p>
[src]
pub fn input_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> InputFloat2<'ui, 'p>
pub fn input_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> InputFloat3<'ui, 'p>
[src]
pub fn input_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> InputFloat3<'ui, 'p>
pub fn input_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> InputFloat4<'ui, 'p>
[src]
pub fn input_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> InputFloat4<'ui, 'p>
pub fn input_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32
) -> InputInt<'ui, 'p>
[src]
pub fn input_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32
) -> InputInt<'ui, 'p>
pub fn input_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> InputInt2<'ui, 'p>
[src]
pub fn input_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> InputInt2<'ui, 'p>
pub fn input_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> InputInt3<'ui, 'p>
[src]
pub fn input_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> InputInt3<'ui, 'p>
pub fn input_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> InputInt4<'ui, 'p>
[src]
pub fn input_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> InputInt4<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn drag_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32
) -> DragFloat<'ui, 'p>
[src]
pub fn drag_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32
) -> DragFloat<'ui, 'p>
pub fn drag_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> DragFloat2<'ui, 'p>
[src]
pub fn drag_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> DragFloat2<'ui, 'p>
pub fn drag_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> DragFloat3<'ui, 'p>
[src]
pub fn drag_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> DragFloat3<'ui, 'p>
pub fn drag_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> DragFloat4<'ui, 'p>
[src]
pub fn drag_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> DragFloat4<'ui, 'p>
pub fn drag_float_range2<'p>(
&self,
label: &'p ImStr,
current_min: &'p mut f32,
current_max: &'p mut f32
) -> DragFloatRange2<'ui, 'p>
[src]
pub fn drag_float_range2<'p>(
&self,
label: &'p ImStr,
current_min: &'p mut f32,
current_max: &'p mut f32
) -> DragFloatRange2<'ui, 'p>
pub fn drag_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32
) -> DragInt<'ui, 'p>
[src]
pub fn drag_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32
) -> DragInt<'ui, 'p>
pub fn drag_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> DragInt2<'ui, 'p>
[src]
pub fn drag_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> DragInt2<'ui, 'p>
pub fn drag_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> DragInt3<'ui, 'p>
[src]
pub fn drag_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> DragInt3<'ui, 'p>
pub fn drag_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> DragInt4<'ui, 'p>
[src]
pub fn drag_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> DragInt4<'ui, 'p>
pub fn drag_int_range2<'p>(
&self,
label: &'p ImStr,
current_min: &'p mut i32,
current_max: &'p mut i32
) -> DragIntRange2<'ui, 'p>
[src]
pub fn drag_int_range2<'p>(
&self,
label: &'p ImStr,
current_min: &'p mut i32,
current_max: &'p mut i32
) -> DragIntRange2<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn slider_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32,
min: f32,
max: f32
) -> SliderFloat<'ui, 'p>
[src]
pub fn slider_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32,
min: f32,
max: f32
) -> SliderFloat<'ui, 'p>
pub fn slider_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2],
min: f32,
max: f32
) -> SliderFloat2<'ui, 'p>
[src]
pub fn slider_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2],
min: f32,
max: f32
) -> SliderFloat2<'ui, 'p>
pub fn slider_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3],
min: f32,
max: f32
) -> SliderFloat3<'ui, 'p>
[src]
pub fn slider_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3],
min: f32,
max: f32
) -> SliderFloat3<'ui, 'p>
pub fn slider_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4],
min: f32,
max: f32
) -> SliderFloat4<'ui, 'p>
[src]
pub fn slider_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4],
min: f32,
max: f32
) -> SliderFloat4<'ui, 'p>
pub fn slider_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32,
min: i32,
max: i32
) -> SliderInt<'ui, 'p>
[src]
pub fn slider_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32,
min: i32,
max: i32
) -> SliderInt<'ui, 'p>
pub fn slider_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2],
min: i32,
max: i32
) -> SliderInt2<'ui, 'p>
[src]
pub fn slider_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2],
min: i32,
max: i32
) -> SliderInt2<'ui, 'p>
pub fn slider_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3],
min: i32,
max: i32
) -> SliderInt3<'ui, 'p>
[src]
pub fn slider_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3],
min: i32,
max: i32
) -> SliderInt3<'ui, 'p>
pub fn slider_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4],
min: i32,
max: i32
) -> SliderInt4<'ui, 'p>
[src]
pub fn slider_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4],
min: i32,
max: i32
) -> SliderInt4<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn color_edit<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorEdit<'ui, 'p>
[src]
pub fn color_edit<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorEdit<'ui, 'p>
Constructs a new color editor builder.
pub fn color_picker<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorPicker<'ui, 'p>
[src]
pub fn color_picker<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorPicker<'ui, 'p>
Constructs a new color picker builder.
Constructs a new color button builder.
pub fn set_color_edit_options(&self, flags: ImGuiColorEditFlags)
[src]
pub fn set_color_edit_options(&self, flags: ImGuiColorEditFlags)
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]
impl<'ui> Ui<'ui>
pub fn tree_node<'p>(&self, id: &'p ImStr) -> TreeNode<'ui, 'p>
[src]
pub fn tree_node<'p>(&self, id: &'p ImStr) -> TreeNode<'ui, 'p>
pub fn collapsing_header<'p>(
&self,
label: &'p ImStr
) -> CollapsingHeader<'ui, 'p>
[src]
pub fn collapsing_header<'p>(
&self,
label: &'p ImStr
) -> CollapsingHeader<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn selectable<'p, S: Into<ImVec2>>(
&self,
label: &'p ImStr,
selected: bool,
flags: ImGuiSelectableFlags,
size: S
) -> bool
[src]
pub fn selectable<'p, S: Into<ImVec2>>(
&self,
label: &'p ImStr,
selected: bool,
flags: ImGuiSelectableFlags,
size: S
) -> bool
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn tooltip<F: FnOnce()>(&self, f: F)
[src]
pub fn tooltip<F: FnOnce()>(&self, f: F)
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!")); }); } }
pub fn tooltip_text<T: AsRef<str>>(&self, text: T)
[src]
pub fn tooltip_text<T: AsRef<str>>(&self, text: T)
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]
impl<'ui> Ui<'ui>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn open_popup<'p>(&self, str_id: &'p ImStr)
[src]
pub fn open_popup<'p>(&self, str_id: &'p ImStr)
pub fn popup<'p, F>(&self, str_id: &'p ImStr, f: F) where
F: FnOnce(),
[src]
pub fn popup<'p, F>(&self, str_id: &'p ImStr, f: F) where
F: FnOnce(),
pub fn close_current_popup(&self)
[src]
pub fn close_current_popup(&self)
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn combo<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
[src]
pub fn combo<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn list_box<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
[src]
pub fn list_box<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
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);
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]
impl<'ui> Ui<'ui>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn plot_histogram<'p>(
&self,
label: &'p ImStr,
values: &'p [f32]
) -> PlotHistogram<'ui, 'p>
[src]
pub fn plot_histogram<'p>(
&self,
label: &'p ImStr,
values: &'p [f32]
) -> PlotHistogram<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn calc_text_size(
&self,
text: &ImStr,
hide_text_after_double_hash: bool,
wrap_width: f32
) -> ImVec2
[src]
pub fn calc_text_size(
&self,
text: &ImStr,
hide_text_after_double_hash: bool,
wrap_width: f32
) -> ImVec2
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]
impl<'ui> Ui<'ui>
pub fn get_text_line_height_with_spacing(&self) -> f32
[src]
pub fn get_text_line_height_with_spacing(&self) -> f32
Get height of a line of previously drawn text item
pub fn get_item_rect_size(&self) -> (f32, f32)
[src]
pub fn get_item_rect_size(&self) -> (f32, f32)
Get previously drawn item's size
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn progress_bar<'p>(&self, fraction: f32) -> ProgressBar<'ui, 'p>
[src]
pub fn progress_bar<'p>(&self, fraction: f32) -> ProgressBar<'ui, 'p>
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]
impl<'ui> Ui<'ui>
pub fn child_frame<'p, S: Into<ImVec2>>(
&self,
name: &'p ImStr,
size: S
) -> ChildFrame<'ui, 'p>
[src]
pub fn child_frame<'p, S: Into<ImVec2>>(
&self,
name: &'p ImStr,
size: S
) -> ChildFrame<'ui, 'p>
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]
impl<'ui> Ui<'ui>
Widgets: Images
pub fn image<T, S>(&self, texture: &T, size: S) -> Image where
T: ImTexture,
S: Into<ImVec2>,
[src]
pub fn image<T, S>(&self, texture: &T, size: S) -> Image where
T: ImTexture,
S: Into<ImVec2>,
Initiate the drawing of an image.
The image data should be an object implementing the ImTexture
trait,
typically an AnyTexture
object got from Ui::make_texture
.
Examples
Example using glium as back-end
#[macro_use] extern crate aflak_imgui; extern crate glium; extern crate aflak_imgui_glium_renderer; use aflak_imgui::*; use aflak_imgui_glium_renderer::Texture; use glium::backend::Facade; fn make_a_texture<F: Facade>(ui: &Ui, facade: &F, data: Vec<Vec<(u8, u8, u8, u8)>>) { let texture_handle = ui.replace_texture( im_str!("#Texture Name ID"), Texture::from_data(facade, data).unwrap(), ); ui.image(&texture_handle, [100.0, 100.0]).build(); }
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn with_style_var<F: FnOnce()>(&self, style_var: StyleVar, f: F)
[src]
pub fn with_style_var<F: FnOnce()>(&self, style_var: StyleVar, f: F)
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")); });
pub fn with_style_vars<F: FnOnce()>(&self, style_vars: &[StyleVar], f: F)
[src]
pub fn with_style_vars<F: FnOnce()>(&self, style_vars: &[StyleVar], f: F)
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]
impl<'ui> Ui<'ui>
pub fn with_color_var<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
var: ImGuiCol,
color: C,
f: F
)
[src]
pub fn with_color_var<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
var: ImGuiCol,
color: C,
f: F
)
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")); });
pub fn with_color_vars<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
color_vars: &[(ImGuiCol, C)],
f: F
)
[src]
pub fn with_color_vars<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
color_vars: &[(ImGuiCol, C)],
f: F
)
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]
impl<'ui> Ui<'ui>
pub fn with_style_and_color_vars<F, C>(
&self,
style_vars: &[StyleVar],
color_vars: &[(ImGuiCol, C)],
f: F
) where
F: FnOnce(),
C: Into<ImVec4> + Copy,
[src]
pub fn with_style_and_color_vars<F, C>(
&self,
style_vars: &[StyleVar],
color_vars: &[(ImGuiCol, C)],
f: F
) where
F: FnOnce(),
C: Into<ImVec4> + Copy,
Runs a function after temporarily pushing an array of values to the style and color stack.
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn is_item_hovered(&self) -> bool
[src]
pub fn is_item_hovered(&self) -> bool
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(); }
pub fn is_window_hovered(&self) -> bool
[src]
pub fn is_window_hovered(&self) -> bool
Return true
if the current window is being hovered by the mouse.
pub fn is_item_active(&self) -> bool
[src]
pub fn is_item_active(&self) -> bool
Returns true
if the last item is being active.
pub fn group<F: FnOnce()>(&self, f: F)
[src]
pub fn group<F: FnOnce()>(&self, f: F)
Group items together as a single item.
May be useful to handle the same mouse event on a group of items, for example.
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn get_window_draw_list(&'ui self) -> WindowDrawList<'ui>
[src]
pub fn get_window_draw_list(&'ui self) -> WindowDrawList<'ui>
Get access to drawing API
Examples
fn custom_draw(ui: &Ui) { let draw_list = ui.get_window_draw_list(); // Draw a line const WHITE: [f32; 3] = [1.0, 1.0, 1.0]; draw_list.add_line([100.0, 100.0], [200.0, 200.0], WHITE).build(); // Continue drawing ... }
This function will panic if several instances of WindowDrawList
coexist. Before a new instance is got, a previous instance should be
dropped.
fn custom_draw(ui: &Ui) { let draw_list = ui.get_window_draw_list(); // Draw something... // This second call will panic! let draw_list = ui.get_window_draw_list(); }
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
pub fn make_texture<F, T>(&self, name: &ImStr, f: F) -> AnyTexture where
F: FnOnce() -> T,
T: 'static + ImTexture,
[src]
pub fn make_texture<F, T>(&self, name: &ImStr, f: F) -> AnyTexture where
F: FnOnce() -> T,
T: 'static + ImTexture,
Register a texture into ImGui the first time the function is called. Just reuse the texture on subsequent uses.
Returns a handle to the texture as an AnyTexture
object. A back-end
(e.g. glium) is needed to create the texture.
Examples
Example using glium as back-end
#[macro_use] extern crate aflak_imgui; extern crate glium; extern crate aflak_imgui_glium_renderer; use aflak_imgui::*; use aflak_imgui_glium_renderer::Texture; use glium::backend::Facade; use glium::Texture2d; fn make_a_texture<F: Facade>(ui: &Ui, facade: &F) { let texture_handle = ui.make_texture(im_str!("#Texture Name ID"), || { Texture::from_texture_2d(Texture2d::empty(facade, 100, 100).unwrap()) }); // ... Do something with `texture_handle` }
pub fn replace_texture<T>(&self, name: &ImStr, t: T) -> AnyTexture where
T: 'static + ImTexture,
[src]
pub fn replace_texture<T>(&self, name: &ImStr, t: T) -> AnyTexture where
T: 'static + ImTexture,
Swap and replace with the given new texture each time the function is called.
Returns a handle to the texture as an AnyTexture
object. A back-end
(e.g. glium) is needed to create the texture.
Examples
Example using glium as back-end
#[macro_use] extern crate aflak_imgui; extern crate glium; extern crate aflak_imgui_glium_renderer; use aflak_imgui::*; use aflak_imgui_glium_renderer::Texture; use glium::backend::Facade; fn make_a_texture<F: Facade>(ui: &Ui, facade: &F, data: Vec<Vec<(u8, u8, u8, u8)>>) { let texture_handle = ui.replace_texture( im_str!("#Texture Name ID"), Texture::from_data(facade, data).unwrap(), ); // ... Do something with `texture_handle` }