godot::classes

Struct DisplayServer

#[repr(C)]
pub struct DisplayServer { /* private fields */ }
Expand description

Godot class DisplayServer.

Inherits Object.

Related symbols:

See also Godot docs for DisplayServer.

§Singleton

This class is a singleton. You can get the one instance using DisplayServer::singleton().

Implementations§

§

impl DisplayServer

pub const SCREEN_WITH_MOUSE_FOCUS: i32 = -4i32

pub const SCREEN_WITH_KEYBOARD_FOCUS: i32 = -3i32

pub const SCREEN_PRIMARY: i32 = -2i32

pub const SCREEN_OF_MAIN_WINDOW: i32 = -1i32

pub const MAIN_WINDOW_ID: i32 = 0i32

pub const INVALID_WINDOW_ID: i32 = -1i32

pub const INVALID_INDICATOR_ID: i32 = -1i32

pub fn singleton() -> Gd<DisplayServer>

pub fn has_feature(&self, feature: Feature) -> bool

pub fn get_name(&self) -> GString

pub fn help_set_search_callbacks( &mut self, search_callback: &Callable, action_callback: &Callable, )

pub fn global_menu_set_popup_callbacks( &mut self, menu_root: impl AsArg<GString>, open_callback: &Callable, close_callback: &Callable, )

pub fn global_menu_add_submenu_item( &mut self, menu_root: impl AsArg<GString>, label: impl AsArg<GString>, submenu: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_submenu_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_submenu_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, label: impl AsArg<GString> + 'a, submenu: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddSubmenuItem<'a>

pub fn global_menu_add_item( &mut self, menu_root: impl AsArg<GString>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddItem<'a>

pub fn global_menu_add_check_item( &mut self, menu_root: impl AsArg<GString>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_check_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_check_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddCheckItem<'a>

pub fn global_menu_add_icon_item( &mut self, menu_root: impl AsArg<GString>, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_icon_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_icon_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddIconItem<'a>

pub fn global_menu_add_icon_check_item( &mut self, menu_root: impl AsArg<GString>, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_icon_check_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_icon_check_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddIconCheckItem<'a>

pub fn global_menu_add_radio_check_item( &mut self, menu_root: impl AsArg<GString>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_radio_check_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_radio_check_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddRadioCheckItem<'a>

pub fn global_menu_add_icon_radio_check_item( &mut self, menu_root: impl AsArg<GString>, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_icon_radio_check_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_icon_radio_check_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, icon: impl AsObjectArg<Texture2D>, label: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddIconRadioCheckItem<'a>

pub fn global_menu_add_multistate_item( &mut self, menu_root: impl AsArg<GString>, label: impl AsArg<GString>, max_states: i32, default_state: i32, ) -> i32

To set the default parameters, use Self::global_menu_add_multistate_item_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_multistate_item_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, label: impl AsArg<GString> + 'a, max_states: i32, default_state: i32, ) -> ExGlobalMenuAddMultistateItem<'a>

pub fn global_menu_add_separator( &mut self, menu_root: impl AsArg<GString>, ) -> i32

To set the default parameters, use Self::global_menu_add_separator_ex and its builder methods. See the book for detailed usage instructions.

pub fn global_menu_add_separator_ex<'a>( &'a mut self, menu_root: impl AsArg<GString> + 'a, ) -> ExGlobalMenuAddSeparator<'a>

pub fn global_menu_get_item_index_from_text( &self, menu_root: impl AsArg<GString>, text: impl AsArg<GString>, ) -> i32

pub fn global_menu_get_item_index_from_tag( &self, menu_root: impl AsArg<GString>, tag: &Variant, ) -> i32

pub fn global_menu_is_item_checked( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> bool

pub fn global_menu_is_item_checkable( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> bool

pub fn global_menu_is_item_radio_checkable( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> bool

pub fn global_menu_get_item_callback( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> Callable

pub fn global_menu_get_item_key_callback( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> Callable

pub fn global_menu_get_item_tag( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> Variant

pub fn global_menu_get_item_text( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> GString

pub fn global_menu_get_item_submenu( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> GString

pub fn global_menu_get_item_accelerator( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> Key

pub fn global_menu_is_item_disabled( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> bool

pub fn global_menu_is_item_hidden( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> bool

pub fn global_menu_get_item_tooltip( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> GString

pub fn global_menu_get_item_state( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> i32

pub fn global_menu_get_item_max_states( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> i32

pub fn global_menu_get_item_icon( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> Option<Gd<Texture2D>>

pub fn global_menu_get_item_indentation_level( &self, menu_root: impl AsArg<GString>, idx: i32, ) -> i32

pub fn global_menu_set_item_checked( &mut self, menu_root: impl AsArg<GString>, idx: i32, checked: bool, )

pub fn global_menu_set_item_checkable( &mut self, menu_root: impl AsArg<GString>, idx: i32, checkable: bool, )

pub fn global_menu_set_item_radio_checkable( &mut self, menu_root: impl AsArg<GString>, idx: i32, checkable: bool, )

pub fn global_menu_set_item_callback( &mut self, menu_root: impl AsArg<GString>, idx: i32, callback: &Callable, )

pub fn global_menu_set_item_hover_callbacks( &mut self, menu_root: impl AsArg<GString>, idx: i32, callback: &Callable, )

pub fn global_menu_set_item_key_callback( &mut self, menu_root: impl AsArg<GString>, idx: i32, key_callback: &Callable, )

pub fn global_menu_set_item_tag( &mut self, menu_root: impl AsArg<GString>, idx: i32, tag: &Variant, )

pub fn global_menu_set_item_text( &mut self, menu_root: impl AsArg<GString>, idx: i32, text: impl AsArg<GString>, )

pub fn global_menu_set_item_submenu( &mut self, menu_root: impl AsArg<GString>, idx: i32, submenu: impl AsArg<GString>, )

pub fn global_menu_set_item_accelerator( &mut self, menu_root: impl AsArg<GString>, idx: i32, keycode: Key, )

pub fn global_menu_set_item_disabled( &mut self, menu_root: impl AsArg<GString>, idx: i32, disabled: bool, )

pub fn global_menu_set_item_hidden( &mut self, menu_root: impl AsArg<GString>, idx: i32, hidden: bool, )

pub fn global_menu_set_item_tooltip( &mut self, menu_root: impl AsArg<GString>, idx: i32, tooltip: impl AsArg<GString>, )

pub fn global_menu_set_item_state( &mut self, menu_root: impl AsArg<GString>, idx: i32, state: i32, )

pub fn global_menu_set_item_max_states( &mut self, menu_root: impl AsArg<GString>, idx: i32, max_states: i32, )

pub fn global_menu_set_item_icon( &mut self, menu_root: impl AsArg<GString>, idx: i32, icon: impl AsObjectArg<Texture2D>, )

pub fn global_menu_set_item_indentation_level( &mut self, menu_root: impl AsArg<GString>, idx: i32, level: i32, )

pub fn global_menu_get_item_count(&self, menu_root: impl AsArg<GString>) -> i32

pub fn global_menu_remove_item( &mut self, menu_root: impl AsArg<GString>, idx: i32, )

pub fn global_menu_clear(&mut self, menu_root: impl AsArg<GString>)

pub fn global_menu_get_system_menu_roots(&self) -> Dictionary

pub fn tts_is_speaking(&self) -> bool

pub fn tts_is_paused(&self) -> bool

pub fn tts_get_voices(&self) -> Array<Dictionary>

pub fn tts_get_voices_for_language( &self, language: impl AsArg<GString>, ) -> PackedStringArray

pub fn tts_speak( &mut self, text: impl AsArg<GString>, voice: impl AsArg<GString>, )

To set the default parameters, use Self::tts_speak_ex and its builder methods. See the book for detailed usage instructions.

pub fn tts_speak_ex<'a>( &'a mut self, text: impl AsArg<GString> + 'a, voice: impl AsArg<GString> + 'a, ) -> ExTtsSpeak<'a>

pub fn tts_pause(&mut self)

pub fn tts_resume(&mut self)

pub fn tts_stop(&mut self)

pub fn tts_set_utterance_callback( &mut self, event: TtsUtteranceEvent, callable: &Callable, )

pub fn is_dark_mode_supported(&self) -> bool

pub fn is_dark_mode(&self) -> bool

pub fn get_accent_color(&self) -> Color

pub fn get_base_color(&self) -> Color

pub fn set_system_theme_change_callback(&mut self, callable: &Callable)

pub fn mouse_set_mode(&mut self, mouse_mode: MouseMode)

pub fn mouse_get_mode(&self) -> MouseMode

pub fn warp_mouse(&mut self, position: Vector2i)

pub fn mouse_get_position(&self) -> Vector2i

pub fn mouse_get_button_state(&self) -> MouseButtonMask

pub fn clipboard_set(&mut self, clipboard: impl AsArg<GString>)

pub fn clipboard_get(&self) -> GString

pub fn clipboard_get_image(&self) -> Option<Gd<Image>>

pub fn clipboard_has(&self) -> bool

pub fn clipboard_has_image(&self) -> bool

pub fn clipboard_set_primary(&mut self, clipboard_primary: impl AsArg<GString>)

pub fn clipboard_get_primary(&self) -> GString

pub fn get_display_cutouts(&self) -> Array<Rect2>

pub fn get_display_safe_area(&self) -> Rect2i

pub fn get_screen_count(&self) -> i32

pub fn get_primary_screen(&self) -> i32

pub fn get_keyboard_focus_screen(&self) -> i32

pub fn get_screen_from_rect(&self, rect: Rect2) -> i32

pub fn screen_get_position(&self) -> Vector2i

To set the default parameters, use Self::screen_get_position_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_position_ex<'a>(&'a self) -> ExScreenGetPosition<'a>

pub fn screen_get_size(&self) -> Vector2i

To set the default parameters, use Self::screen_get_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_size_ex<'a>(&'a self) -> ExScreenGetSize<'a>

pub fn screen_get_usable_rect(&self) -> Rect2i

To set the default parameters, use Self::screen_get_usable_rect_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_usable_rect_ex<'a>(&'a self) -> ExScreenGetUsableRect<'a>

pub fn screen_get_dpi(&self) -> i32

To set the default parameters, use Self::screen_get_dpi_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_dpi_ex<'a>(&'a self) -> ExScreenGetDpi<'a>

pub fn screen_get_scale(&self) -> f32

To set the default parameters, use Self::screen_get_scale_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_scale_ex<'a>(&'a self) -> ExScreenGetScale<'a>

pub fn is_touchscreen_available(&self) -> bool

pub fn screen_get_max_scale(&self) -> f32

pub fn screen_get_refresh_rate(&self) -> f32

To set the default parameters, use Self::screen_get_refresh_rate_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_refresh_rate_ex<'a>(&'a self) -> ExScreenGetRefreshRate<'a>

pub fn screen_get_pixel(&self, position: Vector2i) -> Color

pub fn screen_get_image(&self) -> Option<Gd<Image>>

To set the default parameters, use Self::screen_get_image_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_image_ex<'a>(&'a self) -> ExScreenGetImage<'a>

pub fn screen_set_orientation(&mut self, orientation: ScreenOrientation)

To set the default parameters, use Self::screen_set_orientation_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_set_orientation_ex<'a>( &'a mut self, orientation: ScreenOrientation, ) -> ExScreenSetOrientation<'a>

pub fn screen_get_orientation(&self) -> ScreenOrientation

To set the default parameters, use Self::screen_get_orientation_ex and its builder methods. See the book for detailed usage instructions.

pub fn screen_get_orientation_ex<'a>(&'a self) -> ExScreenGetOrientation<'a>

pub fn screen_set_keep_on(&mut self, enable: bool)

pub fn screen_is_kept_on(&self) -> bool

pub fn get_window_list(&self) -> PackedInt32Array

pub fn get_window_at_screen_position(&self, position: Vector2i) -> i32

pub fn window_get_native_handle(&self, handle_type: HandleType) -> i64

To set the default parameters, use Self::window_get_native_handle_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_native_handle_ex<'a>( &'a self, handle_type: HandleType, ) -> ExWindowGetNativeHandle<'a>

pub fn window_get_active_popup(&self) -> i32

pub fn window_set_popup_safe_rect(&mut self, window: i32, rect: Rect2i)

pub fn window_get_popup_safe_rect(&self, window: i32) -> Rect2i

pub fn window_set_title(&mut self, title: impl AsArg<GString>)

To set the default parameters, use Self::window_set_title_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_title_ex<'a>( &'a mut self, title: impl AsArg<GString> + 'a, ) -> ExWindowSetTitle<'a>

pub fn window_get_title_size(&self, title: impl AsArg<GString>) -> Vector2i

To set the default parameters, use Self::window_get_title_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_title_size_ex<'a>( &'a self, title: impl AsArg<GString> + 'a, ) -> ExWindowGetTitleSize<'a>

pub fn window_set_mouse_passthrough(&mut self, region: &PackedVector2Array)

To set the default parameters, use Self::window_set_mouse_passthrough_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_mouse_passthrough_ex<'a>( &'a mut self, region: &'a PackedVector2Array, ) -> ExWindowSetMousePassthrough<'a>

pub fn window_get_current_screen(&self) -> i32

To set the default parameters, use Self::window_get_current_screen_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_current_screen_ex<'a>( &'a self, ) -> ExWindowGetCurrentScreen<'a>

pub fn window_set_current_screen(&mut self, screen: i32)

To set the default parameters, use Self::window_set_current_screen_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_current_screen_ex<'a>( &'a mut self, screen: i32, ) -> ExWindowSetCurrentScreen<'a>

pub fn window_get_position(&self) -> Vector2i

To set the default parameters, use Self::window_get_position_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_position_ex<'a>(&'a self) -> ExWindowGetPosition<'a>

pub fn window_get_position_with_decorations(&self) -> Vector2i

To set the default parameters, use Self::window_get_position_with_decorations_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_position_with_decorations_ex<'a>( &'a self, ) -> ExWindowGetPositionWithDecorations<'a>

pub fn window_set_position(&mut self, position: Vector2i)

To set the default parameters, use Self::window_set_position_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_position_ex<'a>( &'a mut self, position: Vector2i, ) -> ExWindowSetPosition<'a>

pub fn window_get_size(&self) -> Vector2i

To set the default parameters, use Self::window_get_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_size_ex<'a>(&'a self) -> ExWindowGetSize<'a>

pub fn window_set_size(&mut self, size: Vector2i)

To set the default parameters, use Self::window_set_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_size_ex<'a>( &'a mut self, size: Vector2i, ) -> ExWindowSetSize<'a>

pub fn window_set_rect_changed_callback(&mut self, callback: &Callable)

To set the default parameters, use Self::window_set_rect_changed_callback_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_rect_changed_callback_ex<'a>( &'a mut self, callback: &'a Callable, ) -> ExWindowSetRectChangedCallback<'a>

pub fn window_set_window_event_callback(&mut self, callback: &Callable)

To set the default parameters, use Self::window_set_window_event_callback_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_window_event_callback_ex<'a>( &'a mut self, callback: &'a Callable, ) -> ExWindowSetWindowEventCallback<'a>

pub fn window_set_input_event_callback(&mut self, callback: &Callable)

To set the default parameters, use Self::window_set_input_event_callback_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_input_event_callback_ex<'a>( &'a mut self, callback: &'a Callable, ) -> ExWindowSetInputEventCallback<'a>

pub fn window_set_input_text_callback(&mut self, callback: &Callable)

To set the default parameters, use Self::window_set_input_text_callback_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_input_text_callback_ex<'a>( &'a mut self, callback: &'a Callable, ) -> ExWindowSetInputTextCallback<'a>

pub fn window_set_drop_files_callback(&mut self, callback: &Callable)

To set the default parameters, use Self::window_set_drop_files_callback_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_drop_files_callback_ex<'a>( &'a mut self, callback: &'a Callable, ) -> ExWindowSetDropFilesCallback<'a>

pub fn window_get_attached_instance_id(&self) -> u64

To set the default parameters, use Self::window_get_attached_instance_id_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_attached_instance_id_ex<'a>( &'a self, ) -> ExWindowGetAttachedInstanceId<'a>

pub fn window_get_max_size(&self) -> Vector2i

To set the default parameters, use Self::window_get_max_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_max_size_ex<'a>(&'a self) -> ExWindowGetMaxSize<'a>

pub fn window_set_max_size(&mut self, max_size: Vector2i)

To set the default parameters, use Self::window_set_max_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_max_size_ex<'a>( &'a mut self, max_size: Vector2i, ) -> ExWindowSetMaxSize<'a>

pub fn window_get_min_size(&self) -> Vector2i

To set the default parameters, use Self::window_get_min_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_min_size_ex<'a>(&'a self) -> ExWindowGetMinSize<'a>

pub fn window_set_min_size(&mut self, min_size: Vector2i)

To set the default parameters, use Self::window_set_min_size_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_min_size_ex<'a>( &'a mut self, min_size: Vector2i, ) -> ExWindowSetMinSize<'a>

pub fn window_get_size_with_decorations(&self) -> Vector2i

To set the default parameters, use Self::window_get_size_with_decorations_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_size_with_decorations_ex<'a>( &'a self, ) -> ExWindowGetSizeWithDecorations<'a>

pub fn window_get_mode(&self) -> WindowMode

To set the default parameters, use Self::window_get_mode_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_mode_ex<'a>(&'a self) -> ExWindowGetMode<'a>

pub fn window_set_mode(&mut self, mode: WindowMode)

To set the default parameters, use Self::window_set_mode_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_mode_ex<'a>( &'a mut self, mode: WindowMode, ) -> ExWindowSetMode<'a>

pub fn window_set_flag(&mut self, flag: WindowFlags, enabled: bool)

To set the default parameters, use Self::window_set_flag_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_flag_ex<'a>( &'a mut self, flag: WindowFlags, enabled: bool, ) -> ExWindowSetFlag<'a>

pub fn window_get_flag(&self, flag: WindowFlags) -> bool

To set the default parameters, use Self::window_get_flag_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_flag_ex<'a>( &'a self, flag: WindowFlags, ) -> ExWindowGetFlag<'a>

pub fn window_set_window_buttons_offset(&mut self, offset: Vector2i)

To set the default parameters, use Self::window_set_window_buttons_offset_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_window_buttons_offset_ex<'a>( &'a mut self, offset: Vector2i, ) -> ExWindowSetWindowButtonsOffset<'a>

pub fn window_get_safe_title_margins(&self) -> Vector3i

To set the default parameters, use Self::window_get_safe_title_margins_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_safe_title_margins_ex<'a>( &'a self, ) -> ExWindowGetSafeTitleMargins<'a>

pub fn window_request_attention(&mut self)

To set the default parameters, use Self::window_request_attention_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_request_attention_ex<'a>( &'a mut self, ) -> ExWindowRequestAttention<'a>

pub fn window_move_to_foreground(&mut self)

To set the default parameters, use Self::window_move_to_foreground_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_move_to_foreground_ex<'a>( &'a mut self, ) -> ExWindowMoveToForeground<'a>

pub fn window_is_focused(&self) -> bool

To set the default parameters, use Self::window_is_focused_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_is_focused_ex<'a>(&'a self) -> ExWindowIsFocused<'a>

pub fn window_can_draw(&self) -> bool

To set the default parameters, use Self::window_can_draw_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_can_draw_ex<'a>(&'a self) -> ExWindowCanDraw<'a>

pub fn window_set_transient(&mut self, window_id: i32, parent_window_id: i32)

pub fn window_set_exclusive(&mut self, window_id: i32, exclusive: bool)

pub fn window_set_ime_active(&mut self, active: bool)

To set the default parameters, use Self::window_set_ime_active_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_ime_active_ex<'a>( &'a mut self, active: bool, ) -> ExWindowSetImeActive<'a>

pub fn window_set_ime_position(&mut self, position: Vector2i)

To set the default parameters, use Self::window_set_ime_position_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_ime_position_ex<'a>( &'a mut self, position: Vector2i, ) -> ExWindowSetImePosition<'a>

pub fn window_set_vsync_mode(&mut self, vsync_mode: VSyncMode)

To set the default parameters, use Self::window_set_vsync_mode_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_set_vsync_mode_ex<'a>( &'a mut self, vsync_mode: VSyncMode, ) -> ExWindowSetVSyncMode<'a>

pub fn window_get_vsync_mode(&self) -> VSyncMode

To set the default parameters, use Self::window_get_vsync_mode_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_get_vsync_mode_ex<'a>(&'a self) -> ExWindowGetVSyncMode<'a>

pub fn window_is_maximize_allowed(&self) -> bool

To set the default parameters, use Self::window_is_maximize_allowed_ex and its builder methods. See the book for detailed usage instructions.

pub fn window_is_maximize_allowed_ex<'a>( &'a self, ) -> ExWindowIsMaximizeAllowed<'a>

pub fn window_maximize_on_title_dbl_click(&self) -> bool

pub fn window_minimize_on_title_dbl_click(&self) -> bool

pub fn ime_get_selection(&self) -> Vector2i

pub fn ime_get_text(&self) -> GString

pub fn virtual_keyboard_show(&mut self, existing_text: impl AsArg<GString>)

To set the default parameters, use Self::virtual_keyboard_show_ex and its builder methods. See the book for detailed usage instructions.

pub fn virtual_keyboard_show_ex<'a>( &'a mut self, existing_text: impl AsArg<GString> + 'a, ) -> ExVirtualKeyboardShow<'a>

pub fn virtual_keyboard_hide(&mut self)

pub fn virtual_keyboard_get_height(&self) -> i32

pub fn cursor_set_shape(&mut self, shape: CursorShape)

pub fn cursor_get_shape(&self) -> CursorShape

pub fn cursor_set_custom_image(&mut self, cursor: impl AsObjectArg<Resource>)

To set the default parameters, use Self::cursor_set_custom_image_ex and its builder methods. See the book for detailed usage instructions.

pub fn cursor_set_custom_image_ex<'a>( &'a mut self, cursor: impl AsObjectArg<Resource>, ) -> ExCursorSetCustomImage<'a>

pub fn get_swap_cancel_ok(&mut self) -> bool

pub fn enable_for_stealing_focus(&mut self, process_id: i64)

pub fn dialog_show( &mut self, title: impl AsArg<GString>, description: impl AsArg<GString>, buttons: &PackedStringArray, callback: &Callable, ) -> Error

pub fn dialog_input_text( &mut self, title: impl AsArg<GString>, description: impl AsArg<GString>, existing_text: impl AsArg<GString>, callback: &Callable, ) -> Error

pub fn file_dialog_show( &mut self, title: impl AsArg<GString>, current_directory: impl AsArg<GString>, filename: impl AsArg<GString>, show_hidden: bool, mode: FileDialogMode, filters: &PackedStringArray, callback: &Callable, ) -> Error

pub fn file_dialog_with_options_show( &mut self, title: impl AsArg<GString>, current_directory: impl AsArg<GString>, root: impl AsArg<GString>, filename: impl AsArg<GString>, show_hidden: bool, mode: FileDialogMode, filters: &PackedStringArray, options: &Array<Dictionary>, callback: &Callable, ) -> Error

pub fn keyboard_get_layout_count(&self) -> i32

pub fn keyboard_get_current_layout(&self) -> i32

pub fn keyboard_set_current_layout(&mut self, index: i32)

pub fn keyboard_get_layout_language(&self, index: i32) -> GString

pub fn keyboard_get_layout_name(&self, index: i32) -> GString

pub fn keyboard_get_keycode_from_physical(&self, keycode: Key) -> Key

pub fn keyboard_get_label_from_physical(&self, keycode: Key) -> Key

pub fn process_events(&mut self)

pub fn force_process_and_drop_events(&mut self)

pub fn set_native_icon(&mut self, filename: impl AsArg<GString>)

pub fn set_icon(&mut self, image: impl AsObjectArg<Image>)

pub fn create_status_indicator( &mut self, icon: impl AsObjectArg<Texture2D>, tooltip: impl AsArg<GString>, callback: &Callable, ) -> i32

pub fn status_indicator_set_icon( &mut self, id: i32, icon: impl AsObjectArg<Texture2D>, )

pub fn status_indicator_set_tooltip( &mut self, id: i32, tooltip: impl AsArg<GString>, )

pub fn status_indicator_set_menu(&mut self, id: i32, menu_rid: Rid)

pub fn status_indicator_set_callback(&mut self, id: i32, callback: &Callable)

pub fn status_indicator_get_rect(&self, id: i32) -> Rect2

pub fn delete_status_indicator(&mut self, id: i32)

pub fn tablet_get_driver_count(&self) -> i32

pub fn tablet_get_driver_name(&self, idx: i32) -> GString

pub fn tablet_get_current_driver(&self) -> GString

pub fn tablet_set_current_driver(&mut self, name: impl AsArg<GString>)

pub fn is_window_transparency_available(&self) -> bool

pub fn register_additional_output(&mut self, object: impl AsObjectArg<Object>)

pub fn unregister_additional_output(&mut self, object: impl AsObjectArg<Object>)

pub fn has_additional_outputs(&self) -> bool

Methods from Deref<Target = Object>§

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_script(&mut self, script: &Variant)

pub fn get_script(&self) -> 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

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>)

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

§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>

§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

§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>

§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

§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>

§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 connect( &mut self, signal: impl AsArg<StringName>, callable: &Callable, ) -> Error

To set the default parameters, use Self::connect_ex and its builder methods. See the book for detailed usage instructions.

pub fn connect_ex<'a>( &'a mut self, signal: impl AsArg<StringName> + 'a, callable: &'a Callable, ) -> ExConnect<'a>

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 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

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

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 is_queued_for_deletion(&self) -> bool

pub fn cancel_free(&mut self)

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)

⚠️ 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 Bounds for DisplayServer

§

type Memory = MemManual

Defines the memory strategy of the static type.
§

type Declarer = DeclEngine

Whether this class is a core Godot class provided by the engine, or declared by the user as a Rust struct.
§

impl Debug for DisplayServer

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for DisplayServer

§

type Target = Object

The resulting type after dereferencing.
§

fn deref(&self) -> &<DisplayServer as Deref>::Target

Dereferences the value.
§

impl DerefMut for DisplayServer

§

fn deref_mut(&mut self) -> &mut <DisplayServer as Deref>::Target

Mutably dereferences the value.
§

impl GodotClass for DisplayServer

§

const INIT_LEVEL: InitLevel = crate::init::InitLevel::Scene

Initialization level, during which this class should be initialized with Godot. Read more
§

type Base = Object

The immediate superclass of T. This is always a Godot engine class.
§

fn class_name() -> ClassName

The name of the class, under which it is registered in Godot. Read more
§

fn inherits<U>() -> bool
where U: GodotClass,

Returns whether Self inherits from U. Read more
§

impl Inherits<Object> for DisplayServer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Inherits<T> for T
where T: GodotClass,