Struct PopupMenu
#[repr(C)]pub struct PopupMenu { /* private fields */ }
Expand description
Godot class PopupMenu.
Inherits Popup
.
Related symbols:
popup_menu
: sidecar module with related enum/flag typesIPopupMenu
: virtual methodsSignalsOfPopupMenu
: signal collection
See also Godot docs for PopupMenu
.
§Construction
This class is manually managed. You can create a new instance using PopupMenu::new_alloc()
.
Do not forget to call free()
or hand over ownership to Godot.
Implementations§
§impl PopupMenu
impl PopupMenu
pub fn activate_item_by_event(
&mut self,
event: impl AsArg<Option<Gd<InputEvent>>>,
) -> bool
pub fn activate_item_by_event( &mut self, event: impl AsArg<Option<Gd<InputEvent>>>, ) -> bool
To set the default parameters, use Self::activate_item_by_event_ex
and its builder methods. See the book for detailed usage instructions.
pub fn activate_item_by_event_ex<'a>( &'a mut self, event: impl AsArg<Option<Gd<InputEvent>>> + 'a, ) -> ExActivateItemByEvent<'a>
pub fn add_item(&mut self, label: impl AsArg<GString>)
pub fn add_item(&mut self, label: impl AsArg<GString>)
To set the default parameters, use Self::add_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_item_ex<'a>( &'a mut self, label: impl AsArg<GString> + 'a, ) -> ExAddItem<'a>
pub fn add_icon_item(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
label: impl AsArg<GString>,
)
pub fn add_icon_item( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, label: impl AsArg<GString>, )
To set the default parameters, use Self::add_icon_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_item_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, label: impl AsArg<GString> + 'a, ) -> ExAddIconItem<'a>
pub fn add_check_item(&mut self, label: impl AsArg<GString>)
pub fn add_check_item(&mut self, label: impl AsArg<GString>)
To set the default parameters, use Self::add_check_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_check_item_ex<'a>( &'a mut self, label: impl AsArg<GString> + 'a, ) -> ExAddCheckItem<'a>
pub fn add_icon_check_item(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
label: impl AsArg<GString>,
)
pub fn add_icon_check_item( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, label: impl AsArg<GString>, )
To set the default parameters, use Self::add_icon_check_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_check_item_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, label: impl AsArg<GString> + 'a, ) -> ExAddIconCheckItem<'a>
pub fn add_radio_check_item(&mut self, label: impl AsArg<GString>)
pub fn add_radio_check_item(&mut self, label: impl AsArg<GString>)
To set the default parameters, use Self::add_radio_check_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_radio_check_item_ex<'a>( &'a mut self, label: impl AsArg<GString> + 'a, ) -> ExAddRadioCheckItem<'a>
pub fn add_icon_radio_check_item(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
label: impl AsArg<GString>,
)
pub fn add_icon_radio_check_item( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, label: impl AsArg<GString>, )
To set the default parameters, use Self::add_icon_radio_check_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_radio_check_item_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, label: impl AsArg<GString> + 'a, ) -> ExAddIconRadioCheckItem<'a>
pub fn add_multistate_item(
&mut self,
label: impl AsArg<GString>,
max_states: i32,
)
pub fn add_multistate_item( &mut self, label: impl AsArg<GString>, max_states: i32, )
To set the default parameters, use Self::add_multistate_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_multistate_item_ex<'a>( &'a mut self, label: impl AsArg<GString> + 'a, max_states: i32, ) -> ExAddMultistateItem<'a>
pub fn add_shortcut(&mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>>)
pub fn add_shortcut(&mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>>)
To set the default parameters, use Self::add_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_shortcut_ex<'a>( &'a mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddShortcut<'a>
pub fn add_icon_shortcut(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
shortcut: impl AsArg<Option<Gd<Shortcut>>>,
)
pub fn add_icon_shortcut( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, shortcut: impl AsArg<Option<Gd<Shortcut>>>, )
To set the default parameters, use Self::add_icon_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_shortcut_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddIconShortcut<'a>
pub fn add_check_shortcut(&mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>>)
pub fn add_check_shortcut(&mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>>)
To set the default parameters, use Self::add_check_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_check_shortcut_ex<'a>( &'a mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddCheckShortcut<'a>
pub fn add_icon_check_shortcut(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
shortcut: impl AsArg<Option<Gd<Shortcut>>>,
)
pub fn add_icon_check_shortcut( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, shortcut: impl AsArg<Option<Gd<Shortcut>>>, )
To set the default parameters, use Self::add_icon_check_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_check_shortcut_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddIconCheckShortcut<'a>
pub fn add_radio_check_shortcut(
&mut self,
shortcut: impl AsArg<Option<Gd<Shortcut>>>,
)
pub fn add_radio_check_shortcut( &mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>>, )
To set the default parameters, use Self::add_radio_check_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_radio_check_shortcut_ex<'a>( &'a mut self, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddRadioCheckShortcut<'a>
pub fn add_icon_radio_check_shortcut(
&mut self,
texture: impl AsArg<Option<Gd<Texture2D>>>,
shortcut: impl AsArg<Option<Gd<Shortcut>>>,
)
pub fn add_icon_radio_check_shortcut( &mut self, texture: impl AsArg<Option<Gd<Texture2D>>>, shortcut: impl AsArg<Option<Gd<Shortcut>>>, )
To set the default parameters, use Self::add_icon_radio_check_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_icon_radio_check_shortcut_ex<'a>( &'a mut self, texture: impl AsArg<Option<Gd<Texture2D>>> + 'a, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExAddIconRadioCheckShortcut<'a>
To set the default parameters, use Self::add_submenu_item_ex
and its builder methods. See the book for detailed usage instructions.
To set the default parameters, use Self::add_submenu_node_item_ex
and its builder methods. See the book for detailed usage instructions.
pub fn set_item_text(&mut self, index: i32, text: impl AsArg<GString>)
pub fn set_item_text_direction(&mut self, index: i32, direction: TextDirection)
pub fn set_item_language(&mut self, index: i32, language: impl AsArg<GString>)
pub fn set_item_icon( &mut self, index: i32, icon: impl AsArg<Option<Gd<Texture2D>>>, )
pub fn set_item_icon_max_width(&mut self, index: i32, width: i32)
pub fn set_item_icon_modulate(&mut self, index: i32, modulate: Color)
pub fn set_item_checked(&mut self, index: i32, checked: bool)
pub fn set_item_id(&mut self, index: i32, id: i32)
pub fn set_item_accelerator(&mut self, index: i32, accel: Key)
pub fn set_item_metadata(&mut self, index: i32, metadata: &Variant)
pub fn set_item_disabled(&mut self, index: i32, disabled: bool)
pub fn set_item_as_separator(&mut self, index: i32, enable: bool)
pub fn set_item_as_checkable(&mut self, index: i32, enable: bool)
pub fn set_item_as_radio_checkable(&mut self, index: i32, enable: bool)
pub fn set_item_tooltip(&mut self, index: i32, tooltip: impl AsArg<GString>)
pub fn set_item_shortcut(
&mut self,
index: i32,
shortcut: impl AsArg<Option<Gd<Shortcut>>>,
)
pub fn set_item_shortcut( &mut self, index: i32, shortcut: impl AsArg<Option<Gd<Shortcut>>>, )
To set the default parameters, use Self::set_item_shortcut_ex
and its builder methods. See the book for detailed usage instructions.
pub fn set_item_shortcut_ex<'a>( &'a mut self, index: i32, shortcut: impl AsArg<Option<Gd<Shortcut>>> + 'a, ) -> ExSetItemShortcut<'a>
pub fn set_item_indent(&mut self, index: i32, indent: i32)
pub fn set_item_multistate(&mut self, index: i32, state: i32)
pub fn set_item_multistate_max(&mut self, index: i32, max_states: i32)
pub fn set_item_shortcut_disabled(&mut self, index: i32, disabled: bool)
pub fn toggle_item_checked(&mut self, index: i32)
pub fn toggle_item_multistate(&mut self, index: i32)
pub fn get_item_text(&self, index: i32) -> GString
pub fn get_item_text_direction(&self, index: i32) -> TextDirection
pub fn get_item_language(&self, index: i32) -> GString
pub fn get_item_icon(&self, index: i32) -> Option<Gd<Texture2D>>
pub fn get_item_icon_max_width(&self, index: i32) -> i32
pub fn get_item_icon_modulate(&self, index: i32) -> Color
pub fn is_item_checked(&self, index: i32) -> bool
pub fn get_item_id(&self, index: i32) -> i32
pub fn get_item_index(&self, id: i32) -> i32
pub fn get_item_accelerator(&self, index: i32) -> Key
pub fn get_item_metadata(&self, index: i32) -> Variant
pub fn is_item_disabled(&self, index: i32) -> bool
pub fn is_item_separator(&self, index: i32) -> bool
pub fn is_item_checkable(&self, index: i32) -> bool
pub fn is_item_radio_checkable(&self, index: i32) -> bool
pub fn is_item_shortcut_disabled(&self, index: i32) -> bool
pub fn get_item_tooltip(&self, index: i32) -> GString
pub fn get_item_shortcut(&self, index: i32) -> Option<Gd<Shortcut>>
pub fn get_item_indent(&self, index: i32) -> i32
pub fn get_item_multistate_max(&self, index: i32) -> i32
pub fn get_item_multistate(&self, index: i32) -> i32
pub fn set_focused_item(&mut self, index: i32)
pub fn get_focused_item(&self) -> i32
pub fn set_item_count(&mut self, count: i32)
pub fn get_item_count(&self) -> i32
pub fn scroll_to_item(&mut self, index: i32)
pub fn remove_item(&mut self, index: i32)
pub fn add_separator(&mut self)
pub fn add_separator(&mut self)
To set the default parameters, use Self::add_separator_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_separator_ex<'a>(&'a mut self) -> ExAddSeparator<'a>
pub fn clear(&mut self)
pub fn clear(&mut self)
To set the default parameters, use Self::clear_ex
and its builder methods. See the book for detailed usage instructions.
pub fn clear_ex<'a>(&'a mut self) -> ExClear<'a>
pub fn set_hide_on_item_selection(&mut self, enable: bool)
pub fn is_hide_on_item_selection(&self) -> bool
pub fn set_hide_on_checkable_item_selection(&mut self, enable: bool)
pub fn is_hide_on_checkable_item_selection(&self) -> bool
pub fn set_hide_on_state_item_selection(&mut self, enable: bool)
pub fn is_hide_on_state_item_selection(&self) -> bool
pub fn set_allow_search(&mut self, allow: bool)
pub fn get_allow_search(&self) -> bool
Methods from Deref<Target = Window>§
pub fn set_title(&mut self, title: impl AsArg<GString>)
pub fn get_title(&self) -> GString
pub fn get_window_id(&self) -> i32
pub fn set_initial_position(&mut self, initial_position: WindowInitialPosition)
pub fn get_initial_position(&self) -> WindowInitialPosition
pub fn set_current_screen(&mut self, index: i32)
pub fn get_current_screen(&self) -> i32
pub fn set_position(&mut self, position: Vector2i)
pub fn get_position(&self) -> Vector2i
pub fn move_to_center(&mut self)
pub fn set_size(&mut self, size: Vector2i)
pub fn get_size(&self) -> Vector2i
pub fn reset_size(&mut self)
pub fn get_position_with_decorations(&self) -> Vector2i
pub fn get_size_with_decorations(&self) -> Vector2i
pub fn set_max_size(&mut self, max_size: Vector2i)
pub fn get_max_size(&self) -> Vector2i
pub fn set_min_size(&mut self, min_size: Vector2i)
pub fn get_min_size(&self) -> Vector2i
pub fn set_mode(&mut self, mode: Mode)
pub fn get_mode(&self) -> Mode
pub fn set_flag(&mut self, flag: Flags, enabled: bool)
pub fn get_flag(&self, flag: Flags) -> bool
pub fn is_maximize_allowed(&self) -> bool
pub fn request_attention(&mut self)
pub fn move_to_foreground(&mut self)
pub fn set_visible(&mut self, visible: bool)
pub fn is_visible(&self) -> bool
pub fn hide(&mut self)
pub fn show(&mut self)
pub fn set_transient(&mut self, transient: bool)
pub fn is_transient(&self) -> bool
pub fn set_transient_to_focused(&mut self, enable: bool)
pub fn is_transient_to_focused(&self) -> bool
pub fn set_exclusive(&mut self, exclusive: bool)
pub fn is_exclusive(&self) -> bool
pub fn set_unparent_when_invisible(&mut self, unparent: bool)
pub fn can_draw(&self) -> bool
pub fn has_focus(&self) -> bool
pub fn grab_focus(&mut self)
pub fn start_drag(&mut self)
pub fn start_resize(&mut self, edge: WindowResizeEdge)
pub fn set_ime_active(&mut self, active: bool)
pub fn set_ime_position(&mut self, position: Vector2i)
pub fn is_embedded(&self) -> bool
pub fn get_contents_minimum_size(&self) -> Vector2
pub fn set_force_native(&mut self, force_native: bool)
pub fn get_force_native(&self) -> bool
pub fn set_content_scale_size(&mut self, size: Vector2i)
pub fn get_content_scale_size(&self) -> Vector2i
pub fn set_content_scale_mode(&mut self, mode: ContentScaleMode)
pub fn get_content_scale_mode(&self) -> ContentScaleMode
pub fn set_content_scale_aspect(&mut self, aspect: ContentScaleAspect)
pub fn get_content_scale_aspect(&self) -> ContentScaleAspect
pub fn set_content_scale_stretch(&mut self, stretch: ContentScaleStretch)
pub fn get_content_scale_stretch(&self) -> ContentScaleStretch
pub fn set_keep_title_visible(&mut self, title_visible: bool)
pub fn get_keep_title_visible(&self) -> bool
pub fn set_content_scale_factor(&mut self, factor: f32)
pub fn get_content_scale_factor(&self) -> f32
pub fn set_use_font_oversampling(&mut self, enable: bool)
pub fn is_using_font_oversampling(&self) -> bool
pub fn set_mouse_passthrough_polygon(&mut self, polygon: &PackedArray<Vector2>)
pub fn get_mouse_passthrough_polygon(&self) -> PackedArray<Vector2>
pub fn set_wrap_controls(&mut self, enable: bool)
pub fn is_wrapping_controls(&self) -> bool
pub fn child_controls_changed(&mut self)
pub fn set_theme(&mut self, theme: impl AsArg<Option<Gd<Theme>>>)
pub fn get_theme(&self) -> Option<Gd<Theme>>
pub fn set_theme_type_variation(&mut self, theme_type: impl AsArg<StringName>)
pub fn get_theme_type_variation(&self) -> StringName
pub fn begin_bulk_theme_override(&mut self)
pub fn end_bulk_theme_override(&mut self)
pub fn add_theme_icon_override( &mut self, name: impl AsArg<StringName>, texture: impl AsArg<Option<Gd<Texture2D>>>, )
pub fn add_theme_stylebox_override( &mut self, name: impl AsArg<StringName>, stylebox: impl AsArg<Option<Gd<StyleBox>>>, )
pub fn add_theme_font_override( &mut self, name: impl AsArg<StringName>, font: impl AsArg<Option<Gd<Font>>>, )
pub fn add_theme_font_size_override( &mut self, name: impl AsArg<StringName>, font_size: i32, )
pub fn add_theme_color_override( &mut self, name: impl AsArg<StringName>, color: Color, )
pub fn add_theme_constant_override( &mut self, name: impl AsArg<StringName>, constant: i32, )
pub fn remove_theme_icon_override(&mut self, name: impl AsArg<StringName>)
pub fn remove_theme_stylebox_override(&mut self, name: impl AsArg<StringName>)
pub fn remove_theme_font_override(&mut self, name: impl AsArg<StringName>)
pub fn remove_theme_font_size_override(&mut self, name: impl AsArg<StringName>)
pub fn remove_theme_color_override(&mut self, name: impl AsArg<StringName>)
pub fn remove_theme_constant_override(&mut self, name: impl AsArg<StringName>)
pub fn get_theme_icon(
&self,
name: impl AsArg<StringName>,
) -> Option<Gd<Texture2D>>
pub fn get_theme_icon( &self, name: impl AsArg<StringName>, ) -> Option<Gd<Texture2D>>
To set the default parameters, use Self::get_theme_icon_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_icon_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeIcon<'a>
pub fn get_theme_stylebox(
&self,
name: impl AsArg<StringName>,
) -> Option<Gd<StyleBox>>
pub fn get_theme_stylebox( &self, name: impl AsArg<StringName>, ) -> Option<Gd<StyleBox>>
To set the default parameters, use Self::get_theme_stylebox_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_stylebox_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeStylebox<'a>
pub fn get_theme_font(&self, name: impl AsArg<StringName>) -> Option<Gd<Font>>
pub fn get_theme_font(&self, name: impl AsArg<StringName>) -> Option<Gd<Font>>
To set the default parameters, use Self::get_theme_font_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_font_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeFont<'a>
pub fn get_theme_font_size(&self, name: impl AsArg<StringName>) -> i32
pub fn get_theme_font_size(&self, name: impl AsArg<StringName>) -> i32
To set the default parameters, use Self::get_theme_font_size_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_font_size_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeFontSize<'a>
pub fn get_theme_color(&self, name: impl AsArg<StringName>) -> Color
pub fn get_theme_color(&self, name: impl AsArg<StringName>) -> Color
To set the default parameters, use Self::get_theme_color_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_color_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeColor<'a>
pub fn get_theme_constant(&self, name: impl AsArg<StringName>) -> i32
pub fn get_theme_constant(&self, name: impl AsArg<StringName>) -> i32
To set the default parameters, use Self::get_theme_constant_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_theme_constant_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetThemeConstant<'a>
pub fn has_theme_icon_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_stylebox_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_font_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_font_size_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_color_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_constant_override(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_icon(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_icon(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_icon_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_icon_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeIcon<'a>
pub fn has_theme_stylebox(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_stylebox(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_stylebox_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_stylebox_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeStylebox<'a>
pub fn has_theme_font(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_font(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_font_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_font_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeFont<'a>
pub fn has_theme_font_size(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_font_size(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_font_size_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_font_size_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeFontSize<'a>
pub fn has_theme_color(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_color(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_color_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_color_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeColor<'a>
pub fn has_theme_constant(&self, name: impl AsArg<StringName>) -> bool
pub fn has_theme_constant(&self, name: impl AsArg<StringName>) -> bool
To set the default parameters, use Self::has_theme_constant_ex
and its builder methods. See the book for detailed usage instructions.
pub fn has_theme_constant_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExHasThemeConstant<'a>
pub fn get_theme_default_base_scale(&self) -> f32
pub fn get_theme_default_font(&self) -> Option<Gd<Font>>
pub fn get_theme_default_font_size(&self) -> i32
pub fn set_layout_direction(&mut self, direction: LayoutDirection)
pub fn get_layout_direction(&self) -> LayoutDirection
pub fn is_layout_rtl(&self) -> bool
pub fn set_auto_translate(&mut self, enable: bool)
pub fn is_auto_translating(&self) -> bool
pub fn popup(&mut self)
pub fn popup(&mut self)
To set the default parameters, use Self::popup_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_ex<'a>(&'a mut self) -> ExPopup<'a>
pub fn popup_on_parent(&mut self, parent_rect: Rect2i)
pub fn popup_centered(&mut self)
pub fn popup_centered(&mut self)
To set the default parameters, use Self::popup_centered_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_centered_ex<'a>(&'a mut self) -> ExPopupCentered<'a>
pub fn popup_centered_ratio(&mut self)
pub fn popup_centered_ratio(&mut self)
To set the default parameters, use Self::popup_centered_ratio_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_centered_ratio_ex<'a>(&'a mut self) -> ExPopupCenteredRatio<'a>
pub fn popup_centered_clamped(&mut self)
pub fn popup_centered_clamped(&mut self)
To set the default parameters, use Self::popup_centered_clamped_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_centered_clamped_ex<'a>(&'a mut self) -> ExPopupCenteredClamped<'a>
pub fn popup_exclusive(&mut self, from_node: impl AsArg<Option<Gd<Node>>>)
pub fn popup_exclusive(&mut self, from_node: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::popup_exclusive_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_exclusive_ex<'a>( &'a mut self, from_node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExPopupExclusive<'a>
pub fn popup_exclusive_on_parent( &mut self, from_node: impl AsArg<Option<Gd<Node>>>, parent_rect: Rect2i, )
pub fn popup_exclusive_centered(
&mut self,
from_node: impl AsArg<Option<Gd<Node>>>,
)
pub fn popup_exclusive_centered( &mut self, from_node: impl AsArg<Option<Gd<Node>>>, )
To set the default parameters, use Self::popup_exclusive_centered_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_exclusive_centered_ex<'a>( &'a mut self, from_node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExPopupExclusiveCentered<'a>
pub fn popup_exclusive_centered_ratio(
&mut self,
from_node: impl AsArg<Option<Gd<Node>>>,
)
pub fn popup_exclusive_centered_ratio( &mut self, from_node: impl AsArg<Option<Gd<Node>>>, )
To set the default parameters, use Self::popup_exclusive_centered_ratio_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_exclusive_centered_ratio_ex<'a>( &'a mut self, from_node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExPopupExclusiveCenteredRatio<'a>
pub fn popup_exclusive_centered_clamped(
&mut self,
from_node: impl AsArg<Option<Gd<Node>>>,
)
pub fn popup_exclusive_centered_clamped( &mut self, from_node: impl AsArg<Option<Gd<Node>>>, )
To set the default parameters, use Self::popup_exclusive_centered_clamped_ex
and its builder methods. See the book for detailed usage instructions.
pub fn popup_exclusive_centered_clamped_ex<'a>( &'a mut self, from_node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExPopupExclusiveCenteredClamped<'a>
pub fn notify(&mut self, what: WindowNotification)
pub fn notify(&mut self, what: WindowNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: WindowNotification)
pub fn notify_reversed(&mut self, what: WindowNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Methods from Deref<Target = Viewport>§
pub fn set_world_2d(&mut self, world_2d: impl AsArg<Option<Gd<World2D>>>)
pub fn get_world_2d(&self) -> Option<Gd<World2D>>
pub fn find_world_2d(&self) -> Option<Gd<World2D>>
pub fn set_canvas_transform(&mut self, xform: Transform2D)
pub fn get_canvas_transform(&self) -> Transform2D
pub fn set_global_canvas_transform(&mut self, xform: Transform2D)
pub fn get_global_canvas_transform(&self) -> Transform2D
pub fn get_stretch_transform(&self) -> Transform2D
pub fn get_final_transform(&self) -> Transform2D
pub fn get_screen_transform(&self) -> Transform2D
pub fn get_visible_rect(&self) -> Rect2
pub fn set_transparent_background(&mut self, enable: bool)
pub fn has_transparent_background(&self) -> bool
pub fn set_use_hdr_2d(&mut self, enable: bool)
pub fn is_using_hdr_2d(&self) -> bool
pub fn set_msaa_2d(&mut self, msaa: Msaa)
pub fn get_msaa_2d(&self) -> Msaa
pub fn set_msaa_3d(&mut self, msaa: Msaa)
pub fn get_msaa_3d(&self) -> Msaa
pub fn set_screen_space_aa(&mut self, screen_space_aa: ScreenSpaceAa)
pub fn get_screen_space_aa(&self) -> ScreenSpaceAa
pub fn set_use_taa(&mut self, enable: bool)
pub fn is_using_taa(&self) -> bool
pub fn set_use_debanding(&mut self, enable: bool)
pub fn is_using_debanding(&self) -> bool
pub fn set_use_occlusion_culling(&mut self, enable: bool)
pub fn is_using_occlusion_culling(&self) -> bool
pub fn set_debug_draw(&mut self, debug_draw: DebugDraw)
pub fn get_debug_draw(&self) -> DebugDraw
pub fn get_render_info( &mut self, type_: RenderInfoType, info: RenderInfo, ) -> i32
pub fn get_texture(&self) -> Option<Gd<ViewportTexture>>
pub fn set_physics_object_picking(&mut self, enable: bool)
pub fn get_physics_object_picking(&mut self) -> bool
pub fn set_physics_object_picking_sort(&mut self, enable: bool)
pub fn get_physics_object_picking_sort(&mut self) -> bool
pub fn set_physics_object_picking_first_only(&mut self, enable: bool)
pub fn get_physics_object_picking_first_only(&mut self) -> bool
pub fn get_viewport_rid(&self) -> Rid
pub fn push_text_input(&mut self, text: impl AsArg<GString>)
pub fn push_input(&mut self, event: impl AsArg<Option<Gd<InputEvent>>>)
pub fn push_input(&mut self, event: impl AsArg<Option<Gd<InputEvent>>>)
To set the default parameters, use Self::push_input_ex
and its builder methods. See the book for detailed usage instructions.
pub fn push_input_ex<'a>( &'a mut self, event: impl AsArg<Option<Gd<InputEvent>>> + 'a, ) -> ExPushInput<'a>
pub fn push_unhandled_input(
&mut self,
event: impl AsArg<Option<Gd<InputEvent>>>,
)
pub fn push_unhandled_input( &mut self, event: impl AsArg<Option<Gd<InputEvent>>>, )
To set the default parameters, use Self::push_unhandled_input_ex
and its builder methods. See the book for detailed usage instructions.
pub fn push_unhandled_input_ex<'a>( &'a mut self, event: impl AsArg<Option<Gd<InputEvent>>> + 'a, ) -> ExPushUnhandledInput<'a>
pub fn notify_mouse_entered(&mut self)
pub fn notify_mouse_exited(&mut self)
pub fn get_mouse_position(&self) -> Vector2
pub fn warp_mouse(&mut self, position: Vector2)
pub fn update_mouse_cursor_state(&mut self)
pub fn gui_cancel_drag(&mut self)
pub fn gui_get_drag_data(&self) -> Variant
pub fn gui_is_dragging(&self) -> bool
pub fn gui_is_drag_successful(&self) -> bool
pub fn gui_release_focus(&mut self)
pub fn gui_get_focus_owner(&self) -> Option<Gd<Control>>
pub fn gui_get_hovered_control(&self) -> Option<Gd<Control>>
pub fn set_disable_input(&mut self, disable: bool)
pub fn is_input_disabled(&self) -> bool
pub fn set_positional_shadow_atlas_size(&mut self, size: i32)
pub fn get_positional_shadow_atlas_size(&self) -> i32
pub fn set_positional_shadow_atlas_16_bits(&mut self, enable: bool)
pub fn get_positional_shadow_atlas_16_bits(&self) -> bool
pub fn set_snap_controls_to_pixels(&mut self, enabled: bool)
pub fn is_snap_controls_to_pixels_enabled(&self) -> bool
pub fn set_snap_2d_transforms_to_pixel(&mut self, enabled: bool)
pub fn is_snap_2d_transforms_to_pixel_enabled(&self) -> bool
pub fn set_snap_2d_vertices_to_pixel(&mut self, enabled: bool)
pub fn is_snap_2d_vertices_to_pixel_enabled(&self) -> bool
pub fn set_positional_shadow_atlas_quadrant_subdiv( &mut self, quadrant: i32, subdiv: PositionalShadowAtlasQuadrantSubdiv, )
pub fn get_positional_shadow_atlas_quadrant_subdiv( &self, quadrant: i32, ) -> PositionalShadowAtlasQuadrantSubdiv
pub fn set_input_as_handled(&mut self)
pub fn is_input_handled(&self) -> bool
pub fn set_handle_input_locally(&mut self, enable: bool)
pub fn is_handling_input_locally(&self) -> bool
pub fn set_default_canvas_item_texture_filter( &mut self, mode: DefaultCanvasItemTextureFilter, )
pub fn get_default_canvas_item_texture_filter( &self, ) -> DefaultCanvasItemTextureFilter
pub fn set_embedding_subwindows(&mut self, enable: bool)
pub fn is_embedding_subwindows(&self) -> bool
pub fn get_embedded_subwindows(&self) -> Array<Gd<Window>>
pub fn set_canvas_cull_mask(&mut self, mask: u32)
pub fn get_canvas_cull_mask(&self) -> u32
pub fn set_canvas_cull_mask_bit(&mut self, layer: u32, enable: bool)
pub fn get_canvas_cull_mask_bit(&self, layer: u32) -> bool
pub fn set_default_canvas_item_texture_repeat( &mut self, mode: DefaultCanvasItemTextureRepeat, )
pub fn get_default_canvas_item_texture_repeat( &self, ) -> DefaultCanvasItemTextureRepeat
pub fn set_sdf_oversize(&mut self, oversize: SdfOversize)
pub fn get_sdf_oversize(&self) -> SdfOversize
pub fn set_sdf_scale(&mut self, scale: SdfScale)
pub fn get_sdf_scale(&self) -> SdfScale
pub fn set_mesh_lod_threshold(&mut self, pixels: f32)
pub fn get_mesh_lod_threshold(&self) -> f32
pub fn set_as_audio_listener_2d(&mut self, enable: bool)
pub fn is_audio_listener_2d(&self) -> bool
pub fn get_audio_listener_2d(&self) -> Option<Gd<AudioListener2D>>
pub fn get_camera_2d(&self) -> Option<Gd<Camera2D>>
pub fn set_world_3d(&mut self, world_3d: impl AsArg<Option<Gd<World3D>>>)
pub fn get_world_3d(&self) -> Option<Gd<World3D>>
pub fn find_world_3d(&self) -> Option<Gd<World3D>>
pub fn set_use_own_world_3d(&mut self, enable: bool)
pub fn is_using_own_world_3d(&self) -> bool
pub fn get_audio_listener_3d(&self) -> Option<Gd<AudioListener3D>>
pub fn get_camera_3d(&self) -> Option<Gd<Camera3D>>
pub fn set_as_audio_listener_3d(&mut self, enable: bool)
pub fn is_audio_listener_3d(&self) -> bool
pub fn set_disable_3d(&mut self, disable: bool)
pub fn is_3d_disabled(&self) -> bool
pub fn set_use_xr(&mut self, use_: bool)
pub fn is_using_xr(&mut self) -> bool
pub fn set_scaling_3d_mode(&mut self, scaling_3d_mode: Scaling3DMode)
pub fn get_scaling_3d_mode(&self) -> Scaling3DMode
pub fn set_scaling_3d_scale(&mut self, scale: f32)
pub fn get_scaling_3d_scale(&self) -> f32
pub fn set_fsr_sharpness(&mut self, fsr_sharpness: f32)
pub fn get_fsr_sharpness(&self) -> f32
pub fn set_texture_mipmap_bias(&mut self, texture_mipmap_bias: f32)
pub fn get_texture_mipmap_bias(&self) -> f32
pub fn set_anisotropic_filtering_level( &mut self, anisotropic_filtering_level: AnisotropicFiltering, )
pub fn get_anisotropic_filtering_level(&self) -> AnisotropicFiltering
pub fn set_vrs_mode(&mut self, mode: VrsMode)
pub fn get_vrs_mode(&self) -> VrsMode
pub fn set_vrs_update_mode(&mut self, mode: VrsUpdateMode)
pub fn get_vrs_update_mode(&self) -> VrsUpdateMode
pub fn set_vrs_texture(&mut self, texture: impl AsArg<Option<Gd<Texture2D>>>)
pub fn get_vrs_texture(&self) -> Option<Gd<Texture2D>>
Methods from Deref<Target = Node>§
pub fn get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Gd<T>
pub fn get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Gd<T>
⚠️ Retrieves the node at path path
, panicking if not found or bad type.
§Panics
If the node is not found, or if it does not have type T
or inherited.
pub fn try_get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Option<Gd<T>>
pub fn try_get_node_as<T>(&self, path: impl AsArg<NodePath>) -> Option<Gd<T>>
Retrieves the node at path path
(fallible).
If the node is not found, or if it does not have type T
or inherited,
None
will be returned.
pub fn add_sibling(&mut self, sibling: impl AsArg<Option<Gd<Node>>>)
pub fn add_sibling(&mut self, sibling: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::add_sibling_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_sibling_ex<'a>( &'a mut self, sibling: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExAddSibling<'a>
pub fn set_name(&mut self, name: impl AsArg<GString>)
pub fn get_name(&self) -> StringName
pub fn add_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn add_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::add_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_child_ex<'a>( &'a mut self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExAddChild<'a>
pub fn remove_child(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn reparent(&mut self, new_parent: impl AsArg<Option<Gd<Node>>>)
pub fn reparent(&mut self, new_parent: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::reparent_ex
and its builder methods. See the book for detailed usage instructions.
pub fn reparent_ex<'a>( &'a mut self, new_parent: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExReparent<'a>
pub fn get_child_count(&self) -> i32
pub fn get_child_count(&self) -> i32
To set the default parameters, use Self::get_child_count_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_child_count_ex<'a>(&'a self) -> ExGetChildCount<'a>
pub fn get_children(&self) -> Array<Gd<Node>>
pub fn get_children(&self) -> Array<Gd<Node>>
To set the default parameters, use Self::get_children_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_children_ex<'a>(&'a self) -> ExGetChildren<'a>
pub fn get_child(&self, idx: i32) -> Option<Gd<Node>>
pub fn get_child(&self, idx: i32) -> Option<Gd<Node>>
To set the default parameters, use Self::get_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_child_ex<'a>(&'a self, idx: i32) -> ExGetChild<'a>
pub fn has_node(&self, path: impl AsArg<NodePath>) -> bool
pub fn get_node_or_null(&self, path: impl AsArg<NodePath>) -> Option<Gd<Node>>
pub fn get_parent(&self) -> Option<Gd<Node>>
pub fn find_child(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
pub fn find_child(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
To set the default parameters, use Self::find_child_ex
and its builder methods. See the book for detailed usage instructions.
pub fn find_child_ex<'a>( &'a self, pattern: impl AsArg<GString> + 'a, ) -> ExFindChild<'a>
pub fn find_children(&self, pattern: impl AsArg<GString>) -> Array<Gd<Node>>
pub fn find_children(&self, pattern: impl AsArg<GString>) -> Array<Gd<Node>>
To set the default parameters, use Self::find_children_ex
and its builder methods. See the book for detailed usage instructions.
pub fn find_children_ex<'a>( &'a self, pattern: impl AsArg<GString> + 'a, ) -> ExFindChildren<'a>
pub fn find_parent(&self, pattern: impl AsArg<GString>) -> Option<Gd<Node>>
pub fn has_node_and_resource(&self, path: impl AsArg<NodePath>) -> bool
pub fn get_node_and_resource( &mut self, path: impl AsArg<NodePath>, ) -> Array<Variant>
pub fn is_inside_tree(&self) -> bool
pub fn is_part_of_edited_scene(&self) -> bool
pub fn is_ancestor_of(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn is_greater_than(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn get_path(&self) -> NodePath
pub fn get_path_to(&self, node: impl AsArg<Option<Gd<Node>>>) -> NodePath
pub fn get_path_to(&self, node: impl AsArg<Option<Gd<Node>>>) -> NodePath
To set the default parameters, use Self::get_path_to_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_path_to_ex<'a>( &'a self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExGetPathTo<'a>
pub fn add_to_group(&mut self, group: impl AsArg<StringName>)
pub fn add_to_group(&mut self, group: impl AsArg<StringName>)
To set the default parameters, use Self::add_to_group_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_to_group_ex<'a>( &'a mut self, group: impl AsArg<StringName> + 'a, ) -> ExAddToGroup<'a>
pub fn remove_from_group(&mut self, group: impl AsArg<StringName>)
pub fn is_in_group(&self, group: impl AsArg<StringName>) -> bool
pub fn move_child( &mut self, child_node: impl AsArg<Option<Gd<Node>>>, to_index: i32, )
pub fn get_groups(&self) -> Array<StringName>
pub fn set_owner(&mut self, owner: impl AsArg<Option<Gd<Node>>>)
pub fn get_owner(&self) -> Option<Gd<Node>>
pub fn get_index(&self) -> i32
pub fn get_index(&self) -> i32
To set the default parameters, use Self::get_index_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_index_ex<'a>(&'a self) -> ExGetIndex<'a>
pub fn print_tree(&mut self)
pub fn print_tree_pretty(&mut self)
pub fn get_tree_string(&mut self) -> GString
pub fn get_tree_string_pretty(&mut self) -> GString
pub fn set_scene_file_path(&mut self, scene_file_path: impl AsArg<GString>)
pub fn get_scene_file_path(&self) -> GString
pub fn propagate_notification(&mut self, what: i32)
pub fn propagate_call(&mut self, method: impl AsArg<StringName>)
pub fn propagate_call(&mut self, method: impl AsArg<StringName>)
To set the default parameters, use Self::propagate_call_ex
and its builder methods. See the book for detailed usage instructions.
pub fn propagate_call_ex<'a>( &'a mut self, method: impl AsArg<StringName> + 'a, ) -> ExPropagateCall<'a>
pub fn set_physics_process(&mut self, enable: bool)
pub fn get_physics_process_delta_time(&self) -> f64
pub fn is_physics_processing(&self) -> bool
pub fn get_process_delta_time(&self) -> f64
pub fn set_process(&mut self, enable: bool)
pub fn set_process_priority(&mut self, priority: i32)
pub fn get_process_priority(&self) -> i32
pub fn set_physics_process_priority(&mut self, priority: i32)
pub fn get_physics_process_priority(&self) -> i32
pub fn is_processing(&self) -> bool
pub fn set_process_input(&mut self, enable: bool)
pub fn is_processing_input(&self) -> bool
pub fn set_process_shortcut_input(&mut self, enable: bool)
pub fn is_processing_shortcut_input(&self) -> bool
pub fn set_process_unhandled_input(&mut self, enable: bool)
pub fn is_processing_unhandled_input(&self) -> bool
pub fn set_process_unhandled_key_input(&mut self, enable: bool)
pub fn is_processing_unhandled_key_input(&self) -> bool
pub fn set_process_mode(&mut self, mode: ProcessMode)
pub fn get_process_mode(&self) -> ProcessMode
pub fn can_process(&self) -> bool
pub fn set_process_thread_group(&mut self, mode: ProcessThreadGroup)
pub fn get_process_thread_group(&self) -> ProcessThreadGroup
pub fn set_process_thread_messages(&mut self, flags: ProcessThreadMessages)
pub fn get_process_thread_messages(&self) -> ProcessThreadMessages
pub fn set_process_thread_group_order(&mut self, order: i32)
pub fn get_process_thread_group_order(&self) -> i32
pub fn set_display_folded(&mut self, fold: bool)
pub fn is_displayed_folded(&self) -> bool
pub fn set_process_internal(&mut self, enable: bool)
pub fn is_processing_internal(&self) -> bool
pub fn set_physics_process_internal(&mut self, enable: bool)
pub fn is_physics_processing_internal(&self) -> bool
pub fn set_physics_interpolation_mode(&mut self, mode: PhysicsInterpolationMode)
pub fn get_physics_interpolation_mode(&self) -> PhysicsInterpolationMode
pub fn is_physics_interpolated(&self) -> bool
pub fn is_physics_interpolated_and_enabled(&self) -> bool
pub fn reset_physics_interpolation(&mut self)
pub fn set_auto_translate_mode(&mut self, mode: AutoTranslateMode)
pub fn get_auto_translate_mode(&self) -> AutoTranslateMode
pub fn set_translation_domain_inherited(&mut self)
pub fn get_window(&self) -> Option<Gd<Window>>
pub fn get_last_exclusive_window(&self) -> Option<Gd<Window>>
pub fn get_tree(&self) -> Option<Gd<SceneTree>>
pub fn create_tween(&mut self) -> Option<Gd<Tween>>
pub fn duplicate(&self) -> Option<Gd<Node>>
pub fn duplicate(&self) -> Option<Gd<Node>>
To set the default parameters, use Self::duplicate_ex
and its builder methods. See the book for detailed usage instructions.
pub fn duplicate_ex<'a>(&'a self) -> ExDuplicate<'a>
pub fn replace_by(&mut self, node: impl AsArg<Option<Gd<Node>>>)
pub fn replace_by(&mut self, node: impl AsArg<Option<Gd<Node>>>)
To set the default parameters, use Self::replace_by_ex
and its builder methods. See the book for detailed usage instructions.
pub fn replace_by_ex<'a>( &'a mut self, node: impl AsArg<Option<Gd<Node>>> + 'a, ) -> ExReplaceBy<'a>
pub fn set_scene_instance_load_placeholder(&mut self, load_placeholder: bool)
pub fn get_scene_instance_load_placeholder(&self) -> bool
pub fn set_editable_instance( &mut self, node: impl AsArg<Option<Gd<Node>>>, is_editable: bool, )
pub fn is_editable_instance(&self, node: impl AsArg<Option<Gd<Node>>>) -> bool
pub fn get_viewport(&self) -> Option<Gd<Viewport>>
pub fn queue_free(&mut self)
pub fn request_ready(&mut self)
pub fn is_node_ready(&self) -> bool
To set the default parameters, use Self::set_multiplayer_authority_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_multiplayer(&self) -> Option<Gd<MultiplayerApi>>
pub fn rpc_config(&mut self, method: impl AsArg<StringName>, config: &Variant)
pub fn get_rpc_config(&self) -> Variant
pub fn set_editor_description( &mut self, editor_description: impl AsArg<GString>, )
pub fn get_editor_description(&self) -> GString
pub fn set_unique_name_in_owner(&mut self, enable: bool)
pub fn is_unique_name_in_owner(&self) -> bool
pub fn atr(&self, message: impl AsArg<GString>) -> GString
pub fn atr(&self, message: impl AsArg<GString>) -> GString
To set the default parameters, use Self::atr_ex
and its builder methods. See the book for detailed usage instructions.
pub fn atr_ex<'a>(&'a self, message: impl AsArg<GString> + 'a) -> ExAtr<'a>
pub fn atr_n(
&self,
message: impl AsArg<GString>,
plural_message: impl AsArg<StringName>,
n: i32,
) -> GString
pub fn atr_n( &self, message: impl AsArg<GString>, plural_message: impl AsArg<StringName>, n: i32, ) -> GString
To set the default parameters, use Self::atr_n_ex
and its builder methods. See the book for detailed usage instructions.
pub fn atr_n_ex<'a>( &'a self, message: impl AsArg<GString> + 'a, plural_message: impl AsArg<StringName> + 'a, n: i32, ) -> ExAtrN<'a>
pub fn rpc(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn rpc( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_rpc(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn rpc_id(
&mut self,
peer_id: i64,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn rpc_id( &mut self, peer_id: i64, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_rpc_id(
&mut self,
peer_id: i64,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_rpc_id( &mut self, peer_id: i64, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn update_configuration_warnings(&mut self)
pub fn call_deferred_thread_group(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_deferred_thread_group( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_deferred_thread_group(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred_thread_group( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_deferred_thread_group( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn notify_deferred_thread_group(&mut self, what: i32)
pub fn call_thread_safe(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_thread_safe( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_thread_safe(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_thread_safe( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_thread_safe( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn notify_thread_safe(&mut self, what: i32)
pub fn notify(&mut self, what: NodeNotification)
pub fn notify(&mut self, what: NodeNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: NodeNotification)
pub fn notify_reversed(&mut self, what: NodeNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Methods from Deref<Target = Object>§
pub fn get_script(&self) -> Option<Gd<Script>>
pub fn set_script(&mut self, script: impl AsArg<Option<Gd<Script>>>)
pub fn connect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, ) -> Error
pub fn connect_flags( &mut self, signal: impl AsArg<StringName>, callable: &Callable, flags: ConnectFlags, ) -> Error
pub fn get_class(&self) -> GString
pub fn is_class(&self, class: impl AsArg<GString>) -> bool
pub fn set(&mut self, property: impl AsArg<StringName>, value: &Variant)
pub fn get(&self, property: impl AsArg<StringName>) -> Variant
pub fn set_indexed( &mut self, property_path: impl AsArg<NodePath>, value: &Variant, )
pub fn get_indexed(&self, property_path: impl AsArg<NodePath>) -> Variant
pub fn get_property_list(&self) -> Array<Dictionary>
pub fn get_method_list(&self) -> Array<Dictionary>
pub fn property_can_revert(&self, property: impl AsArg<StringName>) -> bool
pub fn property_get_revert(&self, property: impl AsArg<StringName>) -> Variant
pub fn set_meta(&mut self, name: impl AsArg<StringName>, value: &Variant)
pub fn remove_meta(&mut self, name: impl AsArg<StringName>)
pub fn get_meta(&self, name: impl AsArg<StringName>) -> Variant
pub fn get_meta(&self, name: impl AsArg<StringName>) -> Variant
To set the default parameters, use Self::get_meta_ex
and its builder methods. See the book for detailed usage instructions.
pub fn get_meta_ex<'a>( &'a self, name: impl AsArg<StringName> + 'a, ) -> ExGetMeta<'a>
pub fn has_meta(&self, name: impl AsArg<StringName>) -> bool
pub fn get_meta_list(&self) -> Array<StringName>
pub fn add_user_signal(&mut self, signal: impl AsArg<GString>)
pub fn add_user_signal(&mut self, signal: impl AsArg<GString>)
To set the default parameters, use Self::add_user_signal_ex
and its builder methods. See the book for detailed usage instructions.
pub fn add_user_signal_ex<'a>( &'a mut self, signal: impl AsArg<GString> + 'a, ) -> ExAddUserSignal<'a>
pub fn has_user_signal(&self, signal: impl AsArg<StringName>) -> bool
pub fn remove_user_signal(&mut self, signal: impl AsArg<StringName>)
pub fn emit_signal(
&mut self,
signal: impl AsArg<StringName>,
varargs: &[Variant],
) -> Error
pub fn emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Error
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_emit_signal(
&mut self,
signal: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_emit_signal( &mut self, signal: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Error, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn call(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn call_deferred(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Variant
pub fn call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Variant
§Panics
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will panic in such a case.
pub fn try_call_deferred(
&mut self,
method: impl AsArg<StringName>,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred( &mut self, method: impl AsArg<StringName>, varargs: &[Variant], ) -> Result<Variant, CallError>
§Return type
This is a varcall method, meaning parameters and return values are passed as Variant
.
It can detect call failures and will return Err
in such a case.
pub fn set_deferred( &mut self, property: impl AsArg<StringName>, value: &Variant, )
pub fn callv( &mut self, method: impl AsArg<StringName>, arg_array: &Array<Variant>, ) -> Variant
pub fn has_method(&self, method: impl AsArg<StringName>) -> bool
pub fn get_method_argument_count(&self, method: impl AsArg<StringName>) -> i32
pub fn has_signal(&self, signal: impl AsArg<StringName>) -> bool
pub fn get_signal_list(&self) -> Array<Dictionary>
pub fn get_signal_connection_list( &self, signal: impl AsArg<StringName>, ) -> Array<Dictionary>
pub fn get_incoming_connections(&self) -> Array<Dictionary>
pub fn disconnect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, )
pub fn is_connected( &self, signal: impl AsArg<StringName>, callable: &Callable, ) -> bool
pub fn has_connections(&self, signal: impl AsArg<StringName>) -> bool
pub fn set_block_signals(&mut self, enable: bool)
pub fn is_blocking_signals(&self) -> bool
pub fn notify_property_list_changed(&mut self)
pub fn set_message_translation(&mut self, enable: bool)
pub fn can_translate_messages(&self) -> bool
pub fn tr(&self, message: impl AsArg<StringName>) -> GString
pub fn tr(&self, message: impl AsArg<StringName>) -> GString
To set the default parameters, use Self::tr_ex
and its builder methods. See the book for detailed usage instructions.
pub fn tr_ex<'a>(&'a self, message: impl AsArg<StringName> + 'a) -> ExTr<'a>
pub fn tr_n(
&self,
message: impl AsArg<StringName>,
plural_message: impl AsArg<StringName>,
n: i32,
) -> GString
pub fn tr_n( &self, message: impl AsArg<StringName>, plural_message: impl AsArg<StringName>, n: i32, ) -> GString
To set the default parameters, use Self::tr_n_ex
and its builder methods. See the book for detailed usage instructions.
pub fn tr_n_ex<'a>( &'a self, message: impl AsArg<StringName> + 'a, plural_message: impl AsArg<StringName> + 'a, n: i32, ) -> ExTrN<'a>
pub fn get_translation_domain(&self) -> StringName
pub fn set_translation_domain(&mut self, domain: impl AsArg<StringName>)
pub fn is_queued_for_deletion(&self) -> bool
pub fn cancel_free(&mut self)
pub fn notify(&mut self, what: ObjectNotification)
pub fn notify(&mut self, what: ObjectNotification)
⚠️ Sends a Godot notification to all classes inherited by the object.
Triggers calls to on_notification()
, and depending on the notification, also to Godot’s lifecycle callbacks such as ready()
.
Starts from the highest ancestor (the Object
class) and goes down the hierarchy.
See also Godot docs for Object::notification()
.
§Panics
If you call this method on a user-defined object while holding a GdRef
or GdMut
guard on the instance, you will encounter
a panic. The reason is that the receiving virtual method on_notification()
acquires a GdMut
lock dynamically, which must
be exclusive.
pub fn notify_reversed(&mut self, what: ObjectNotification)
pub fn notify_reversed(&mut self, what: ObjectNotification)
⚠️ Like Self::notify()
, but starts at the most-derived class and goes up the hierarchy.
See docs of that method, including the panics.
Trait Implementations§
§impl GodotClass for PopupMenu
impl GodotClass for PopupMenu
§const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene
const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene
§fn class_id() -> ClassId
fn class_id() -> ClassId
§fn class_name() -> ClassId
fn class_name() -> ClassId
class_id()
§fn inherits<Base>() -> boolwhere
Base: GodotClass,
fn inherits<Base>() -> boolwhere
Base: GodotClass,
§impl Inherits<Node> for PopupMenu
impl Inherits<Node> for PopupMenu
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Object> for PopupMenu
impl Inherits<Object> for PopupMenu
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Popup> for PopupMenu
impl Inherits<Popup> for PopupMenu
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Viewport> for PopupMenu
impl Inherits<Viewport> for PopupMenu
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl Inherits<Window> for PopupMenu
impl Inherits<Window> for PopupMenu
§const IS_SAME_CLASS: bool = false
const IS_SAME_CLASS: bool = false
Self == Base
. Read more§impl WithSignals for PopupMenu
impl WithSignals for PopupMenu
§type SignalCollection<'c, C: WithSignals> = SignalsOfPopupMenu<'c, C>
type SignalCollection<'c, C: WithSignals> = SignalsOfPopupMenu<'c, C>
impl GodotDefault for PopupMenu
Auto Trait Implementations§
impl Freeze for PopupMenu
impl RefUnwindSafe for PopupMenu
impl !Send for PopupMenu
impl !Sync for PopupMenu
impl Unpin for PopupMenu
impl UnwindSafe for PopupMenu
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
§impl<T> Inherits<T> for Twhere
T: GodotClass,
impl<T> Inherits<T> for Twhere
T: GodotClass,
§const IS_SAME_CLASS: bool = true
const IS_SAME_CLASS: bool = true
Self == Base
. Read more