Struct godot::classes::DisplayServer
#[repr(C)]pub struct DisplayServer { /* private fields */ }
Expand description
Godot class DisplayServer.
Inherits Object
.
Related symbols:
display_server
: sidecar module with related enum/flag typesIDisplayServer
: virtual methods
See also Godot docs for DisplayServer
.
§Singleton
This class is a singleton. You can get the one instance using DisplayServer::singleton()
.
Implementations§
§impl DisplayServer
impl DisplayServer
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 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: GString, ) -> PackedStringArray
pub fn tts_speak(&mut self, text: GString, voice: GString)
pub fn tts_speak_ex(&mut self, text: GString, voice: GString) -> ExTtsSpeak<'_>
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 clipboard_set(&mut self, clipboard: 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: 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
pub fn screen_get_position_ex(&self) -> ExScreenGetPosition<'_>
pub fn screen_get_size(&self) -> Vector2i
pub fn screen_get_size_ex(&self) -> ExScreenGetSize<'_>
pub fn screen_get_usable_rect(&self) -> Rect2i
pub fn screen_get_usable_rect_ex(&self) -> ExScreenGetUsableRect<'_>
pub fn screen_get_dpi(&self) -> i32
pub fn screen_get_dpi_ex(&self) -> ExScreenGetDpi<'_>
pub fn screen_get_scale(&self) -> f32
pub fn screen_get_scale_ex(&self) -> ExScreenGetScale<'_>
pub fn is_touchscreen_available(&self) -> bool
pub fn screen_get_max_scale(&self) -> f32
pub fn screen_get_refresh_rate(&self) -> f32
pub fn screen_get_refresh_rate_ex(&self) -> ExScreenGetRefreshRate<'_>
pub fn screen_get_pixel(&self, position: Vector2i) -> Color
pub fn screen_get_image(&self) -> Option<Gd<Image>>
pub fn screen_get_image_ex(&self) -> ExScreenGetImage<'_>
pub fn screen_set_orientation(&mut self, orientation: ScreenOrientation)
pub fn screen_set_orientation_ex( &mut self, orientation: ScreenOrientation, ) -> ExScreenSetOrientation<'_>
pub fn screen_get_orientation(&self) -> ScreenOrientation
pub fn screen_get_orientation_ex(&self) -> ExScreenGetOrientation<'_>
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
pub fn window_get_native_handle_ex( &self, handle_type: HandleType, ) -> ExWindowGetNativeHandle<'_>
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: GString)
pub fn window_set_title_ex(&mut self, title: GString) -> ExWindowSetTitle<'_>
pub fn window_get_title_size(&self, title: GString) -> Vector2i
pub fn window_get_title_size_ex( &self, title: GString, ) -> ExWindowGetTitleSize<'_>
pub fn window_set_mouse_passthrough(&mut self, region: PackedVector2Array)
pub fn window_set_mouse_passthrough_ex( &mut self, region: PackedVector2Array, ) -> ExWindowSetMousePassthrough<'_>
pub fn window_get_current_screen(&self) -> i32
pub fn window_get_current_screen_ex(&self) -> ExWindowGetCurrentScreen<'_>
pub fn window_set_current_screen(&mut self, screen: i32)
pub fn window_set_current_screen_ex( &mut self, screen: i32, ) -> ExWindowSetCurrentScreen<'_>
pub fn window_get_position(&self) -> Vector2i
pub fn window_get_position_ex(&self) -> ExWindowGetPosition<'_>
pub fn window_get_position_with_decorations(&self) -> Vector2i
pub fn window_get_position_with_decorations_ex( &self, ) -> ExWindowGetPositionWithDecorations<'_>
pub fn window_set_position(&mut self, position: Vector2i)
pub fn window_set_position_ex( &mut self, position: Vector2i, ) -> ExWindowSetPosition<'_>
pub fn window_get_size(&self) -> Vector2i
pub fn window_get_size_ex(&self) -> ExWindowGetSize<'_>
pub fn window_set_size(&mut self, size: Vector2i)
pub fn window_set_size_ex(&mut self, size: Vector2i) -> ExWindowSetSize<'_>
pub fn window_set_rect_changed_callback(&mut self, callback: Callable)
pub fn window_set_rect_changed_callback_ex( &mut self, callback: Callable, ) -> ExWindowSetRectChangedCallback<'_>
pub fn window_set_window_event_callback(&mut self, callback: Callable)
pub fn window_set_window_event_callback_ex( &mut self, callback: Callable, ) -> ExWindowSetWindowEventCallback<'_>
pub fn window_set_input_event_callback(&mut self, callback: Callable)
pub fn window_set_input_event_callback_ex( &mut self, callback: Callable, ) -> ExWindowSetInputEventCallback<'_>
pub fn window_set_input_text_callback(&mut self, callback: Callable)
pub fn window_set_input_text_callback_ex( &mut self, callback: Callable, ) -> ExWindowSetInputTextCallback<'_>
pub fn window_set_drop_files_callback(&mut self, callback: Callable)
pub fn window_set_drop_files_callback_ex( &mut self, callback: Callable, ) -> ExWindowSetDropFilesCallback<'_>
pub fn window_get_attached_instance_id(&self) -> u64
pub fn window_get_attached_instance_id_ex( &self, ) -> ExWindowGetAttachedInstanceId<'_>
pub fn window_get_max_size(&self) -> Vector2i
pub fn window_get_max_size_ex(&self) -> ExWindowGetMaxSize<'_>
pub fn window_set_max_size(&mut self, max_size: Vector2i)
pub fn window_set_max_size_ex( &mut self, max_size: Vector2i, ) -> ExWindowSetMaxSize<'_>
pub fn window_get_min_size(&self) -> Vector2i
pub fn window_get_min_size_ex(&self) -> ExWindowGetMinSize<'_>
pub fn window_set_min_size(&mut self, min_size: Vector2i)
pub fn window_set_min_size_ex( &mut self, min_size: Vector2i, ) -> ExWindowSetMinSize<'_>
pub fn window_get_size_with_decorations(&self) -> Vector2i
pub fn window_get_size_with_decorations_ex( &self, ) -> ExWindowGetSizeWithDecorations<'_>
pub fn window_get_mode(&self) -> WindowMode
pub fn window_get_mode_ex(&self) -> ExWindowGetMode<'_>
pub fn window_set_mode(&mut self, mode: WindowMode)
pub fn window_set_mode_ex(&mut self, mode: WindowMode) -> ExWindowSetMode<'_>
pub fn window_set_flag(&mut self, flag: WindowFlags, enabled: bool)
pub fn window_set_flag_ex( &mut self, flag: WindowFlags, enabled: bool, ) -> ExWindowSetFlag<'_>
pub fn window_get_flag(&self, flag: WindowFlags) -> bool
pub fn window_get_flag_ex(&self, flag: WindowFlags) -> ExWindowGetFlag<'_>
pub fn window_get_safe_title_margins(&self) -> Vector3i
pub fn window_get_safe_title_margins_ex( &self, ) -> ExWindowGetSafeTitleMargins<'_>
pub fn window_request_attention(&mut self)
pub fn window_request_attention_ex(&mut self) -> ExWindowRequestAttention<'_>
pub fn window_move_to_foreground(&mut self)
pub fn window_move_to_foreground_ex(&mut self) -> ExWindowMoveToForeground<'_>
pub fn window_is_focused(&self) -> bool
pub fn window_is_focused_ex(&self) -> ExWindowIsFocused<'_>
pub fn window_can_draw(&self) -> bool
pub fn window_can_draw_ex(&self) -> ExWindowCanDraw<'_>
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)
pub fn window_set_ime_active_ex( &mut self, active: bool, ) -> ExWindowSetImeActive<'_>
pub fn window_set_ime_position(&mut self, position: Vector2i)
pub fn window_set_ime_position_ex( &mut self, position: Vector2i, ) -> ExWindowSetImePosition<'_>
pub fn window_set_vsync_mode(&mut self, vsync_mode: VSyncMode)
pub fn window_set_vsync_mode_ex( &mut self, vsync_mode: VSyncMode, ) -> ExWindowSetVSyncMode<'_>
pub fn window_get_vsync_mode(&self) -> VSyncMode
pub fn window_get_vsync_mode_ex(&self) -> ExWindowGetVSyncMode<'_>
pub fn window_is_maximize_allowed(&self) -> bool
pub fn window_is_maximize_allowed_ex(&self) -> ExWindowIsMaximizeAllowed<'_>
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: GString)
pub fn virtual_keyboard_show_ex( &mut self, existing_text: GString, ) -> ExVirtualKeyboardShow<'_>
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: Gd<Resource>)
pub fn cursor_set_custom_image_ex( &mut self, cursor: Gd<Resource>, ) -> ExCursorSetCustomImage<'_>
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: GString, description: GString, buttons: PackedStringArray, callback: Callable, ) -> Error
pub fn dialog_input_text( &mut self, title: GString, description: GString, existing_text: GString, callback: Callable, ) -> Error
pub fn file_dialog_show( &mut self, title: GString, current_directory: GString, filename: GString, show_hidden: bool, mode: FileDialogMode, filters: PackedStringArray, callback: Callable, ) -> Error
pub fn file_dialog_with_options_show( &mut self, title: GString, current_directory: GString, root: GString, filename: 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: GString)
pub fn set_icon(&mut self, image: Gd<Image>)
pub fn create_status_indicator( &mut self, icon: Gd<Texture2D>, tooltip: GString, callback: Callable, ) -> i32
pub fn status_indicator_set_icon(&mut self, id: i32, icon: Gd<Texture2D>)
pub fn status_indicator_set_tooltip(&mut self, id: i32, tooltip: GString)
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: GString)
pub fn is_window_transparency_available(&self) -> bool
pub fn register_additional_output(&mut self, object: Gd<Object>)
pub fn unregister_additional_output(&mut self, object: Gd<Object>)
pub fn has_additional_outputs(&self) -> bool
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
Methods from Deref<Target = Object>§
pub fn get_class(&self) -> GString
pub fn is_class(&self, class: GString) -> bool
pub fn set(&mut self, property: StringName, value: Variant)
pub fn get(&self, property: StringName) -> Variant
pub fn set_indexed(&mut self, property_path: NodePath, value: Variant)
pub fn get_indexed(&self, property_path: 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: StringName) -> bool
pub fn property_get_revert(&self, property: StringName) -> Variant
pub fn set_script(&mut self, script: Variant)
pub fn get_script(&self) -> Variant
pub fn set_meta(&mut self, name: StringName, value: Variant)
pub fn remove_meta(&mut self, name: StringName)
pub fn get_meta(&self, name: StringName) -> Variant
pub fn get_meta_ex(&self, name: StringName) -> ExGetMeta<'_>
pub fn has_meta(&self, name: StringName) -> bool
pub fn get_meta_list(&self) -> Array<StringName>
pub fn add_user_signal(&mut self, signal: GString)
pub fn add_user_signal_ex(&mut self, signal: GString) -> ExAddUserSignal<'_>
pub fn has_user_signal(&self, signal: StringName) -> bool
pub fn remove_user_signal(&mut self, signal: StringName)
pub fn emit_signal(&mut self, signal: StringName, varargs: &[Variant]) -> Error
pub fn emit_signal(&mut self, signal: 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: StringName,
varargs: &[Variant],
) -> Result<Error, CallError>
pub fn try_emit_signal( &mut self, signal: 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: StringName, varargs: &[Variant]) -> Variant
pub fn call(&mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Variant
pub fn call_deferred( &mut self, method: 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: StringName,
varargs: &[Variant],
) -> Result<Variant, CallError>
pub fn try_call_deferred( &mut self, method: 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: StringName, value: Variant)
pub fn callv(&mut self, method: StringName, arg_array: OutArray) -> Variant
pub fn has_method(&self, method: StringName) -> bool
pub fn get_method_argument_count(&self, method: StringName) -> i32
pub fn has_signal(&self, signal: StringName) -> bool
pub fn get_signal_list(&self) -> Array<Dictionary>
pub fn get_signal_connection_list( &self, signal: StringName, ) -> Array<Dictionary>
pub fn get_incoming_connections(&self) -> Array<Dictionary>
pub fn connect(&mut self, signal: StringName, callable: Callable) -> Error
pub fn connect_ex( &mut self, signal: StringName, callable: Callable, ) -> ExConnect<'_>
pub fn disconnect(&mut self, signal: StringName, callable: Callable)
pub fn is_connected(&self, signal: 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: StringName) -> GString
pub fn tr_ex(&self, message: StringName) -> ExTr<'_>
pub fn tr_n( &self, message: StringName, plural_message: StringName, n: i32, ) -> GString
pub fn tr_n_ex( &self, message: StringName, plural_message: StringName, n: i32, ) -> ExTrN<'_>
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.