pub struct Ui<A>where
A: ?Sized,{ /* private fields */ }Expand description
Ui represents an ImGui frame that is being built.
Usually you will get a &mut Ui when you are expected to build a user interface,
as in UiBuilder::do_ui.
Implementations§
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn set_next_item_selection_user_data(&self, i: usize)
pub fn is_item_toggled_selection(&self) -> bool
Sourcepub fn with_multi_select<R, Storage: MultiSelectStorage>(
&self,
flags: MultiSelectFlags,
items_count: Option<usize>,
storage: Storage,
f: impl FnOnce(&mut Storage, &mut MultiSelect) -> R,
) -> R
pub fn with_multi_select<R, Storage: MultiSelectStorage>( &self, flags: MultiSelectFlags, items_count: Option<usize>, storage: Storage, f: impl FnOnce(&mut Storage, &mut MultiSelect) -> R, ) -> R
Wraps the call to f between BeginMultiselect and EndMultiselect.
The storage argument defines how the selection status will be stored.
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn window_config<S: IntoCStr>(&self, name: LblId<S>) -> Window<'_, S>
pub fn window_config<S: IntoCStr>(&self, name: LblId<S>) -> Window<'_, S>
Dear ImGui (Begin): push window to the stack and start appending to it. End() = pop window from the stack.
Source§impl<A> Ui<A>
impl<A> Ui<A>
Dear ImGui (SmallButton): button with (FramePadding.y == 0) to easily embed within text
Dear ImGui (SmallButton): button with (FramePadding.y == 0) to easily embed within text
Source§impl<A> Ui<A>
impl<A> Ui<A>
Dear ImGui (InvisibleButton): flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)
Source§impl<A> Ui<A>
impl<A> Ui<A>
Dear ImGui (ArrowButton): square button with an arrow shape
Dear ImGui (ArrowButton): square button with an arrow shape
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn progress_bar_config<'a>(&self, fraction: f32) -> ProgressBar<'_, &'a str>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn image_config<'t>( &self, texture_ref: TextureRef<'t>, size: Vector2, ) -> Image<'_, 't>
pub fn image_with_custom_rect_config( &self, ridx: CustomRectIndex, scale: f32, ) -> Image<'_, '_>
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn image_with_bg_config<'t>(
&self,
texture_ref: TextureRef<'t>,
size: Vector2,
) -> ImageWithBg<'_, 't>
pub fn image_with_bg_config<'t>( &self, texture_ref: TextureRef<'t>, size: Vector2, ) -> ImageWithBg<'_, 't>
Dear ImGui (ImageWithBg): display image with background
Sourcepub fn image_with_bg_with_custom_rect_config(
&self,
ridx: CustomRectIndex,
scale: f32,
) -> ImageWithBg<'_, '_>
pub fn image_with_bg_with_custom_rect_config( &self, ridx: CustomRectIndex, scale: f32, ) -> ImageWithBg<'_, '_>
Dear ImGui (ImageWithBg): display image with background
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn selectable_config<S: IntoCStr>( &self, label: LblId<S>, ) -> Selectable<'_, S>
pub fn selectable<S: IntoCStr>(&self, label: LblId<S>) -> bool
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> DragFloat2<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> DragFloat3<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> DragFloat4<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut f32, ) -> SliderFloat<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> SliderFloat2<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> SliderFloat3<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> SliderFloat4<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 2], ) -> SliderInt2<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 3], ) -> SliderInt3<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 4], ) -> SliderInt4<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn slider_angle_config<'v, S: IntoCStr>(
&self,
label: LblId<S>,
v_rad: &'v mut f32,
) -> SliderAngle<'_, 'v, S>
pub fn slider_angle_config<'v, S: IntoCStr>( &self, label: LblId<S>, v_rad: &'v mut f32, ) -> SliderAngle<'_, 'v, S>
Dear ImGui (SliderAngle): slider angle
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_edit_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut [f32; 3], ) -> ColorEdit3<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_edit_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut Color, ) -> ColorEdit4<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_picker_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut [f32; 3], ) -> ColorPicker3<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_picker_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut Color, ) -> ColorPicker4<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_os_string_config<'v, S: IntoCStr>( &self, label: LblId<S>, text: &'v mut OsString, ) -> InputOsString<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_text_multiline_config<'v, S: IntoCStr>( &self, label: LblId<S>, text: &'v mut String, ) -> InputTextMultiline<'_, 'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_text_hint_config<'v, S1: IntoCStr, S2: IntoCStr>( &self, label: LblId<S1>, hint: S2, text: &'v mut String, ) -> InputTextHint<'_, 'v, S1, S2>
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn input_float_config<'v, S: IntoCStr>(
&self,
label: LblId<S>,
value: &'v mut f32,
) -> InputFloat<'_, 'v, S>
pub fn input_float_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut f32, ) -> InputFloat<'_, 'v, S>
Dear ImGui (InputFloat): input float
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn input_float_2_config<'v, S: IntoCStr>(
&self,
label: LblId<S>,
value: &'v mut [f32; 2],
) -> InputFloat2<'_, 'v, S>
pub fn input_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> InputFloat2<'_, 'v, S>
Dear ImGui (InputFloat2): input float 2
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn input_float_3_config<'v, S: IntoCStr>(
&self,
label: LblId<S>,
value: &'v mut [f32; 3],
) -> InputFloat3<'_, 'v, S>
pub fn input_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> InputFloat3<'_, 'v, S>
Dear ImGui (InputFloat3): input float 3
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn input_float_4_config<'v, S: IntoCStr>(
&self,
label: LblId<S>,
value: &'v mut [f32; 4],
) -> InputFloat4<'_, 'v, S>
pub fn input_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> InputFloat4<'_, 'v, S>
Dear ImGui (InputFloat4): input float 4
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn collapsing_header_config<S: IntoCStr>( &self, label: LblId<S>, ) -> CollapsingHeader<S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn popup_modal_config<S: IntoCStr>(
&self,
name: LblId<S>,
) -> PopupModal<'static, S>
pub fn popup_modal_config<S: IntoCStr>( &self, name: LblId<S>, ) -> PopupModal<'static, S>
Dear ImGui (BeginPopupModal): begin popup modal
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn popup_context_item_config<'a>(&self) -> PopupContextItem<&'a str>
pub fn popup_context_item_config<'a>(&self) -> PopupContextItem<&'a str>
Dear ImGui (BeginPopupContext…): begin popup context
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn popup_context_window_config<'a>(&self) -> PopupContextWindow<&'a str>
pub fn popup_context_window_config<'a>(&self) -> PopupContextWindow<&'a str>
Dear ImGui (BeginPopupContext…): begin popup context
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn popup_context_void_config<'a>(&self) -> PopupContextVoid<&'a str>
pub fn popup_context_void_config<'a>(&self) -> PopupContextVoid<&'a str>
Dear ImGui (BeginPopupContext…): begin popup context
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn combo_config<'a, S: IntoCStr>(
&self,
label: LblId<S>,
) -> Combo<S, &'a str>
pub fn combo_config<'a, S: IntoCStr>( &self, label: LblId<S>, ) -> Combo<S, &'a str>
Dear ImGui (BeginCombo): begin combo box
pub fn combo<V: Copy + PartialEq, S1: IntoCStr, S2: IntoCStr>( &self, label: LblId<S1>, values: impl IntoIterator<Item = V>, f_name: impl Fn(V) -> S2, current: &mut V, ) -> bool
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn list_box_config<S: IntoCStr>(&self, label: LblId<S>) -> ListBox<S>
pub fn list_box_config<S: IntoCStr>(&self, label: LblId<S>) -> ListBox<S>
Dear ImGui (BeginListBox): begin list box
pub fn list_box<V: Copy + PartialEq, S1: IntoCStr, S2: IntoCStr>( &self, label: LblId<S1>, height_in_items: i32, values: impl IntoIterator<Item = V>, f_name: impl Fn(V) -> S2, current: &mut V, ) -> bool
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn tab_bar_config<S: IntoCStr>(&self, str_id: LblId<S>) -> TabBar<S>
pub fn tab_bar_config<S: IntoCStr>(&self, str_id: LblId<S>) -> TabBar<S>
Dear ImGui (BeginTabBar): begin tab bar
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn tab_item_config<S: IntoCStr>(&self, str_id: LblId<S>) -> TabItem<'_, S>
pub fn tab_item_config<S: IntoCStr>(&self, str_id: LblId<S>) -> TabItem<'_, S>
Dear ImGui (BeginTabItem): begin tab item
pub fn set_tab_item_closed(tab_or_docked_window_label: LblId<impl IntoCStr>)
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn get_clipboard_text(&self) -> String
pub fn set_clipboard_text(&self, text: impl IntoCStr)
pub fn set_next_window_size_constraints_callback( &self, size_min: Vector2, size_max: Vector2, cb: impl FnMut(SizeCallbackData<'_>) + 'static, )
Sourcepub fn set_next_window_size_constraints(
&self,
size_min: Vector2,
size_max: Vector2,
)
pub fn set_next_window_size_constraints( &self, size_min: Vector2, size_max: Vector2, )
Dear ImGui (SetNextWindowSizeConstraints): set next window size limits. use 0.0f or FLT_MAX if you don’t want limits.
Use -1 for both min and max of same axis to preserve current size (which itself is a constraint).
Sourcepub fn set_next_item_width(&self, item_width: f32)
pub fn set_next_item_width(&self, item_width: f32)
Dear ImGui (SetNextItemWidth): set width of the next common large “item+label” widget.
0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
Sourcepub fn set_next_item_open(&self, is_open: bool, cond: Cond)
pub fn set_next_item_open(&self, is_open: bool, cond: Cond)
Dear ImGui (SetNextItemOpen): set next TreeNode/CollapsingHeader open state.
Sourcepub fn set_next_item_storage_id(&self, id: ImGuiID)
pub fn set_next_item_storage_id(&self, id: ImGuiID)
Dear ImGui (SetNextItemStorageID): set id to use for open/close storage (default to same as item id).
Sourcepub fn tree_node_to_label_spacing(&self) -> f32
pub fn tree_node_to_label_spacing(&self) -> f32
Dear ImGui (GetTreeNodeToLabelSpacing): horizontal distance preceding label when using TreeNode*() or Bullet()
== (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode.
Sourcepub fn tree_node_get_open(&self, id: ImGuiID) -> bool
pub fn tree_node_get_open(&self, id: ImGuiID) -> bool
Dear ImGui (TreeNodeGetOpen): retrieve tree node open/close state.
Sourcepub fn set_keyboard_focus_here(&self, offset: i32)
pub fn set_keyboard_focus_here(&self, offset: i32)
Dear ImGui (SetKeyboardFocusHere): focus keyboard on the next widget.
Use positive offset to access sub components of a multiple component widget. Use -1 to access previous widget.
Sourcepub fn with_group<R>(&self, f: impl FnOnce() -> R) -> R
pub fn with_group<R>(&self, f: impl FnOnce() -> R) -> R
See BeginGroup, EndGroup.
Sourcepub fn with_disabled<R>(&self, disabled: bool, f: impl FnOnce() -> R) -> R
pub fn with_disabled<R>(&self, disabled: bool, f: impl FnOnce() -> R) -> R
See BeginDisabled, EndDisabled.
Sourcepub fn with_clip_rect<R>(
&self,
clip_rect_min: Vector2,
clip_rect_max: Vector2,
intersect_with_current_clip_rect: bool,
f: impl FnOnce() -> R,
) -> R
pub fn with_clip_rect<R>( &self, clip_rect_min: Vector2, clip_rect_max: Vector2, intersect_with_current_clip_rect: bool, f: impl FnOnce() -> R, ) -> R
See PushClipRect, PopClipRect.
See BeginMainMenuBar, EndMainMenuBar.
See BeginMenuBar, EndMenuBar.
Sourcepub fn with_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
pub fn with_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
See BeginTooltip, EndTooltip.
pub fn with_always_tooltip<R>(&self, f: impl FnOnce(bool) -> R) -> R
Sourcepub fn with_item_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
pub fn with_item_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
See BeginItemTooltip, EndTooltip. There is not EndItemTooltip.
pub fn with_always_item_tooltip<R>(&self, f: impl FnOnce(bool) -> R) -> R
Sourcepub fn with_push<R>(&self, push: impl Pushable, f: impl FnOnce() -> R) -> R
pub fn with_push<R>(&self, push: impl Pushable, f: impl FnOnce() -> R) -> R
Calls the f functions with the given push
Sourcepub fn show_demo_window(&self, show: Option<&mut bool>)
pub fn show_demo_window(&self, show: Option<&mut bool>)
Dear ImGui (ShowDemoWindow): create Demo window. demonstrate most ImGui features.
call this to learn about the library! try to make it always available in your application!
Sourcepub fn set_next_window_pos(&self, pos: Vector2, cond: Cond, pivot: Vector2)
pub fn set_next_window_pos(&self, pos: Vector2, cond: Cond, pivot: Vector2)
Dear ImGui (SetNextWindowPos): set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
Sourcepub fn set_next_window_size(&self, size: Vector2, cond: Cond)
pub fn set_next_window_size(&self, size: Vector2, cond: Cond)
Dear ImGui (SetNextWindowSize): set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
Sourcepub fn set_next_window_content_size(&self, size: Vector2)
pub fn set_next_window_content_size(&self, size: Vector2)
Dear ImGui (SetNextWindowContentSize): set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()
Sourcepub fn set_next_window_collapsed(&self, collapsed: bool, cond: Cond)
pub fn set_next_window_collapsed(&self, collapsed: bool, cond: Cond)
Dear ImGui (SetNextWindowCollapsed): set next window collapsed state. call before Begin()
Sourcepub fn set_next_window_focus(&self)
pub fn set_next_window_focus(&self)
Dear ImGui (SetNextWindowFocus): set next window to be focused / top-most. call before Begin()
Sourcepub fn set_next_window_scroll(&self, scroll: Vector2)
pub fn set_next_window_scroll(&self, scroll: Vector2)
Dear ImGui (SetNextWindowScroll): set next window scrolling value (use < 0.0f to not affect a given axis).
Sourcepub fn set_next_window_bg_alpha(&self, alpha: f32)
pub fn set_next_window_bg_alpha(&self, alpha: f32)
Dear ImGui (SetNextWindowBgAlpha): set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
Sourcepub fn window_draw_list(&self) -> WindowDrawList<'_, A>
pub fn window_draw_list(&self) -> WindowDrawList<'_, A>
Dear ImGui (GetWindowDrawList): get draw list associated to the current window, to append your own drawing primitives.
Sourcepub fn window_dpi_scale(&self) -> f32
pub fn window_dpi_scale(&self) -> f32
Dear ImGui (GetWindowDpiScale): get DPI scale currently associated to the current window’s viewport.
Sourcepub fn foreground_draw_list(&self) -> WindowDrawList<'_, A>
pub fn foreground_draw_list(&self) -> WindowDrawList<'_, A>
Dear ImGui (GetForegroundDrawList): get foreground draw list for the given viewport.
this draw list will be the top-most rendered one. Useful to quickly draw shapes/text over dear imgui contents.
Sourcepub fn background_draw_list(&self) -> WindowDrawList<'_, A>
pub fn background_draw_list(&self) -> WindowDrawList<'_, A>
Dear ImGui (GetBackgroundDrawList): get background draw list for the given viewport.
this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
Sourcepub fn text_colored(&self, color: Color, text: impl IntoCStr)
pub fn text_colored(&self, color: Color, text: impl IntoCStr)
Dear ImGui (TextColored): colored text display
Sourcepub fn text_disabled(&self, text: impl IntoCStr)
pub fn text_disabled(&self, text: impl IntoCStr)
Dear ImGui (TextDisabled): disabled text display
Sourcepub fn text_wrapped(&self, text: impl IntoCStr)
pub fn text_wrapped(&self, text: impl IntoCStr)
Dear ImGui (TextWrapped): wrapped text display
Sourcepub fn text_link(&self, label: LblId<impl IntoCStr>) -> bool
pub fn text_link(&self, label: LblId<impl IntoCStr>) -> bool
Dear ImGui (TextLink): hyperlink text button, return true when clicked
Sourcepub fn text_link_open_url(
&self,
label: LblId<impl IntoCStr>,
url: impl IntoCStr,
) -> bool
pub fn text_link_open_url( &self, label: LblId<impl IntoCStr>, url: impl IntoCStr, ) -> bool
Dear ImGui (TextLinkOpenURL): hyperlink text button, automatically open file/url when clicked
Sourcepub fn label_text(&self, label: impl IntoCStr, text: impl IntoCStr)
pub fn label_text(&self, label: impl IntoCStr, text: impl IntoCStr)
Dear ImGui (LabelText): display text+label aligned the same way as value+label widgets
Sourcepub fn bullet_text(&self, text: impl IntoCStr)
pub fn bullet_text(&self, text: impl IntoCStr)
Dear ImGui (BulletText): shortcut for Bullet()+Text()
Sourcepub fn bullet(&self)
pub fn bullet(&self)
Dear ImGui (Bullet): draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
Sourcepub fn separator_text(&self, text: impl IntoCStr)
pub fn separator_text(&self, text: impl IntoCStr)
Dear ImGui (SeparatorText): currently: formatted text with a horizontal line
Sourcepub fn set_item_default_focus(&self)
pub fn set_item_default_focus(&self)
Dear ImGui (SetItemDefaultFocus): set item default focus
Sourcepub fn is_item_hovered(&self) -> bool
pub fn is_item_hovered(&self) -> bool
Dear ImGui (IsItemHovered): is the last item hovered?
Sourcepub fn is_item_hovered_ex(&self, flags: HoveredFlags) -> bool
pub fn is_item_hovered_ex(&self, flags: HoveredFlags) -> bool
Dear ImGui (IsItemHovered): is the last item hovered?
Sourcepub fn is_item_active(&self) -> bool
pub fn is_item_active(&self) -> bool
Dear ImGui (IsItemActive): is the last item active?
Sourcepub fn is_item_focused(&self) -> bool
pub fn is_item_focused(&self) -> bool
Dear ImGui (IsItemFocused): is the last item focused?
Sourcepub fn is_item_clicked(&self, flags: MouseButton) -> bool
pub fn is_item_clicked(&self, flags: MouseButton) -> bool
Dear ImGui (IsItemClicked): is the last item hovered and mouse clicked on?
Sourcepub fn is_item_visible(&self) -> bool
pub fn is_item_visible(&self) -> bool
Dear ImGui (IsItemVisible): is the last item visible?
Sourcepub fn is_item_edited(&self) -> bool
pub fn is_item_edited(&self) -> bool
Dear ImGui (IsItemEdited): is the last item edited?
Sourcepub fn is_item_activated(&self) -> bool
pub fn is_item_activated(&self) -> bool
Dear ImGui (IsItemActivated): was the last item just activated?
Sourcepub fn is_item_deactivated(&self) -> bool
pub fn is_item_deactivated(&self) -> bool
Dear ImGui (IsItemDeactivated): was the last item just deactivated?
Sourcepub fn is_item_deactivated_after_edit(&self) -> bool
pub fn is_item_deactivated_after_edit(&self) -> bool
Dear ImGui (IsItemDeactivatedAfterEdit): was the last item just deactivated after edit?
Sourcepub fn is_item_toggled_open(&self) -> bool
pub fn is_item_toggled_open(&self) -> bool
Dear ImGui (IsItemToggledOpen): was the last item just toggled open?
Sourcepub fn is_any_item_hovered(&self) -> bool
pub fn is_any_item_hovered(&self) -> bool
Dear ImGui (IsAnyItemHovered): is any item hovered?
Sourcepub fn is_any_item_active(&self) -> bool
pub fn is_any_item_active(&self) -> bool
Dear ImGui (IsAnyItemActive): is any item active?
Sourcepub fn is_any_item_focused(&self) -> bool
pub fn is_any_item_focused(&self) -> bool
Dear ImGui (IsAnyItemFocused): is any item focused?
Sourcepub fn is_window_collapsed(&self) -> bool
pub fn is_window_collapsed(&self) -> bool
Dear ImGui (IsWindowCollapsed): is the current window collapsed?
Sourcepub fn is_window_focused(&self, flags: FocusedFlags) -> bool
pub fn is_window_focused(&self, flags: FocusedFlags) -> bool
Dear ImGui (IsWindowFocused): is current window focused?
Sourcepub fn is_window_hovered(&self, flags: FocusedFlags) -> bool
pub fn is_window_hovered(&self, flags: FocusedFlags) -> bool
Dear ImGui (IsWindowHovered): is current window hovered?
Sourcepub fn get_item_id(&self) -> ImGuiID
pub fn get_item_id(&self) -> ImGuiID
Dear ImGui (GetItemID): get ID of last item
Sourcepub fn get_id(&self, id: impl Hashable) -> ImGuiID
pub fn get_id(&self, id: impl Hashable) -> ImGuiID
Dear ImGui (GetID): get ID of given hashable
Sourcepub fn get_item_rect_min(&self) -> Vector2
pub fn get_item_rect_min(&self) -> Vector2
Dear ImGui (GetItemRectMin): get item rect min
Sourcepub fn get_item_rect_max(&self) -> Vector2
pub fn get_item_rect_max(&self) -> Vector2
Dear ImGui (GetItemRectMax): get item rect max
Sourcepub fn get_item_rect_size(&self) -> Vector2
pub fn get_item_rect_size(&self) -> Vector2
Dear ImGui (GetItemRectSize): get item rect size
Sourcepub fn get_item_flags(&self) -> ItemFlags
pub fn get_item_flags(&self) -> ItemFlags
Dear ImGui (GetItemFlags): get item flags
Sourcepub fn get_content_region_avail(&self) -> Vector2
pub fn get_content_region_avail(&self) -> Vector2
Available space from current position. This is your best friend!
Dear ImGui (GetContentRegionAvail): available space from current position. This is your best friend!
Sourcepub fn get_window_pos(&self) -> Vector2
pub fn get_window_pos(&self) -> Vector2
Dear ImGui (GetWindowPos): get current window position in screen space
Sourcepub fn get_window_width(&self) -> f32
pub fn get_window_width(&self) -> f32
Dear ImGui (GetWindowWidth): get current window width
Sourcepub fn get_window_height(&self) -> f32
pub fn get_window_height(&self) -> f32
Dear ImGui (GetWindowHeight): get current window height
Sourcepub fn get_scroll_x(&self) -> f32
pub fn get_scroll_x(&self) -> f32
Dear ImGui (GetScrollX): get scrolling amount
Sourcepub fn get_scroll_y(&self) -> f32
pub fn get_scroll_y(&self) -> f32
Dear ImGui (GetScrollY): get scrolling amount
Sourcepub fn set_scroll_x(&self, scroll_x: f32)
pub fn set_scroll_x(&self, scroll_x: f32)
Dear ImGui (SetScrollX): set scrolling amount
Sourcepub fn set_scroll_y(&self, scroll_y: f32)
pub fn set_scroll_y(&self, scroll_y: f32)
Dear ImGui (SetScrollY): set scrolling amount
Sourcepub fn get_scroll_max_x(&self) -> f32
pub fn get_scroll_max_x(&self) -> f32
Dear ImGui (GetScrollMaxX): get maximum scrolling amount
Sourcepub fn get_scroll_max_y(&self) -> f32
pub fn get_scroll_max_y(&self) -> f32
Dear ImGui (GetScrollMaxY): get maximum scrolling amount
Sourcepub fn set_scroll_here_x(&self, center_x_ratio: f32)
pub fn set_scroll_here_x(&self, center_x_ratio: f32)
Dear ImGui (SetScrollHereX): adjust scrolling amount to make current cursor position visible.
Sourcepub fn set_scroll_here_y(&self, center_y_ratio: f32)
pub fn set_scroll_here_y(&self, center_y_ratio: f32)
Dear ImGui (SetScrollHereY): adjust scrolling amount to make current cursor position visible.
Sourcepub fn set_scroll_from_pos_x(&self, local_x: f32, center_x_ratio: f32)
pub fn set_scroll_from_pos_x(&self, local_x: f32, center_x_ratio: f32)
Dear ImGui (SetScrollFromPosX): adjust scrolling amount to make given position visible.
Sourcepub fn set_scroll_from_pos_y(&self, local_y: f32, center_y_ratio: f32)
pub fn set_scroll_from_pos_y(&self, local_y: f32, center_y_ratio: f32)
Dear ImGui (SetScrollFromPosY): adjust scrolling amount to make given position visible.
Sourcepub fn set_window_pos(&self, pos: Vector2, cond: Cond)
pub fn set_window_pos(&self, pos: Vector2, cond: Cond)
Dear ImGui (SetWindowPos): (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
Sourcepub fn set_window_size(&self, size: Vector2, cond: Cond)
pub fn set_window_size(&self, size: Vector2, cond: Cond)
Dear ImGui (SetWindowSize): (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0, 0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
Sourcepub fn set_window_collapsed(&self, collapsed: bool, cond: Cond)
pub fn set_window_collapsed(&self, collapsed: bool, cond: Cond)
Dear ImGui (SetWindowCollapsed): (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
Sourcepub fn set_window_focus(&self)
pub fn set_window_focus(&self)
Dear ImGui (SetWindowFocus): (not recommended) set current window to be focused / top-most. prefer using SetNextWindowFocus().
Sourcepub fn same_line(&self)
pub fn same_line(&self)
Forces the next control to be in the same line.
Dear ImGui (SameLine): forces the next control to be in the same line.
Sourcepub fn same_line_ex(&self, same_line: SameLine)
pub fn same_line_ex(&self, same_line: SameLine)
Forces the next control to be in the same line, with custom spacing.
Dear ImGui (SameLine): forces the next control to be in the same line, with custom spacing.
Sourcepub fn dummy(&self, size: Vector2)
pub fn dummy(&self, size: Vector2)
Dear ImGui (Dummy): add a dummy item of given size. unlike InvisibleButton(), Dummy() won’t take the mouse click or be navigable into.
Sourcepub fn get_cursor_pos(&self) -> Vector2
pub fn get_cursor_pos(&self) -> Vector2
Prefer get_cursor_screen_pos over this.
Sourcepub fn get_cursor_pos_x(&self) -> f32
pub fn get_cursor_pos_x(&self) -> f32
Prefer get_cursor_screen_pos over this.
Sourcepub fn get_cursor_pos_y(&self) -> f32
pub fn get_cursor_pos_y(&self) -> f32
Prefer get_cursor_screen_pos over this.
Sourcepub fn set_cursor_pos(&self, local_pos: Vector2)
pub fn set_cursor_pos(&self, local_pos: Vector2)
Prefer set_cursor_screen_pos over this.
Sourcepub fn set_cursor_pos_x(&self, local_x: f32)
pub fn set_cursor_pos_x(&self, local_x: f32)
Prefer set_cursor_screen_pos over this.
Sourcepub fn set_cursor_pos_y(&self, local_y: f32)
pub fn set_cursor_pos_y(&self, local_y: f32)
Prefer set_cursor_screen_pos over this.
Sourcepub fn get_cursor_start_pos(&self) -> Vector2
pub fn get_cursor_start_pos(&self) -> Vector2
Prefer get_cursor_screen_pos over this.
Sourcepub fn get_cursor_screen_pos(&self) -> Vector2
pub fn get_cursor_screen_pos(&self) -> Vector2
Get cursor position in absolute coordinates. This is your best friend!
Sourcepub fn set_cursor_screen_pos(&self, pos: Vector2)
pub fn set_cursor_screen_pos(&self, pos: Vector2)
Set cursor position in absolute coordinates. This is your best friend!
Sourcepub fn align_text_to_frame_padding(&self)
pub fn align_text_to_frame_padding(&self)
Dear ImGui (AlignTextToFramePadding): vertically align upcoming text baseline to FramePadding.y
so that it will align properly to regularly framed items (call if you have text on a line before a framed item).
Sourcepub fn get_text_line_height(&self) -> f32
pub fn get_text_line_height(&self) -> f32
Dear ImGui (GetTextLineHeight): ~ FontSize.
Sourcepub fn get_text_line_height_with_spacing(&self) -> f32
pub fn get_text_line_height_with_spacing(&self) -> f32
Dear ImGui (GetTextLineHeightWithSpacing): ~ FontSize + style.ItemSpacing.y
(distance in pixels between 2 consecutive lines of text).
Sourcepub fn get_frame_height(&self) -> f32
pub fn get_frame_height(&self) -> f32
Dear ImGui (GetFrameHeight): ~ FontSize + style.FramePadding.y * 2.
Sourcepub fn get_frame_height_with_spacing(&self) -> f32
pub fn get_frame_height_with_spacing(&self) -> f32
Dear ImGui (GetFrameHeightWithSpacing): ~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y
(distance in pixels between 2 consecutive lines of framed widgets).
Sourcepub fn calc_item_width(&self) -> f32
pub fn calc_item_width(&self) -> f32
Dear ImGui (CalcItemWidth): width of item given pushed settings and current cursor position.
NOT necessarily the width of last item unlike most ‘Item’ functions.
pub fn calc_text_size(&self, text: &str) -> Vector2
pub fn calc_text_size_ex( &self, text: &str, hide_text_after_double_hash: bool, wrap_width: f32, ) -> Vector2
pub fn key_mods(&self) -> KeyMod
Sourcepub fn is_key_down(&self, key: Key) -> bool
pub fn is_key_down(&self, key: Key) -> bool
Dear ImGui (IsKeyDown): is key being held.
Sourcepub fn is_key_pressed(&self, key: Key) -> bool
pub fn is_key_pressed(&self, key: Key) -> bool
Dear ImGui (IsKeyPressed): was key pressed (went from !Down to Down)?
Repeat rate uses io.KeyRepeatDelay / KeyRepeatRate.
Sourcepub fn is_key_pressed_no_repeat(&self, key: Key) -> bool
pub fn is_key_pressed_no_repeat(&self, key: Key) -> bool
Dear ImGui (IsKeyPressed): was key pressed (went from !Down to Down)?
Same as is_key_pressed but with repeat disabled.
Sourcepub fn is_key_released(&self, key: Key) -> bool
pub fn is_key_released(&self, key: Key) -> bool
Dear ImGui (IsKeyReleased): was key released (went from Down to !Down)?
Sourcepub fn get_key_pressed_amount(
&self,
key: Key,
repeat_delay: Duration,
rate: f32,
) -> i32
pub fn get_key_pressed_amount( &self, key: Key, repeat_delay: Duration, rate: f32, ) -> i32
Dear ImGui (GetKeyPressedAmount): uses provided repeat rate/delay. return a count, most often 0 or 1
but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate.
Sourcepub fn get_font_tex_uv_white_pixel(&self) -> Vector2
pub fn get_font_tex_uv_white_pixel(&self) -> Vector2
Dear ImGui (GetFontTexUvWhitePixel): get UV coordinate for a white pixel, useful to draw
custom shapes via the ImDrawList API.
Sourcepub fn get_font_size(&self) -> f32
pub fn get_font_size(&self) -> f32
Dear ImGui (GetFontSize): get current scaled font size (= height in pixels).
AFTER global scale factors applied.
IMPORTANT DO NOT PASS THIS VALUE TO PushFont()! Use the style’s FontSizeBase to get the value before global scale factors.
Sourcepub fn is_mouse_down(&self, button: MouseButton) -> bool
pub fn is_mouse_down(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseDown): is mouse button held?
Sourcepub fn is_mouse_clicked(&self, button: MouseButton) -> bool
pub fn is_mouse_clicked(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseClicked): did mouse button clicked? (went from !Down to Down).
Same as GetMouseClickedCount() == 1.
Sourcepub fn is_mouse_clicked_repeat(&self, button: MouseButton) -> bool
pub fn is_mouse_clicked_repeat(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseClicked): did mouse button clicked? (went from !Down to Down).
Same as is_mouse_clicked but with repeat enabled.
Sourcepub fn is_mouse_released(&self, button: MouseButton) -> bool
pub fn is_mouse_released(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseReleased): did mouse button released? (went from Down to !Down).
Sourcepub fn is_mouse_double_clicked(&self, button: MouseButton) -> bool
pub fn is_mouse_double_clicked(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseDoubleClicked): did mouse button double-clicked? Same as GetMouseClickedCount() == 2.
(note that a double-click will also report IsMouseClicked() == true).
Sourcepub fn get_mouse_clicked_count(&self, button: MouseButton) -> i32
pub fn get_mouse_clicked_count(&self, button: MouseButton) -> i32
Dear ImGui (GetMouseClickedCount): return the number of successive mouse-clicks at the time
where a click happen (otherwise 0).
Sourcepub fn get_item_clicked_count_with_single_click_delay(
&self,
button: MouseButton,
delay: Duration,
) -> i32
pub fn get_item_clicked_count_with_single_click_delay( &self, button: MouseButton, delay: Duration, ) -> i32
Dear ImGui (GetItemClickedCountWithSingleClickDelay): [BETA] Building block for disambiguation between single-click and double-click.
Returns 1 on single-click but delayed by io.MouseSingleClickDelay after mouse release.
Returns 2+ on double-click or repeated clicks.
Sourcepub fn is_mouse_released_with_delay(
&self,
button: MouseButton,
delay: Duration,
) -> bool
pub fn is_mouse_released_with_delay( &self, button: MouseButton, delay: Duration, ) -> bool
Dear ImGui (IsMouseReleasedWithDelay): Delayed mouse release. Use sparingly. Prefer higher-level helper
get_item_clicked_count_with_single_click_delay().
Generally used with delay >= io.MouseDoubleClickTime combined with a
io.MouseClickedLastCount == 1 test.
Sourcepub fn is_rect_visible_size(&self, size: Vector2) -> bool
pub fn is_rect_visible_size(&self, size: Vector2) -> bool
Dear ImGui (IsRectVisible): test if rectangle (of given size, starting from cursor position)
is visible / not clipped.
Sourcepub fn is_rect_visible(&self, rect_min: Vector2, rect_max: Vector2) -> bool
pub fn is_rect_visible(&self, rect_min: Vector2, rect_max: Vector2) -> bool
Dear ImGui (IsRectVisible): test if rectangle (in screen space) is visible / not clipped.
to perform coarse clipping on user’s side.
Sourcepub fn is_any_mouse_down(&self) -> bool
pub fn is_any_mouse_down(&self) -> bool
Dear ImGui (IsAnyMouseDown): is any mouse button held?
[WILL OBSOLETE] This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.
Sourcepub fn get_mouse_pos(&self) -> Vector2
pub fn get_mouse_pos(&self) -> Vector2
Dear ImGui (GetMousePos): shortcut to ImGui::GetIO().MousePos provided by user,
to be consistent with other calls.
Sourcepub fn get_mouse_pos_on_opening_current_popup(&self) -> Vector2
pub fn get_mouse_pos_on_opening_current_popup(&self) -> Vector2
Dear ImGui (GetMousePosOnOpeningCurrentPopup): retrieve mouse position at the time of opening
popup we have BeginPopup() into (helper to avoid user backing that value themselves).
Sourcepub fn is_mouse_dragging(&self, button: MouseButton) -> bool
pub fn is_mouse_dragging(&self, button: MouseButton) -> bool
Dear ImGui (IsMouseDragging): is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f).
Sourcepub fn get_mouse_drag_delta(&self, button: MouseButton) -> Vector2
pub fn get_mouse_drag_delta(&self, button: MouseButton) -> Vector2
Dear ImGui (GetMouseDragDelta): return the delta from the initial clicking position while
the mouse button is pressed or was just released. This is locked and return 0.0f until the
mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0f).
Sourcepub fn reset_mouse_drag_delta(&self, button: MouseButton)
pub fn reset_mouse_drag_delta(&self, button: MouseButton)
Dear ImGui (ResetMouseDragDelta): reset mouse drag delta.
Sourcepub fn get_mouse_cursor(&self) -> MouseCursor
pub fn get_mouse_cursor(&self) -> MouseCursor
Dear ImGui (GetMouseCursor): get desired mouse cursor shape. Important: reset in ImGui::NewFrame(),
this is updated during the frame. valid before Render(). If you use software rendering by setting
io.MouseDrawCursor ImGui will render those for you.
Sourcepub fn set_mouse_cursor(&self, cursor_type: MouseCursor)
pub fn set_mouse_cursor(&self, cursor_type: MouseCursor)
Dear ImGui (SetMouseCursor): set desired mouse cursor shape.
Sourcepub fn get_time(&self) -> f64
pub fn get_time(&self) -> f64
Dear ImGui (GetTime): get global imgui time. incremented by io.DeltaTime every frame.
Sourcepub fn get_frame_count(&self) -> i32
pub fn get_frame_count(&self) -> i32
Dear ImGui (GetFrameCount): get global imgui frame count. incremented by 1 every frame.
Sourcepub fn is_popup_open(&self, str_id: Option<Id<impl IntoCStr>>) -> bool
pub fn is_popup_open(&self, str_id: Option<Id<impl IntoCStr>>) -> bool
Dear ImGui (IsPopupOpen): return true if the popup is open.
Sourcepub fn is_popup_open_ex(
&self,
str_id: Option<Id<impl IntoCStr>>,
flags: PopupFlags,
) -> bool
pub fn is_popup_open_ex( &self, str_id: Option<Id<impl IntoCStr>>, flags: PopupFlags, ) -> bool
Dear ImGui (IsPopupOpen): return true if the popup is open.
Sourcepub fn is_below_blocking_modal(&self) -> bool
pub fn is_below_blocking_modal(&self) -> bool
Returns true if the current window is below a modal pop-up.
Sourcepub fn is_blocking_modal(&self) -> bool
pub fn is_blocking_modal(&self) -> bool
Return true if there is any modal window opened
Sourcepub fn open_popup(&self, str_id: Id<impl IntoCStr>) -> bool
pub fn open_popup(&self, str_id: Id<impl IntoCStr>) -> bool
Dear ImGui (OpenPopup): Call to mark popup as open (don’t call every frame!).
Returns true when the popup was just opened.
Sourcepub fn open_popup_ex(
&self,
str_id: Id<impl IntoCStr>,
flags: PopupFlags,
) -> bool
pub fn open_popup_ex( &self, str_id: Id<impl IntoCStr>, flags: PopupFlags, ) -> bool
Dear ImGui (OpenPopup): Call to mark popup as open (don’t call every frame!).
Returns true when the popup was just opened.
Sourcepub fn close_current_popup(&self)
pub fn close_current_popup(&self)
Dear ImGui (CloseCurrentPopup): manually close the popup we have begin-ed into.
Sourcepub fn open_popup_on_item_click(
&self,
str_id: Option<Id<impl IntoCStr>>,
flags: PopupFlags,
) -> bool
pub fn open_popup_on_item_click( &self, str_id: Option<Id<impl IntoCStr>>, flags: PopupFlags, ) -> bool
Dear ImGui (OpenPopupOnItemClick): Helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1.
Note: actually triggers on the mouse released event to be consistent with popup behaviors.
Returns true when the popup was just opened.
pub fn is_window_appearing(&self) -> bool
Sourcepub fn with_always_drag_drop_source<R>(
&self,
flags: DragDropSourceFlags,
f: impl FnOnce(Option<DragDropPayloadSetter<'_>>) -> R,
) -> R
pub fn with_always_drag_drop_source<R>( &self, flags: DragDropSourceFlags, f: impl FnOnce(Option<DragDropPayloadSetter<'_>>) -> R, ) -> R
Dear ImGui (BeginDragDropSource): call after submitting an item which may be dragged.
when this returns true, you can call SetDragDropPayload() + EndDragDropSource().
Sourcepub fn with_drag_drop_source<R>(
&self,
flags: DragDropSourceFlags,
f: impl FnOnce(DragDropPayloadSetter<'_>) -> R,
) -> Option<R>
pub fn with_drag_drop_source<R>( &self, flags: DragDropSourceFlags, f: impl FnOnce(DragDropPayloadSetter<'_>) -> R, ) -> Option<R>
Dear ImGui (BeginDragDropSource): call after submitting an item which may be dragged.
when this returns true, you can call SetDragDropPayload() + EndDragDropSource().
Sourcepub fn with_always_drag_drop_target<R>(
&self,
f: impl FnOnce(Option<DragDropPayloadGetter<'_>>) -> R,
) -> R
pub fn with_always_drag_drop_target<R>( &self, f: impl FnOnce(Option<DragDropPayloadGetter<'_>>) -> R, ) -> R
Dear ImGui (BeginDragDropTarget): call after submitting an item that may receive a payload.
If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget().
Sourcepub fn with_drag_drop_target<R>(
&self,
f: impl FnOnce(DragDropPayloadGetter<'_>) -> R,
) -> Option<R>
pub fn with_drag_drop_target<R>( &self, f: impl FnOnce(DragDropPayloadGetter<'_>) -> R, ) -> Option<R>
Dear ImGui (BeginDragDropTarget): call after submitting an item that may receive a payload.
If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget().
pub fn list_clipper(&self, items_count: usize) -> ListClipper
pub fn shortcut(&self, key_chord: impl Into<KeyChord>) -> bool
pub fn shortcut_ex( &self, key_chord: impl Into<KeyChord>, flags: InputFlags, ) -> bool
pub fn set_next_item_shortcut(&self, key_chord: impl Into<KeyChord>)
pub fn set_next_item_shortcut_ex( &self, key_chord: impl Into<KeyChord>, flags: InputFlags, )
Sourcepub fn is_keychord_pressed(&self, key_chord: impl Into<KeyChord>) -> bool
pub fn is_keychord_pressed(&self, key_chord: impl Into<KeyChord>) -> bool
Dear ImGui (IsKeyChordPressed): was key chord (mods + key) pressed, e.g. you can pass
‘ImGuiMod_Ctrl | ImGuiKey_S’ as a key-chord. This doesn’t do any routing or focus check,
please consider using Shortcut() function instead.
Sourcepub fn get_font_baked(
&self,
font_id: FontId,
font_size: f32,
font_density: Option<f32>,
) -> &FontBaked
pub fn get_font_baked( &self, font_id: FontId, font_size: f32, font_density: Option<f32>, ) -> &FontBaked
Gets more information about a font.
This is a member of Ui instead of FontAtlas because it requires the atlas to be fully
built and that is only ensured during the frame, that is when there is a &Ui.
pub fn get_atlas_texture_ref(&self) -> TextureRef<'_>
pub fn get_custom_rect(&self, index: CustomRectIndex) -> Option<TextureRect<'_>>
pub fn dock_space( &self, id: ImGuiID, size: Vector2, flags: DockNodeFlags, window_class: Option<&WindowClass>, ) -> ImGuiID
pub fn dock_space_over_viewport( &self, dockspace_id: ImGuiID, viewport: &Viewport, flags: DockNodeFlags, window_class: Option<&WindowClass>, ) -> ImGuiID
Sourcepub fn set_next_window_dock_id(&self, dock_id: ImGuiID, cond: Cond)
pub fn set_next_window_dock_id(&self, dock_id: ImGuiID, cond: Cond)
Dear ImGui (SetNextWindowDockID): set next window dock id.
Sourcepub fn set_next_window_class(&self, window_class: &WindowClass)
pub fn set_next_window_class(&self, window_class: &WindowClass)
Dear ImGui (SetNextWindowClass): set next window class (control docking compatibility +
provide hints to platform backend via custom viewport flags and platform parent/child relationship).
Sourcepub fn get_window_dock_id(&self) -> ImGuiID
pub fn get_window_dock_id(&self) -> ImGuiID
Dear ImGui (GetWindowDockID): get dock id of current window, or 0 if not associated to any docking node.
Sourcepub fn is_window_docked(&self) -> bool
pub fn is_window_docked(&self) -> bool
Dear ImGui (IsWindowDocked): is current window docked into another window?
Sourcepub fn dock_builder(
&self,
id: Option<ImGuiID>,
flags: DockNodeFlags,
fn_build: impl FnOnce(ImGuiID, &mut DockBuilder),
)
pub fn dock_builder( &self, id: Option<ImGuiID>, flags: DockNodeFlags, fn_build: impl FnOnce(ImGuiID, &mut DockBuilder), )
This allows to build your own docking, and dock your windows.
WARNING: Experimental DearImGui feature and experimental binding.
You must follow these rules:
- Call this function when you want to dock your windows, usually in the very first frame. or in the “reset views” menu option. Do NOT call it on every frame!
- Call after creating the dockings but before creating the windows.
Sourcepub fn get_window_viewport(&self) -> &Viewport
pub fn get_window_viewport(&self) -> &Viewport
Dear ImGui (GetWindowViewport): get viewport currently associated to the current window.
Sourcepub fn set_next_window_viewport(&self, id: ImGuiID)
pub fn set_next_window_viewport(&self, id: ImGuiID)
Dear ImGui (SetNextWindowViewport): set next window viewport.
Sourcepub fn viewport_foreground_draw_list(
&self,
viewport: &Viewport,
) -> WindowDrawList<'_, A>
pub fn viewport_foreground_draw_list( &self, viewport: &Viewport, ) -> WindowDrawList<'_, A>
Dear ImGui (GetForegroundDrawList): get foreground draw list for the given viewport.
this draw list will be the top-most rendered one. Useful to quickly draw shapes/text over dear imgui contents.
Sourcepub fn viewport_background_draw_list(
&self,
viewport: &Viewport,
) -> WindowDrawList<'_, A>
pub fn viewport_background_draw_list( &self, viewport: &Viewport, ) -> WindowDrawList<'_, A>
Dear ImGui (GetBackgroundDrawList): get background draw list for the given viewport.
this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn table_config<S: IntoCStr>( &self, str_id: LblId<S>, column: i32, ) -> TableConfig<S>
Sourcepub fn table_next_row(&self, flags: TableRowFlags, min_row_height: f32)
pub fn table_next_row(&self, flags: TableRowFlags, min_row_height: f32)
Dear ImGui (TableNextRow): append into the first cell of a new row.
min_row_height includes the minimum top and bottom padding aka CellPadding.y * 2.0f.
Sourcepub fn table_next_column(&self) -> bool
pub fn table_next_column(&self) -> bool
Dear ImGui (TableNextColumn): append into the next column (or first column of next row
if currently in last column). Return true when column is visible.
Sourcepub fn table_set_column_index(&self, column_n: i32) -> bool
pub fn table_set_column_index(&self, column_n: i32) -> bool
Dear ImGui (TableSetColumnIndex): append into the specified column.
Return true when column is visible.
pub fn table_setup_column( &self, label: impl IntoCStr, flags: TableColumnFlags, init_width_or_weight: f32, user_id: ImGuiID, )
Sourcepub fn table_setup_scroll_freeze(&self, cols: i32, rows: i32)
pub fn table_setup_scroll_freeze(&self, cols: i32, rows: i32)
Dear ImGui (TableSetupScrollFreeze): lock columns/rows so they stay visible when scrolled.
Sourcepub fn table_headers_row(&self)
pub fn table_headers_row(&self)
Dear ImGui (TableHeadersRow): submit a row with headers cells based on data provided
to TableSetupColumn() + submit context menu.
Sourcepub fn table_angle_headers_row(&self)
pub fn table_angle_headers_row(&self)
Dear ImGui (TableAngledHeadersRow): submit a row with angled headers for every column
with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW.
Sourcepub fn table_get_columns_count(&self) -> i32
pub fn table_get_columns_count(&self) -> i32
Dear ImGui (TableGetColumnCount): return number of columns (value passed to BeginTable).
Sourcepub fn table_get_column_index(&self) -> i32
pub fn table_get_column_index(&self) -> i32
Dear ImGui (TableGetColumnIndex): return current column index.
Sourcepub fn table_get_hovered_column(&self) -> Option<i32>
pub fn table_get_hovered_column(&self) -> Option<i32>
Can return one-pass the last column if hovering the empty space
Sourcepub fn table_get_row_index(&self) -> i32
pub fn table_get_row_index(&self) -> i32
Dear ImGui (TableGetRowIndex): return current row index (header rows are accounted for).
pub fn table_get_column_flags(&self, column_n: Option<i32>) -> TableColumnFlags
Sourcepub fn table_get_column_name(&self, column_n: Option<i32>) -> String
pub fn table_get_column_name(&self, column_n: Option<i32>) -> String
Dear ImGui (TableGetColumnName): return “” if column didn’t have a name declared by
TableSetupColumn(). Pass None to use current column.
Sourcepub fn table_set_column_enabled(&self, column_n: Option<i32>, enabled: bool)
pub fn table_set_column_enabled(&self, column_n: Option<i32>, enabled: bool)
Dear ImGui (TableSetColumnEnabled): change user accessible enabled/disabled state of a column.
Set to false to hide the column. User can use the context menu to change this themselves
(right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody).
Sourcepub fn table_set_bg_color(
&self,
target: TableBgTarget,
color: Color,
column_n: Option<i32>,
)
pub fn table_set_bg_color( &self, target: TableBgTarget, color: Color, column_n: Option<i32>, )
Dear ImGui (TableSetBgColor): change the color of a cell, row, or column.
See ImGuiTableBgTarget_ flags for details.
Sourcepub fn table_with_sort_specs(
&self,
sort_fn: impl FnOnce(&[TableColumnSortSpec]),
)
pub fn table_with_sort_specs( &self, sort_fn: impl FnOnce(&[TableColumnSortSpec]), )
Dear ImGui (TableGetSortSpecs): get latest sort specs for the table (NULL if not sorting).
Lifetime: don’t hold on this pointer over multiple frames or past any subsequent call to BeginTable().
Sourcepub fn table_with_sort_specs_always(
&self,
sort_fn: impl FnOnce(bool, &[TableColumnSortSpec]) -> bool,
)
pub fn table_with_sort_specs_always( &self, sort_fn: impl FnOnce(bool, &[TableColumnSortSpec]) -> bool, )
The sort_fn takes the old dirty and returns the new dirty.
Methods from Deref<Target = RawContext>§
Sourcepub fn get(&self) -> &ImGuiContext
pub fn get(&self) -> &ImGuiContext
Gets a reference to the native wrapper struct.
Sourcepub fn platform_io(&self) -> &PlatformIo
pub fn platform_io(&self) -> &PlatformIo
Returns a safe wrapper for the PlatformIo.
Sourcepub fn get_main_viewport(&self) -> &Viewport
pub fn get_main_viewport(&self) -> &Viewport
Gets a reference to the main viewport
Trait Implementations§
Auto Trait Implementations§
impl<A> !Freeze for Ui<A>
impl<A> !RefUnwindSafe for Ui<A>
impl<A> !Send for Ui<A>
impl<A> !Sync for Ui<A>
impl<A> !UnwindSafe for Ui<A>
impl<A> Unpin for Ui<A>where
A: ?Sized,
impl<A> UnsafeUnpin for Ui<A>where
A: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more