CursorShape
DisplayServer.swift:211enum CursorShapeenum CursorShapeimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class DisplayServerA server interface for low-level window management.
case arrowArrow cursor shape. This is the default when not pointing anything that overrides the mouse cursor, such as a LineEdit or TextEdit.
case ibeamI-beam cursor shape. This is used by default when hovering a control that accepts text input, such as LineEdit or TextEdit.
case pointingHandPointing hand cursor shape. This is used by default when hovering a LinkButton or a URL tag in a RichTextLabel.
case crossCrosshair cursor. This is intended to be displayed when the user needs precise aim over an element, such as a rectangle selection tool or a color picker.
case waitWait cursor. On most cursor themes, this displays a spinning icon besides the arrow. Intended to be used for non-blocking operations (when the user can do something else at the moment). See also .cursorBusy.
case busyWait cursor. On most cursor themes, this replaces the arrow with a spinning icon. Intended to be used for blocking operations (when the user can’t do anything else at the moment). See also .cursorWait.
case dragDragging hand cursor. This is displayed during drag-and-drop operations. See also .cursorCanDrop.
case canDrop“Can drop” cursor. This is displayed during drag-and-drop operations if hovering over a Control that can accept the drag-and-drop event. On most cursor themes, this displays a dragging hand with an arrow symbol besides it. See also .cursorDrag.
case forbiddenForbidden cursor. This is displayed during drag-and-drop operations if the hovered Control can’t accept the drag-and-drop event.
case vsizeVertical resize cursor. Intended to be displayed when the hovered Control can be vertically resized using the mouse. See also .cursorVsplit.
case hsizeHorizontal resize cursor. Intended to be displayed when the hovered Control can be horizontally resized using the mouse. See also .cursorHsplit.
case bdiagsizeSecondary diagonal resize cursor (top-right/bottom-left). Intended to be displayed when the hovered Control can be resized on both axes at once using the mouse.
case fdiagsizeMain diagonal resize cursor (top-left/bottom-right). Intended to be displayed when the hovered Control can be resized on both axes at once using the mouse.
case moveMove cursor. Intended to be displayed when the hovered Control can be moved using the mouse.
case vsplitVertical split cursor. This is displayed when hovering a Control with splits that can be vertically resized using the mouse, such as VSplitContainer. On some cursor themes, this cursor may have the same appearance as .cursorVsize.
case hsplitHorizontal split cursor. This is displayed when hovering a Control with splits that can be horizontally resized using the mouse, such as HSplitContainer. On some cursor themes, this cursor may have the same appearance as .cursorHsize.
case helpHelp cursor. On most cursor themes, this displays a question mark icon instead of the mouse cursor. Intended to be used when the user has requested help on the next element that will be clicked.
case maxRepresents the size of the CursorShape enum.
static let invalidIndicatorId: IntThe ID that refers to a nonexistent application status indicator.
static let invalidWindowId: IntThe ID that refers to a nonexistent window. This is returned by some DisplayServer methods if no window matches the requested result.
static let mainWindowId: IntThe ID of the main window spawned by the engine, which can be passed to methods expecting a window_id.
static let screenOfMainWindow: IntRepresents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
static let screenPrimary: IntRepresents the primary screen.
static let screenWithKeyboardFocus: IntRepresents the screen containing the window with the keyboard focus.
static let screenWithMouseFocus: IntRepresents the screen containing the mouse pointer.
static var shared: DisplayServerThe shared instance of this class
static func clipboardGet() -> String Returns the user’s clipboard as a string if possible.
static func clipboardGetImage() -> Image? Returns the user’s clipboard as an image if possible.
static func clipboardGetPrimary() -> String Returns the user’s primary clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
static func clipboardHas() -> Bool Returns true if there is a text content on the user’s clipboard.
static func clipboardHasImage() -> Bool Returns true if there is an image content on the user’s clipboard.
static func clipboardSet(clipboard: String) Sets the user’s clipboard content to the given string.
static func clipboardSetPrimary(clipboardPrimary: String) Sets the user’s primary clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing [kbd]Ctrl + C[/kbd]. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
static func createStatusIndicator(icon: Texture2D?, tooltip: String, callback: Callable) -> Int32 Creates a new application status indicator with the specified icon, tooltip, and activation callback.
static func cursorGetShape() -> DisplayServer.CursorShape Returns the default mouse cursor shape set by cursorSetShape(_:).
static func cursorSetCustomImage(cursor: Resource?, shape: DisplayServer.CursorShape = .arrow, hotspot: Vector2 = Vector2 (x: 0, y: 0)) Sets a custom mouse cursor image for the given shape. This means the user’s operating system and mouse cursor theme will no longer influence the mouse cursor’s appearance.
static func cursorSetShape(_ shape: DisplayServer.CursorShape) Sets the default mouse cursor shape. The cursor’s appearance will vary depending on the user’s operating system and mouse cursor theme. See also cursorGetShape and cursorSetCustomImage(cursor:shape:hotspot:).
static func deleteStatusIndicator(id: Int32) Removes the application status indicator.
static func dialogInputText(title: String, description: String, existingText: String, callback: Callable) -> GodotError Shows a text input dialog which uses the operating system’s native look-and-feel. callback should accept a single String parameter which contains the text field’s contents.
static func dialogShow(title: String, description: String, buttons: PackedStringArray, callback: Callable) -> GodotError Shows a text dialog which uses the operating system’s native look-and-feel. callback should accept a single integer parameter which corresponds to the index of the pressed button.
static func enableForStealingFocus(processId: Int) Allows the processId PID to steal focus from this window. In other words, this disables the operating system’s focus stealing protection for the specified PID.
static func fileDialogShow(title: String, currentDirectory: String, filename: String, showHidden: Bool, mode: DisplayServer.FileDialogMode, filters: PackedStringArray, callback: Callable) -> GodotError Displays OS native dialog for selecting files or directories in the file system.
static func fileDialogWithOptionsShow(title: String, currentDirectory: String, root: String, filename: String, showHidden: Bool, mode: DisplayServer.FileDialogMode, filters: PackedStringArray, options: VariantCollection<GDictionary>, callback: Callable) -> GodotError Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
static func forceProcessAndDropEvents() Forces window manager processing while ignoring all InputEvents. See also processEvents.
static func getAccentColor() -> Color Returns OS theme accent color. Returns Color(0, 0, 0, 0), if accent color is unknown.
static func getBaseColor() -> Color Returns the OS theme base color (default control background). Returns Color(0, 0, 0, 0) if the base color is unknown.
static func getDisplayCutouts() -> VariantCollection<Rect2> Returns an GArray of Rect2, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also getDisplaySafeArea.
static func getDisplaySafeArea() -> Rect2i Returns the unobscured area of the display where interactive controls should be rendered. See also getDisplayCutouts.
static func getKeyboardFocusScreen() -> Int32 Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there’s no focused window.
static func getName() -> String Returns the name of the DisplayServer currently in use. Most operating systems only have a single DisplayServer, but Linux has access to more than one DisplayServer (currently X11 and Wayland).
static func getPrimaryScreen() -> Int32 Returns index of the primary screen.
static func getScreenCount() -> Int32 Returns the number of displays available.
static func getScreenFromRect(_ rect: Rect2) -> Int32 Returns index of the screen which contains specified rectangle.
static func getSwapCancelOk() -> Bool Returns true if positions of OK and Cancel buttons are swapped in dialogs. This is enabled by default on Windows to follow interface conventions, and be toggled by changing ProjectSettings/gui/common/swapCancelOk.
static func getWindowAtScreenPosition(_ position: Vector2i) -> Int32 Returns the ID of the window at the specified screen position (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
static func getWindowList() -> PackedInt32Array Returns the list of Godot window IDs belonging to this process.
static func globalMenuAddCheckItem(menuRoot: String, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new checkable item with text label to the global menu with ID menuRoot.
static func globalMenuAddIconCheckItem(menuRoot: String, icon: Texture2D?, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new checkable item with text label and icon icon to the global menu with ID menuRoot.
static func globalMenuAddIconItem(menuRoot: String, icon: Texture2D?, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new item with text label and icon icon to the global menu with ID menuRoot.
static func globalMenuAddIconRadioCheckItem(menuRoot: String, icon: Texture2D?, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new radio-checkable item with text label and icon icon to the global menu with ID menuRoot.
static func globalMenuAddItem(menuRoot: String, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new item with text label to the global menu with ID menuRoot.
static func globalMenuAddMultistateItem(menuRoot: String, label: String, maxStates: Int32, defaultState: Int32, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new item with text label to the global menu with ID menuRoot.
static func globalMenuAddRadioCheckItem(menuRoot: String, label: String, callback: Callable = Callable(), keyCallback: Callable = Callable(), tag: Variant, accelerator: Key = .none, index: Int32 = -1) -> Int32 Adds a new radio-checkable item with text label to the global menu with ID menuRoot.
static func globalMenuAddSeparator(menuRoot: String, index: Int32 = -1) -> Int32 Adds a separator between items to the global menu with ID menuRoot. Separators also occupy an index.
static func globalMenuAddSubmenuItem(menuRoot: String, label: String, submenu: String, index: Int32 = -1) -> Int32 Adds an item that will act as a submenu of the global menu menuRoot. The submenu argument is the ID of the global menu root that will be shown when the item is clicked.
static func globalMenuClear(menuRoot: String) Removes all items from the global menu with ID menuRoot.
static func globalMenuGetItemAccelerator(menuRoot: String, idx: Int32) -> Key Returns the accelerator of the item at index idx. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
static func globalMenuGetItemCallback(menuRoot: String, idx: Int32) -> Callable Returns the callback of the item at index idx.
static func globalMenuGetItemCount(menuRoot: String) -> Int32 Returns number of items in the global menu with ID menuRoot.
static func globalMenuGetItemIcon(menuRoot: String, idx: Int32) -> Texture2D? Returns the icon of the item at index idx.
static func globalMenuGetItemIndentationLevel(menuRoot: String, idx: Int32) -> Int32 Returns the horizontal offset of the item at the given idx.
static func globalMenuGetItemIndexFromTag(menuRoot: String, tag: Variant) -> Int32 Returns the index of the item with the specified tag. Indices are automatically assigned to each item by the engine, and cannot be set manually.
static func globalMenuGetItemIndexFromText(menuRoot: String, text: String) -> Int32 Returns the index of the item with the specified text. Indices are automatically assigned to each item by the engine, and cannot be set manually.
static func globalMenuGetItemKeyCallback(menuRoot: String, idx: Int32) -> Callable Returns the callback of the item accelerator at index idx.
static func globalMenuGetItemMaxStates(menuRoot: String, idx: Int32) -> Int32 Returns number of states of a multistate item. See globalMenuAddMultistateItem(menuRoot:label:maxStates:defaultState:callback:keyCallback:tag:accelerator:index:) for details.
static func globalMenuGetItemState(menuRoot: String, idx: Int32) -> Int32 Returns the state of a multistate item. See globalMenuAddMultistateItem(menuRoot:label:maxStates:defaultState:callback:keyCallback:tag:accelerator:index:) for details.
static func globalMenuGetItemSubmenu(menuRoot: String, idx: Int32) -> String Returns the submenu ID of the item at index idx. See globalMenuAddSubmenuItem(menuRoot:label:submenu:index:) for more info on how to add a submenu.
static func globalMenuGetItemTag(menuRoot: String, idx: Int32) -> Variant Returns the metadata of the specified item, which might be of any type. You can set it with globalMenuSetItemTag(menuRoot:idx:tag:), which provides a simple way of assigning context data to items.
static func globalMenuGetItemText(menuRoot: String, idx: Int32) -> String Returns the text of the item at index idx.
static func globalMenuGetItemTooltip(menuRoot: String, idx: Int32) -> String Returns the tooltip associated with the specified index idx.
static func globalMenuGetSystemMenuRoots() -> GDictionary Returns Dictionary of supported system menu IDs and names.
static func globalMenuIsItemCheckable(menuRoot: String, idx: Int32) -> Bool Returns true if the item at index idx is checkable in some way, i.e. if it has a checkbox or radio button.
static func globalMenuIsItemChecked(menuRoot: String, idx: Int32) -> Bool Returns true if the item at index idx is checked.
static func globalMenuIsItemDisabled(menuRoot: String, idx: Int32) -> Bool Returns true if the item at index idx is disabled. When it is disabled it can’t be selected, or its action invoked.
static func globalMenuIsItemHidden(menuRoot: String, idx: Int32) -> Bool Returns true if the item at index idx is hidden.
static func globalMenuIsItemRadioCheckable(menuRoot: String, idx: Int32) -> Bool Returns true if the item at index idx has radio button-style checkability.
static func globalMenuRemoveItem(menuRoot: String, idx: Int32) Removes the item at index idx from the global menu menuRoot.
static func globalMenuSetItemAccelerator(menuRoot: String, idx: Int32, keycode: Key) Sets the accelerator of the item at index idx. keycode can be a single Key, or a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A ([kbd]Ctrl + A[/kbd]).
static func globalMenuSetItemCallback(menuRoot: String, idx: Int32, callback: Callable) Sets the callback of the item at index idx. Callback is emitted when an item is pressed.
static func globalMenuSetItemCheckable(menuRoot: String, idx: Int32, checkable: Bool) Sets whether the item at index idx has a checkbox. If false, sets the type of the item to plain text.
static func globalMenuSetItemChecked(menuRoot: String, idx: Int32, checked: Bool) Sets the checkstate status of the item at index idx.
static func globalMenuSetItemDisabled(menuRoot: String, idx: Int32, disabled: Bool) Enables/disables the item at index idx. When it is disabled, it can’t be selected and its action can’t be invoked.
static func globalMenuSetItemHidden(menuRoot: String, idx: Int32, hidden: Bool) Hides/shows the item at index idx. When it is hidden, an item does not appear in a menu and its action cannot be invoked.
static func globalMenuSetItemHoverCallbacks(menuRoot: String, idx: Int32, callback: Callable) Sets the callback of the item at index idx. The callback is emitted when an item is hovered.
static func globalMenuSetItemIcon(menuRoot: String, idx: Int32, icon: Texture2D?) Replaces the Texture2D icon of the specified idx.
static func globalMenuSetItemIndentationLevel(menuRoot: String, idx: Int32, level: Int32) Sets the horizontal offset of the item at the given idx.
static func globalMenuSetItemKeyCallback(menuRoot: String, idx: Int32, keyCallback: Callable) Sets the callback of the item at index idx. Callback is emitted when its accelerator is activated.
static func globalMenuSetItemMaxStates(menuRoot: String, idx: Int32, maxStates: Int32) Sets number of state of a multistate item. See globalMenuAddMultistateItem(menuRoot:label:maxStates:defaultState:callback:keyCallback:tag:accelerator:index:) for details.
static func globalMenuSetItemRadioCheckable(menuRoot: String, idx: Int32, checkable: Bool) Sets the type of the item at the specified index idx to radio button. If false, sets the type of the item to plain text.
static func globalMenuSetItemState(menuRoot: String, idx: Int32, state: Int32) Sets the state of a multistate item. See globalMenuAddMultistateItem(menuRoot:label:maxStates:defaultState:callback:keyCallback:tag:accelerator:index:) for details.
static func globalMenuSetItemSubmenu(menuRoot: String, idx: Int32, submenu: String) Sets the submenu of the item at index idx. The submenu is the ID of a global menu root that would be shown when the item is clicked.
static func globalMenuSetItemTag(menuRoot: String, idx: Int32, tag: Variant) Sets the metadata of an item, which may be of any type. You can later get it with globalMenuGetItemTag(menuRoot:idx:), which provides a simple way of assigning context data to items.
static func globalMenuSetItemText(menuRoot: String, idx: Int32, text: String) Sets the text of the item at index idx.
static func globalMenuSetItemTooltip(menuRoot: String, idx: Int32, tooltip: String) Sets the String tooltip of the item at the specified index idx.
static func globalMenuSetPopupCallbacks(menuRoot: String, openCallback: Callable, closeCallback: Callable) Registers callables to emit when the menu is respectively about to show or closed. Callback methods should have zero arguments.
static func hasFeature(_ feature: DisplayServer.Feature) -> Bool Returns true if the specified feature is supported by the current DisplayServer, false otherwise.
static func helpSetSearchCallbacks(searchCallback: Callable, actionCallback: Callable) Sets native help system search callbacks.
static func imeGetSelection() -> Vector2i Returns the text selection in the Input Method Editor composition string, with the Vector2i’s x component being the caret position and y being the length of the selection.
static func imeGetText() -> String Returns the composition string contained within the Input Method Editor window.
static func isDarkMode() -> Bool Returns true if OS is using dark mode.
static func isDarkModeSupported() -> Bool Returns true if OS supports dark mode.
static func isTouchscreenAvailable() -> Bool Returns true if touch events are available (Android or iOS), the capability is detected on the Web platform or if ProjectSettings/inputDevices/pointing/emulateTouchFromMouse is true.
static func isWindowTransparencyAvailable() -> Bool Returns true if the window background can be made transparent. This method returns false if ProjectSettings/display/window/perPixelTransparency/allowed is set to false, or if transparency is not supported by the renderer or OS compositor.
static func keyboardGetCurrentLayout() -> Int32 Returns active keyboard layout index.
static func keyboardGetKeycodeFromPhysical(keycode: Key) -> Key Converts a physical (US QWERTY) keycode to one in the active keyboard layout.
static func keyboardGetLabelFromPhysical(keycode: Key) -> Key Converts a physical (US QWERTY) keycode to localized label printed on the key in the active keyboard layout.
static func keyboardGetLayoutCount() -> Int32 Returns the number of keyboard layouts.
static func keyboardGetLayoutLanguage(index: Int32) -> String Returns the ISO-639/BCP-47 language code of the keyboard layout at position index.
static func keyboardGetLayoutName(index: Int32) -> String Returns the localized name of the keyboard layout at position index.
static func keyboardSetCurrentLayout(index: Int32) Sets the active keyboard layout.
static func mouseGetButtonState() -> MouseButtonMask Returns the current state of mouse buttons (whether each button is pressed) as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to getMouseButtonMask.
static func mouseGetMode() -> DisplayServer.MouseMode Returns the current mouse mode. See also mouseSetMode(mouseMode:).
static func mouseGetPosition() -> Vector2i Returns the mouse cursor’s current position in screen coordinates.
static func mouseSetMode(mouseMode: DisplayServer.MouseMode) Sets the current mouse mode. See also mouseGetMode.
static func processEvents() Perform window manager processing, including input flushing. See also forceProcessAndDropEvents, flushBufferedEvents and useAccumulatedInput.
static func screenGetDpi(screen: Int32 = -1) -> Int32 Returns the dots per inch density of the specified screen. If screen is screenOfMainWindow (the default value), a screen with the main window will be used.
static func screenGetImage(screen: Int32 = -1) -> Image? Returns screenshot of the screen.
static func screenGetMaxScale() -> Double Returns the greatest scale factor of all screens.
static func screenGetOrientation(screen: Int32 = -1) -> DisplayServer.ScreenOrientation Returns the screen’s current orientation. See also screenSetOrientation(_:screen:).
static func screenGetPixel(position: Vector2i) -> Color Returns color of the display pixel at the position.
static func screenGetPosition(screen: Int32 = -1) -> Vector2i Returns the screen’s top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
static func screenGetRefreshRate(screen: Int32 = -1) -> Double Returns the current refresh rate of the specified screen. If screen is screenOfMainWindow (the default value), a screen with the main window will be used.
static func screenGetScale(screen: Int32 = -1) -> Double Returns the scale factor of the specified screen by index.
static func screenGetSize(screen: Int32 = -1) -> Vector2i Returns the screen’s size in pixels. See also screenGetPosition(screen:) and screenGetUsableRect(screen:).
static func screenGetUsableRect(screen: Int32 = -1) -> Rect2i Returns the portion of the screen that is not obstructed by a status bar in pixels. See also screenGetSize(screen:).
static func screenIsKeptOn() -> Bool Returns true if the screen should never be turned off by the operating system’s power-saving measures. See also screenSetKeepOn(enable:).
static func screenSetKeepOn(enable: Bool) Sets whether the screen should never be turned off by the operating system’s power-saving measures. See also screenIsKeptOn.
static func screenSetOrientation(_ orientation: DisplayServer.ScreenOrientation, screen: Int32 = -1) Sets the screen’s orientation. See also screenGetOrientation(screen:).
static func setIcon(image: Image?) Sets the window icon (usually displayed in the top-left corner) with an Image. To use icons in the operating system’s native format, use setNativeIcon(filename:) instead.
static func setNativeIcon(filename: String) Sets the window icon (usually displayed in the top-left corner) in the operating system’s native format. The file at filename must be in .ico format on Windows or .icns on macOS. By using specially crafted .ico or .icns icons, setNativeIcon(filename:) allows specifying different icons depending on the size the icon is displayed at. This size is determined by the operating system and user preferences (including the display scale factor). To use icons in other formats, use setIcon(image:) instead.
static func setSystemThemeChangeCallback(callable: Callable) Sets the callable that should be called when system theme settings are changed. Callback method should have zero arguments.
static func statusIndicatorGetRect(id: Int32) -> Rect2 Returns the rectangle for the given status indicator id in screen coordinates. If the status indicator is not visible, returns an empty Rect2.
static func statusIndicatorSetCallback(id: Int32, callback: Callable) Sets the application status indicator activation callback. callback should take two arguments: integer mouse button index (one of MouseButton values) and Vector2i click position in screen coordinates.
static func statusIndicatorSetIcon(id: Int32, icon: Texture2D?) Sets the application status indicator icon.
static func statusIndicatorSetMenu(id: Int32, menuRid: RID) Sets the application status indicator native popup menu.
static func statusIndicatorSetTooltip(id: Int32, tooltip: String) Sets the application status indicator tooltip.
static func tabletGetCurrentDriver() -> String Returns current active tablet driver name.
static func tabletGetDriverCount() -> Int32 Returns the total number of available tablet drivers.
static func tabletGetDriverName(idx: Int32) -> String Returns the tablet driver name for the given index.
static func tabletSetCurrentDriver(name: String) Set active tablet driver name.
static func ttsGetVoices() -> VariantCollection<GDictionary> Returns an GArray of voice information dictionaries.
static func ttsGetVoicesForLanguage(_ language: String) -> PackedStringArray Returns an PackedStringArray of voice identifiers for the language.
static func ttsIsPaused() -> Bool Returns true if the synthesizer is in a paused state.
static func ttsIsSpeaking() -> Bool Returns true if the synthesizer is generating speech, or have utterance waiting in the queue.
static func ttsPause() Puts the synthesizer into a paused state.
static func ttsResume() Resumes the synthesizer if it was paused.
static func ttsSetUtteranceCallback(event: DisplayServer.TTSUtteranceEvent, callable: Callable) Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
static func ttsSpeak(text: String, voice: String, volume: Int32 = 50, pitch: Double = 1.0, rate: Double = 1.0, utteranceId: Int32 = 0, interrupt: Bool = false) Adds an utterance to the queue. If interrupt is true, the queue is cleared first.
static func ttsStop() Stops synthesis in progress and removes all utterances from the queue.
static func virtualKeyboardGetHeight() -> Int32 Returns the on-screen keyboard’s height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
static func virtualKeyboardHide() Hides the virtual keyboard if it is shown, does nothing otherwise.
static func virtualKeyboardShow(existingText: String, position: Rect2 = Rect2 (x: 0, y: 0, width: 0, height: 0), type: DisplayServer.VirtualKeyboardType = .`default`, maxLength: Int32 = -1, cursorStart: Int32 = -1, cursorEnd: Int32 = -1) Shows the virtual keyboard if the platform has one.
static func warpMouse(position: Vector2i) Sets the mouse cursor position to the given position relative to an origin at the upper left corner of the currently focused game Window Manager window.
static func windowCanDraw(windowId: Int32 = 0) -> Bool Returns true if anything can be drawn in the window specified by windowId, false otherwise. Using the --disable-render-loop command line argument or a headless build will return false.
static func windowGetActivePopup() -> Int32 Returns ID of the active popup window, or invalidWindowId if there is none.
static func windowGetAttachedInstanceId(windowId: Int32 = 0) -> UInt Returns the getInstanceId of the Window the windowId is attached to.
static func windowGetCurrentScreen(windowId: Int32 = 0) -> Int32 Returns the screen the window specified by windowId is currently positioned on. If the screen overlaps multiple displays, the screen where the window’s center is located is returned. See also windowSetCurrentScreen(_:windowId:).
static func windowGetFlag(_ flag: DisplayServer.WindowFlags, windowId: Int32 = 0) -> Bool Returns the current value of the given window’s flag.
static func windowGetMaxSize(windowId: Int32 = 0) -> Vector2i Returns the window’s maximum size (in pixels). See also windowSetMaxSize(_:windowId:).
static func windowGetMinSize(windowId: Int32 = 0) -> Vector2i Returns the window’s minimum size (in pixels). See also windowSetMinSize(_:windowId:).
static func windowGetMode(windowId: Int32 = 0) -> DisplayServer.WindowMode Returns the mode of the given window.
static func windowGetNativeHandle(handleType: DisplayServer.HandleType, windowId: Int32 = 0) -> Int Returns internal structure pointers for use in plugins.
static func windowGetPopupSafeRect(window: Int32) -> Rect2i Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
static func windowGetPosition(windowId: Int32 = 0) -> Vector2i Returns the position of the client area of the given window on the screen.
static func windowGetPositionWithDecorations(windowId: Int32 = 0) -> Vector2i Returns the position of the given window on the screen including the borders drawn by the operating system. See also windowGetPosition(windowId:).
static func windowGetSafeTitleMargins(windowId: Int32 = 0) -> Vector3i Returns left margins (x), right margins (y) and height (z) of the title that are safe to use (contains no buttons or other elements) when .windowFlagExtendToTitle flag is set.
static func windowGetSize(windowId: Int32 = 0) -> Vector2i Returns the size of the window specified by windowId (in pixels), excluding the borders drawn by the operating system. This is also called the “client area”. See also windowGetSizeWithDecorations(windowId:), windowSetSize(_:windowId:) and windowGetPosition(windowId:).
static func windowGetSizeWithDecorations(windowId: Int32 = 0) -> Vector2i Returns the size of the window specified by windowId (in pixels), including the borders drawn by the operating system. See also windowGetSize(windowId:).
static func windowGetTitleSize(title: String, windowId: Int32 = 0) -> Vector2i Returns the estimated window title bar size (including text and window buttons) for the window specified by windowId (in pixels). This method does not change the window title.
static func windowGetVsyncMode(windowId: Int32 = 0) -> DisplayServer.VSyncMode Returns the V-Sync mode of the given window.
static func windowIsFocused(windowId: Int32 = 0) -> Bool Returns true if the window specified by windowId is focused.
static func windowIsMaximizeAllowed(windowId: Int32 = 0) -> Bool Returns true if the given window can be maximized (the maximize button is enabled).
static func windowMaximizeOnTitleDblClick() -> Bool Returns true, if double-click on a window title should maximize it.
static func windowMinimizeOnTitleDblClick() -> Bool Returns true, if double-click on a window title should minimize it.
static func windowMoveToForeground(windowId: Int32 = 0) Moves the window specified by windowId to the foreground, so that it is visible over other windows.
static func windowRequestAttention(windowId: Int32 = 0) Makes the window specified by windowId request attention, which is materialized by the window title and taskbar entry blinking until the window is focused. This usually has no visible effect if the window is currently focused. The exact behavior varies depending on the operating system.
static func windowSetCurrentScreen(_ screen: Int32, windowId: Int32 = 0) Moves the window specified by windowId to the specified screen. See also windowGetCurrentScreen(windowId:).
static func windowSetDropFilesCallback(_ callback: Callable, windowId: Int32 = 0) Sets the callback that should be called when files are dropped from the operating system’s file manager to the window specified by windowId. callback should take one PackedStringArray argument, which is the list of dropped files.
static func windowSetExclusive(windowId: Int32, exclusive: Bool) If set to true, this window will always stay on top of its parent window, parent window will ignore input while this window is opened.
static func windowSetFlag(_ flag: DisplayServer.WindowFlags, enabled: Bool, windowId: Int32 = 0) Enables or disables the given window’s given flag. See WindowFlags for possible values and their behavior.
static func windowSetImeActive(_ active: Bool, windowId: Int32 = 0) Sets whether Input Method Editor should be enabled for the window specified by windowId. See also windowSetImePosition(_:windowId:).
static func windowSetImePosition(_ position: Vector2i, windowId: Int32 = 0) Sets the position of the Input Method Editor popup for the specified windowId. Only effective if windowSetImeActive(_:windowId:) was set to true for the specified windowId.
static func windowSetInputEventCallback(_ callback: Callable, windowId: Int32 = 0) Sets the callback that should be called when any InputEvent is sent to the window specified by windowId.
static func windowSetInputTextCallback(_ callback: Callable, windowId: Int32 = 0) Sets the callback that should be called when text is entered using the virtual keyboard to the window specified by windowId.
static func windowSetMaxSize(_ maxSize: Vector2i, windowId: Int32 = 0) Sets the maximum size of the window specified by windowId in pixels. Normally, the user will not be able to drag the window to make it larger than the specified size. See also windowGetMaxSize(windowId:).
static func windowSetMinSize(_ minSize: Vector2i, windowId: Int32 = 0) Sets the minimum size for the given window to minSize in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also windowGetMinSize(windowId:).
static func windowSetMode(_ mode: DisplayServer.WindowMode, windowId: Int32 = 0) Sets window mode for the given window to mode. See WindowMode for possible values and how each mode behaves.
static func windowSetMousePassthrough(region: PackedVector2Array, windowId: Int32 = 0) Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
static func windowSetPopupSafeRect(window: Int32, rect: Rect2i) Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup.
static func windowSetPosition(_ position: Vector2i, windowId: Int32 = 0) Sets the position of the given window to position. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
static func windowSetRectChangedCallback(_ callback: Callable, windowId: Int32 = 0) Sets the callback that will be called when the window specified by windowId is moved or resized.
static func windowSetSize(_ size: Vector2i, windowId: Int32 = 0) Sets the size of the given window to size (in pixels). See also windowGetSize(windowId:) and windowGetPosition(windowId:).
static func windowSetTitle(_ title: String, windowId: Int32 = 0) Sets the title of the given window to title.
static func windowSetTransient(windowId: Int32, parentWindowId: Int32) Sets window transient parent. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can’t enter full-screen mode.
static func windowSetVsyncMode(_ vsyncMode: DisplayServer.VSyncMode, windowId: Int32 = 0) Sets the V-Sync mode of the given window. See also ProjectSettings/display/window/vsync/vsyncMode.
static func windowSetWindowButtonsOffset(_ offset: Vector2i, windowId: Int32 = 0) When .windowFlagExtendToTitle flag is set, set offset to the center of the first titlebar button.
static func windowSetWindowEventCallback(_ callback: Callable, windowId: Int32 = 0) Sets the callback that will be called when an event occurs in the window specified by windowId.
override class var godotClassName: StringName { get }enum Featureenum FileDialogModeenum HandleTypeenum MouseModeenum ScreenOrientationenum TTSUtteranceEventenum VSyncModeenum VirtualKeyboardTypeenum WindowEventenum WindowFlagsenum WindowModeprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)