DisplayServer
Hereda: Object
Una interfaz de servidor para la gestión de ventanas de bajo nivel.
Descripción
DisplayServer handles everything related to window management. It is separated from OS as a single operating system may support multiple display servers.
Headless mode: Starting the engine with the --headless command line argument disables all rendering and window management functions. Most functions from DisplayServer will return dummy values in this case.
Métodos
Enumeraciones
enum Feature: 🔗
Obsoleto: Use NativeMenu or PopupMenu instead.
Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. macOS
Feature FEATURE_SUBWINDOWS = 1
Display server supports multiple windows that can be moved outside of the main window. Windows, macOS, Linux (X11)
Feature FEATURE_TOUCHSCREEN = 2
Display server supports touchscreen input. Windows, Linux (X11), Android, iOS, Web
Feature FEATURE_MOUSE = 3
Display server supports mouse input. Windows, macOS, Linux (X11/Wayland), Android, Web
Feature FEATURE_MOUSE_WARP = 4
Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. Windows, macOS, Linux (X11/Wayland)
Feature FEATURE_CLIPBOARD = 5
Display server supports setting and getting clipboard data. See also FEATURE_CLIPBOARD_PRIMARY. Windows, macOS, Linux (X11/Wayland), Android, iOS, Web
Feature FEATURE_VIRTUAL_KEYBOARD = 6
Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. Android, iOS, Web
Feature FEATURE_CURSOR_SHAPE = 7
Display server supports setting the mouse cursor shape to be different from the default. Windows, macOS, Linux (X11/Wayland), Android, Web
Feature FEATURE_CUSTOM_CURSOR_SHAPE = 8
Display server supports setting the mouse cursor shape to a custom image. Windows, macOS, Linux (X11/Wayland), Web
Feature FEATURE_NATIVE_DIALOG = 9
Display server supports spawning text dialogs using the operating system's native look-and-feel. See dialog_show(). Windows, macOS
Feature FEATURE_IME = 10
Display server supports Input Method Editor, which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. Windows, macOS, Linux (X11)
Feature FEATURE_WINDOW_TRANSPARENCY = 11
Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. Windows, macOS, Linux (X11/Wayland), Android
Feature FEATURE_HIDPI = 12
Display server supports querying the operating system's display scale factor. This allows automatically detecting the hiDPI display reliably, instead of guessing based on the screen resolution and the display's reported DPI (which might be unreliable due to broken monitor EDID). Windows, Linux (Wayland), macOS
Feature FEATURE_ICON = 13
Display server supports changing the window icon (usually displayed in the top-left corner). Windows, macOS, Linux (X11)
Feature FEATURE_NATIVE_ICON = 14
Display server supports changing the window icon (usually displayed in the top-left corner). Windows, macOS
Feature FEATURE_ORIENTATION = 15
Display server supports changing the screen orientation. Android, iOS
Feature FEATURE_SWAP_BUFFERS = 16
Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). Windows, macOS, Linux (X11/Wayland)
Feature FEATURE_CLIPBOARD_PRIMARY = 18
Display server supports Primary clipboard can be used. This is a different clipboard from FEATURE_CLIPBOARD. Linux (X11/Wayland)
Feature FEATURE_TEXT_TO_SPEECH = 19
Display server supports text-to-speech. See tts_* methods. Windows, macOS, Linux (X11/Wayland), Android, iOS, Web
Feature FEATURE_EXTEND_TO_TITLE = 20
Display server supports expanding window content to the title. See WINDOW_FLAG_EXTEND_TO_TITLE. macOS
Feature FEATURE_SCREEN_CAPTURE = 21
Display server supports reading screen pixels. See screen_get_pixel().
Feature FEATURE_STATUS_INDICATOR = 22
Display server supports application status indicators.
Feature FEATURE_NATIVE_HELP = 23
El servidor de visualización admite devoluciones de llamada de búsqueda del sistema de ayuda nativo. Véase help_set_search_callbacks().
Feature FEATURE_NATIVE_DIALOG_INPUT = 24
Display server supports spawning text input dialogs using the operating system's native look-and-feel. See dialog_input_text(). Windows, macOS
Feature FEATURE_NATIVE_DIALOG_FILE = 25
Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See file_dialog_show(). Windows, macOS, Linux (X11/Wayland), Android
Feature FEATURE_NATIVE_DIALOG_FILE_EXTRA = 26
The display server supports all features of FEATURE_NATIVE_DIALOG_FILE, with the added functionality of Options and native dialog file access to res:// and user:// paths. See file_dialog_show() and file_dialog_with_options_show(). Windows, macOS, Linux (X11/Wayland)
Feature FEATURE_WINDOW_DRAG = 27
El servidor de visualización admite el inicio de operaciones de arrastre y redimensionamiento de ventanas bajo demanda. Véase window_start_drag() y window_start_resize().
Feature FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE = 28
El servidor de visualización admite la bandera de ventana WINDOW_FLAG_EXCLUDE_FROM_CAPTURE. Windows, macOS
Feature FEATURE_WINDOW_EMBEDDING = 29
El servidor de visualización permite incrustar una ventana de otro proceso. Windows, Linux (X11), macOS
Feature FEATURE_NATIVE_DIALOG_FILE_MIME = 30
El diálogo nativo de selección de archivos admite tipos MIME como filtros.
Feature FEATURE_EMOJI_AND_SYMBOL_PICKER = 31
El servidor de visualización es compatible con el selector de emojis y símbolos del sistema. Windows, macOS
Feature FEATURE_NATIVE_COLOR_PICKER = 32
El servidor de visualización es compatible con el selector de color nativo. Linux (X11/Wayland)
Feature FEATURE_SELF_FITTING_WINDOWS = 33
El servidor de visualización ajusta automáticamente las ventanas emergentes de acuerdo con los límites de la pantalla. Los nodos de la ventana no deben intentar hacerlo ellos mismos.
Feature FEATURE_ACCESSIBILITY_SCREEN_READER = 34
El servidor de visualización admite la interacción con el lector de pantalla o la pantalla Braille. Linux (X11/Wayland), macOS, Windows
enum AccessibilityRole: 🔗
AccessibilityRole ROLE_UNKNOWN = 0
Rol desconocido o personalizado.
AccessibilityRole ROLE_DEFAULT_BUTTON = 1
Elemento de botón de diálogo por defecto.
AccessibilityRole ROLE_AUDIO = 2
Elemento de reproductor de audio.
AccessibilityRole ROLE_VIDEO = 3
Elemento de reproductor de vídeo.
AccessibilityRole ROLE_STATIC_TEXT = 4
Etiqueta de texto no editable.
AccessibilityRole ROLE_CONTAINER = 5
Elemento contenedor. Los elementos con este rol se utilizan para la estructura interna y son ignorados por los lectores de pantalla.
AccessibilityRole ROLE_PANEL = 6
Elemento contenedor de panel.
AccessibilityRole ROLE_BUTTON = 7
Elemento de botón.
AccessibilityRole ROLE_LINK = 8
Elemento de enlace.
AccessibilityRole ROLE_CHECK_BOX = 9
Elemento de casilla de verificación.
AccessibilityRole ROLE_RADIO_BUTTON = 10
Elemento de botón de opción.
AccessibilityRole ROLE_CHECK_BUTTON = 11
Elemento de botón de verificación.
AccessibilityRole ROLE_SCROLL_BAR = 12
Elemento de barra de desplazamiento.
AccessibilityRole ROLE_SCROLL_VIEW = 13
Elemento contenedor de desplazamiento.
AccessibilityRole ROLE_SPLITTER = 14
Elemento de manejador de divisor de contenedor.
AccessibilityRole ROLE_SLIDER = 15
Elemento deslizador.
AccessibilityRole ROLE_SPIN_BUTTON = 16
Elemento de cuadro de giro.
AccessibilityRole ROLE_PROGRESS_INDICATOR = 17
Elemento indicador de progreso.
AccessibilityRole ROLE_TEXT_FIELD = 18
Elemento de campo de texto editable.
AccessibilityRole ROLE_MULTILINE_TEXT_FIELD = 19
Elemento de campo de texto editable multilínea.
AccessibilityRole ROLE_COLOR_PICKER = 20
Elemento selector de color.
AccessibilityRole ROLE_TABLE = 21
Elemento de tabla.
AccessibilityRole ROLE_CELL = 22
Elemento de celda de tabla/árbol.
AccessibilityRole ROLE_ROW = 23
Elemento de fila de tabla/árbol.
AccessibilityRole ROLE_ROW_GROUP = 24
Elemento de grupo de filas de tabla/árbol.
AccessibilityRole ROLE_ROW_HEADER = 25
Elemento de encabezado de fila de tabla/árbol.
AccessibilityRole ROLE_COLUMN_HEADER = 26
Elemento de encabezado de columna de tabla/árbol.
AccessibilityRole ROLE_TREE = 27
Elemento de vista de árbol.
AccessibilityRole ROLE_TREE_ITEM = 28
Elemento de ítem de vista de árbol.
AccessibilityRole ROLE_LIST = 29
Elemento de lista.
AccessibilityRole ROLE_LIST_ITEM = 30
Elemento de ítem de lista.
AccessibilityRole ROLE_LIST_BOX = 31
Elemento de vista de lista.
AccessibilityRole ROLE_LIST_BOX_OPTION = 32
Elemento de ítem de vista de lista.
AccessibilityRole ROLE_TAB_BAR = 33
Elemento de barra de pestañas.
AccessibilityRole ROLE_TAB = 34
Elemento de ítem de barra de pestañas.
AccessibilityRole ROLE_TAB_PANEL = 35
Elemento del panel de pestañas.
Elemento de barra de menú.
Elemento de menú emergente.
Elemento de menú emergente.
Elemento de ítem de botón de verificación de menú emergente.
Elemento de ítem de botón de opción de menú emergente.
AccessibilityRole ROLE_IMAGE = 41
Elemento de Imágen.
AccessibilityRole ROLE_WINDOW = 42
Elemento de ventana.
AccessibilityRole ROLE_TITLE_BAR = 43
Elemento de barra de título de ventana incrustado.
AccessibilityRole ROLE_DIALOG = 44
Elemento de ventana de diálogo.
AccessibilityRole ROLE_TOOLTIP = 45
Tooltip element.
enum AccessibilityPopupType: 🔗
Menú de popup.
AccessibilityPopupType POPUP_LIST = 1
Lista de popup.
AccessibilityPopupType POPUP_TREE = 2
Vista de árbol de popup.
AccessibilityPopupType POPUP_DIALOG = 3
Diálogo de popup.
enum AccessibilityFlags: 🔗
El elemento está oculto para las herramientas de accesibilidad.
AccessibilityFlags FLAG_MULTISELECTABLE = 1
El elemento admite la selección de múltiples elementos.
AccessibilityFlags FLAG_REQUIRED = 2
El elemento requiere la entrada del usuario.
AccessibilityFlags FLAG_VISITED = 3
El elemento es un enlace visitado.
AccessibilityFlags FLAG_BUSY = 4
El contenido del elemento no está listo (p. ej., cargando).
AccessibilityFlags FLAG_MODAL = 5
El elemento es una ventana modal.
AccessibilityFlags FLAG_TOUCH_PASSTHROUGH = 6
El elemento permite realizar toques cuando un lector de pantalla está en modo de exploración táctil.
AccessibilityFlags FLAG_READONLY = 7
El elemento es un campo de texto con texto seleccionable pero de solo lectura.
AccessibilityFlags FLAG_DISABLED = 8
El elemento está deshabilitado.
AccessibilityFlags FLAG_CLIPS_CHILDREN = 9
El elemento recorta los hijos.
enum AccessibilityAction: 🔗
AccessibilityAction ACTION_CLICK = 0
Acción de clic único, el argumento de callback no está establecido.
AccessibilityAction ACTION_FOCUS = 1
Acción de enfocar, el argumento de callback no está establecido.
AccessibilityAction ACTION_BLUR = 2
Acción de desenfocar, el argumento de callback no está establecido.
AccessibilityAction ACTION_COLLAPSE = 3
Acción de contraer, el argumento de callback no está establecido.
AccessibilityAction ACTION_EXPAND = 4
Acción de expandir, el argumento de callback no está establecido.
AccessibilityAction ACTION_DECREMENT = 5
Acción de decrementar, el argumento de callback no está establecido.
AccessibilityAction ACTION_INCREMENT = 6
Acción de incrementar, el argumento de callback no está establecido.
AccessibilityAction ACTION_HIDE_TOOLTIP = 7
Acción de ocultar tooltip, el argumento de callback no está establecido.
AccessibilityAction ACTION_SHOW_TOOLTIP = 8
Acción de mostrar tooltip, el argumento de callback no está establecido.
AccessibilityAction ACTION_SET_TEXT_SELECTION = 9
Set text selection action, callback argument is set to Dictionary with the following keys:
"start_element"accessibility element of the selection start."start_char"character offset relative to the accessibility element of the selection start."end_element"accessibility element of the selection end."end_char"character offset relative to the accessibility element of the selection end.
AccessibilityAction ACTION_REPLACE_SELECTED_TEXT = 10
Acción de reemplazar texto, el argumento de callback se establece en String con el texto de reemplazo.
AccessibilityAction ACTION_SCROLL_BACKWARD = 11
Acción de desplazamiento hacia atrás, el argumento de callback no está establecido.
AccessibilityAction ACTION_SCROLL_DOWN = 12
Scroll down action, callback argument is set to AccessibilityScrollUnit.
AccessibilityAction ACTION_SCROLL_FORWARD = 13
Acción de desplazamiento hacia adelante, el argumento de callback no está establecido.
AccessibilityAction ACTION_SCROLL_LEFT = 14
Scroll left action, callback argument is set to AccessibilityScrollUnit.
AccessibilityAction ACTION_SCROLL_RIGHT = 15
Scroll right action, callback argument is set to AccessibilityScrollUnit.
AccessibilityAction ACTION_SCROLL_UP = 16
Scroll up action, callback argument is set to AccessibilityScrollUnit.
AccessibilityAction ACTION_SCROLL_INTO_VIEW = 17
Scroll into view action, callback argument is set to AccessibilityScrollHint.
AccessibilityAction ACTION_SCROLL_TO_POINT = 18
Acción de desplazamiento a un punto, el argumento de callback se establece en Vector2 con las coordenadas del punto relativo.
AccessibilityAction ACTION_SET_SCROLL_OFFSET = 19
Acción de establecer el desplazamiento, el argumento de callback se establece en Vector2 con el desplazamiento.
AccessibilityAction ACTION_SET_VALUE = 20
Set value action, callback argument is set to String or number with the new value.
Acción de mostrar menú contextual, el argumento de callback no está establecido.
AccessibilityAction ACTION_CUSTOM = 22
Custom action, callback argument is set to the integer action ID.
enum AccessibilityLiveMode: 🔗
AccessibilityLiveMode LIVE_OFF = 0
Indica que las actualizaciones de la región activa no deben presentarse.
AccessibilityLiveMode LIVE_POLITE = 1
Indica que las actualizaciones de la región activa deben presentarse en la siguiente oportunidad (por ejemplo, al final de la frase actual).
AccessibilityLiveMode LIVE_ASSERTIVE = 2
Indica que las actualizaciones de la región activa tienen la máxima prioridad y deben presentarse inmediatamente.
enum AccessibilityScrollUnit: 🔗
AccessibilityScrollUnit SCROLL_UNIT_ITEM = 0
The amount by which to scroll. A single item of a list, line of text.
AccessibilityScrollUnit SCROLL_UNIT_PAGE = 1
The amount by which to scroll. A single page.
enum AccessibilityScrollHint: 🔗
AccessibilityScrollHint SCROLL_HINT_TOP_LEFT = 0
A preferred position for the node scrolled into view. Top-left edge of the scroll container.
AccessibilityScrollHint SCROLL_HINT_BOTTOM_RIGHT = 1
A preferred position for the node scrolled into view. Bottom-right edge of the scroll container.
AccessibilityScrollHint SCROLL_HINT_TOP_EDGE = 2
A preferred position for the node scrolled into view. Top edge of the scroll container.
AccessibilityScrollHint SCROLL_HINT_BOTTOM_EDGE = 3
A preferred position for the node scrolled into view. Bottom edge of the scroll container.
AccessibilityScrollHint SCROLL_HINT_LEFT_EDGE = 4
A preferred position for the node scrolled into view. Left edge of the scroll container.
AccessibilityScrollHint SCROLL_HINT_RIGHT_EDGE = 5
A preferred position for the node scrolled into view. Right edge of the scroll container.
enum MouseMode: 🔗
MouseMode MOUSE_MODE_VISIBLE = 0
Hace que el cursor del ratón sea visible si está oculto.
Hace que el cursor del ratón se oculte si es visible.
MouseMode MOUSE_MODE_CAPTURED = 2
Captura el ratón. El ratón se ocultará y su posición se bloqueará en el centro de la ventana del gestor de ventanas.
Nota: Si quieres procesar el movimiento del ratón en este modo, necesitas usar InputEventMouseMotion.relative.
MouseMode MOUSE_MODE_CONFINED = 3
Limita el cursor del ratón a la ventana del juego y lo hace visible.
Limita el cursor del ratón a la ventana del juego y lo oculta.
MouseMode MOUSE_MODE_MAX = 5
Valor máximo de MouseMode.
enum ScreenOrientation: 🔗
ScreenOrientation SCREEN_LANDSCAPE = 0
Orientación horizontal predeterminada.
ScreenOrientation SCREEN_PORTRAIT = 1
Orientación vertical predeterminada.
ScreenOrientation SCREEN_REVERSE_LANDSCAPE = 2
Orientación horizontal inversa (boca abajo).
ScreenOrientation SCREEN_REVERSE_PORTRAIT = 3
Orientación vertical inversa (boca abajo).
ScreenOrientation SCREEN_SENSOR_LANDSCAPE = 4
Orientación horizontal automática (por defecto o inversa dependiendo del sensor).
ScreenOrientation SCREEN_SENSOR_PORTRAIT = 5
Orientación vertical automática (por defecto o inversa dependiendo del sensor).
ScreenOrientation SCREEN_SENSOR = 6
Orientación horizontal o vertical automática (por defecto o inversa dependiendo del sensor).
enum VirtualKeyboardType: 🔗
VirtualKeyboardType KEYBOARD_TYPE_DEFAULT = 0
Teclado virtual de texto por defecto.
VirtualKeyboardType KEYBOARD_TYPE_MULTILINE = 1
Teclado virtual multilínea.
VirtualKeyboardType KEYBOARD_TYPE_NUMBER = 2
Teclado numérico virtual, útil para ingresar pines.
VirtualKeyboardType KEYBOARD_TYPE_NUMBER_DECIMAL = 3
Teclado numérico virtual, útil para introducir números fraccionarios.
VirtualKeyboardType KEYBOARD_TYPE_PHONE = 4
Teclado numérico de teléfono virtual.
VirtualKeyboardType KEYBOARD_TYPE_EMAIL_ADDRESS = 5
Teclado virtual con teclas adicionales para ayudar a escribir direcciones de correo electrónico.
VirtualKeyboardType KEYBOARD_TYPE_PASSWORD = 6
Teclado virtual para introducir una contraseña. En la mayoría de las plataformas, esto debería desactivar el autocompletado y la autocapitalización.
Nota: Esto no es compatible en la Web. En su lugar, se comporta de forma idéntica a KEYBOARD_TYPE_DEFAULT.
VirtualKeyboardType KEYBOARD_TYPE_URL = 7
Teclado virtual con teclas adicionales para ayudar a escribir URLs.
enum CursorShape: 🔗
CursorShape CURSOR_ARROW = 0
Forma de cursor de flecha. Este es el predeterminado cuando no se apunta a nada que sobrescriba el cursor del ratón, como un LineEdit o TextEdit.
CursorShape CURSOR_IBEAM = 1
I-beam cursor shape. This is used by default when hovering a control that accepts text input, such as LineEdit or TextEdit.
CursorShape CURSOR_POINTING_HAND = 2
Forma de cursor de mano apuntando. Se utiliza por defecto al pasar el ratón por encima de un LinkButton o una etiqueta URL en un RichTextLabel.
CursorShape CURSOR_CROSS = 3
Cursor en forma de cruz. Se pretende que se muestre cuando el usuario necesita apuntar con precisión sobre un elemento, como una herramienta de selección rectangular o un selector de color.
CursorShape CURSOR_WAIT = 4
Cursor de espera. En la mayoría de los temas de cursor, esto muestra un icono giratorio junto a la flecha. Destinado a ser utilizado para operaciones sin bloqueo (cuando el usuario puede hacer otra cosa en ese momento). Véase también CURSOR_BUSY.
CursorShape CURSOR_BUSY = 5
Cursor de espera. En la mayoría de los temas de cursor, esto reemplaza la flecha con un icono giratorio. Destinado a ser utilizado para operaciones de bloqueo (cuando el usuario no puede hacer nada más en ese momento). Véase también CURSOR_WAIT.
CursorShape CURSOR_DRAG = 6
Cursor de mano arrastrando. Se muestra durante las operaciones de arrastrar y soltar. Véase también CURSOR_CAN_DROP.
CursorShape CURSOR_CAN_DROP = 7
"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 CURSOR_DRAG.
CursorShape CURSOR_FORBIDDEN = 8
Cursor prohibido. Se muestra durante las operaciones de arrastrar y soltar si el Control sobre el que se pasa el ratón no puede aceptar el evento de arrastrar y soltar.
CursorShape CURSOR_VSIZE = 9
Cursor de redimensionamiento vertical. Se pretende que se muestre cuando el Control sobre el que se pasa el ratón puede ser redimensionado verticalmente usando el ratón. Véase también CURSOR_VSPLIT.
CursorShape CURSOR_HSIZE = 10
Cursor de redimensionamiento horizontal. Se pretende que se muestre cuando el Control sobre el que se pasa el ratón puede ser redimensionado horizontalmente usando el ratón. Véase también CURSOR_HSPLIT.
CursorShape CURSOR_BDIAGSIZE = 11
Cursor de redimensionamiento diagonal secundario (arriba-derecha/abajo-izquierda). Se pretende que se muestre cuando el Control sobre el que se pasa el ratón puede ser redimensionado en ambos ejes a la vez usando el ratón.
CursorShape CURSOR_FDIAGSIZE = 12
Cursor de redimensionamiento diagonal principal (arriba-izquierda/abajo-derecha). Se pretende que se muestre cuando el Control sobre el que se pasa el ratón puede ser redimensionado en ambos ejes a la vez usando el ratón.
CursorShape CURSOR_MOVE = 13
Cursor de movimiento. Se pretende que se muestre cuando el Control sobre el que se pasa el ratón puede ser movido usando el ratón.
CursorShape CURSOR_VSPLIT = 14
Cursor de división vertical. Se muestra al pasar el ratón por encima de un Control con divisiones que pueden ser redimensionadas verticalmente usando el ratón, como VSplitContainer. En algunos temas de cursor, este cursor puede tener la misma apariencia que CURSOR_VSIZE.
CursorShape CURSOR_HSPLIT = 15
Cursor de división horizontal. Se muestra al pasar el ratón por encima de un Control con divisiones que pueden ser redimensionadas horizontalmente usando el ratón, como HSplitContainer. En algunos temas de cursor, este cursor puede tener la misma apariencia que CURSOR_HSIZE.
CursorShape CURSOR_HELP = 16
Cursor de ayuda. En la mayoría de los temas de cursor, esto muestra un icono de signo de interrogación en lugar del cursor del ratón. Destinado a ser utilizado cuando el usuario ha solicitado ayuda sobre el siguiente elemento que será pulsado.
CursorShape CURSOR_MAX = 17
Representa el tamaño del enum CursorShape.
enum FileDialogMode: 🔗
FileDialogMode FILE_DIALOG_MODE_OPEN_FILE = 0
El cuadro de diálogo de archivo nativo permite seleccionar uno, y solo un, archivo.
FileDialogMode FILE_DIALOG_MODE_OPEN_FILES = 1
El cuadro de diálogo de archivo nativo permite seleccionar varios archivos.
FileDialogMode FILE_DIALOG_MODE_OPEN_DIR = 2
El cuadro de diálogo de archivo nativo solo permite seleccionar un directorio y no permite la selección de ningún archivo.
FileDialogMode FILE_DIALOG_MODE_OPEN_ANY = 3
El cuadro de diálogo de archivo nativo permite seleccionar un archivo o directorio.
FileDialogMode FILE_DIALOG_MODE_SAVE_FILE = 4
El cuadro de diálogo del archivo nativo avisará cuando exista un archivo.
enum WindowMode: 🔗
WindowMode WINDOW_MODE_WINDOWED = 0
Modo de ventana, es decir, Window no ocupa toda la pantalla (a menos que se establezca el tamaño de la pantalla).
WindowMode WINDOW_MODE_MINIMIZED = 1
Modo de ventana minimizada, es decir, Window no es visible y está disponible en la lista de ventanas del gestor de ventanas. Normalmente ocurre cuando se pulsa el botón de minimizar.
WindowMode WINDOW_MODE_MAXIMIZED = 2
Modo de ventana maximizada, es decir, Window ocupará toda el área de la pantalla excepto la barra de tareas y seguirá mostrando sus bordes. Normalmente ocurre cuando se pulsa el botón de maximizar.
WindowMode WINDOW_MODE_FULLSCREEN = 3
Modo de pantalla completa con soporte completo para múltiples ventanas.
La ventana de pantalla completa cubre toda el área de visualización de una pantalla y no tiene decoraciones. El modo de vídeo de la pantalla no se cambia.
En Android: Esto habilita el modo inmersivo.
En macOS: Se utiliza un nuevo escritorio para mostrar el proyecto en ejecución.
Nota: Independientemente de la plataforma, habilitar la pantalla completa cambiará el tamaño de la ventana para que coincida con el tamaño del monitor. Por lo tanto, asegúrate de que tu proyecto admita múltiples resoluciones al habilitar el modo de pantalla completa.
WindowMode WINDOW_MODE_EXCLUSIVE_FULLSCREEN = 4
A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition).
Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed.
Note: This mode might not work with screen recording software.
On Android: This enables immersive mode.
On Windows: Depending on video driver, full screen transition might cause screens to go black for a moment.
On macOS: A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
On Linux (X11): Exclusive full screen mode bypasses compositor.
On Linux (Wayland): Equivalent to WINDOW_MODE_FULLSCREEN.
Note: Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports multiple resolutions when enabling full screen mode.
enum WindowFlags: 🔗
WindowFlags WINDOW_FLAG_RESIZE_DISABLED = 0
La ventana no puede ser redimensionada arrastrando su agarre de redimensionamiento. Todavía es posible redimensionar la ventana usando window_set_size(). Esta bandera es ignorada para las ventanas en pantalla completa.
WindowFlags WINDOW_FLAG_BORDERLESS = 1
La ventana no tiene barra de título nativa ni otras decoraciones. Esta bandera es ignorada para las ventanas en pantalla completa.
WindowFlags WINDOW_FLAG_ALWAYS_ON_TOP = 2
La ventana está flotando sobre todas las demás ventanas. Esta bandera es ignorada para las ventanas en pantalla completa.
WindowFlags WINDOW_FLAG_TRANSPARENT = 3
The window background can be transparent.
Note: This flag has no effect if is_window_transparency_available() returns false.
Note: Transparency support is implemented on Linux (X11/Wayland), macOS, and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
Note: Transparency support is implemented on Android, but can only be enabled via ProjectSettings.display/window/per_pixel_transparency/allowed. This flag has no effect on Android.
WindowFlags WINDOW_FLAG_NO_FOCUS = 4
La ventana no puede enfocarse. Una ventana sin foco ignorará todas las entradas, excepto los clics del ratón.
WindowFlags WINDOW_FLAG_POPUP = 5
La ventana es parte de un menú o desplegable de OptionButton. Esta bandera no puede ser cambiado cuando la ventana está visible. Una ventana emergente activa recibirá exclusivamente toda la entrada, sin robar el foco de su padre. Las ventanas emergentes se cierran automáticamente cuando el usuario hace clic fuera de ella, o cuando se cambia de aplicación. La ventana emergente debe tener un padre transitorio establecido (véase window_set_transient()).
WindowFlags WINDOW_FLAG_EXTEND_TO_TITLE = 6
El contenido de la ventana se expande al tamaño completo de la ventana. A diferencia de la ventana sin bordes, el marco se mantiene intacto y puede usarse para cambiar el tamaño de la ventana, la barra de título es transparente pero tiene botones de minimizar/maximizar/cerrar.
Usa window_set_window_buttons_offset() para ajustar el desplazamiento de los botones minimizar/maximizar/cerrar.
Usa window_get_safe_title_margins() para determinar el área bajo la barra de título que no está cubierta por las decoraciones.
Nota: Esta bandera solo se implementa en macOS.
WindowFlags WINDOW_FLAG_MOUSE_PASSTHROUGH = 7
Todos los eventos del ratón se pasan a la ventana subyacente de la misma aplicación.
WindowFlags WINDOW_FLAG_SHARP_CORNERS = 8
El estilo de ventana se sobrescribe, forzando las esquinas afiladas.
Nota: Esta opción solo está implementada en Windows (11).
WindowFlags WINDOW_FLAG_EXCLUDE_FROM_CAPTURE = 9
Window is excluded from screenshots taken by screen_get_image(), screen_get_image_rect(), and screen_get_pixel().
Note: This flag is implemented on macOS and Windows (10, 20H1).
Note: Setting this flag will prevent standard screenshot methods from capturing a window image, but does NOT guarantee that other apps won't be able to capture an image. It should not be used as a DRM or security measure.
WindowFlags WINDOW_FLAG_POPUP_WM_HINT = 10
Señala al gestor de ventanas que se supone que esta ventana es un "popup" definido por la implementación (normalmente una ventana hija flotante, sin bordes, no tileable e inamovible).
WindowFlags WINDOW_FLAG_MINIMIZE_DISABLED = 11
El botón para minimizar la ventana se deshabilita.
Nota: Esta opción está implementada en macOS y Windows.
WindowFlags WINDOW_FLAG_MAXIMIZE_DISABLED = 12
El botón para maximizar la ventana se deshabilita.
Nota: Esta opción está implementada en macOS y Windows.
WindowFlags WINDOW_FLAG_MAX = 13
Valor máximo de WindowFlags.
enum WindowEvent: 🔗
WindowEvent WINDOW_EVENT_MOUSE_ENTER = 0
Se envía cuando el puntero del ratón ingresa a la ventana.
WindowEvent WINDOW_EVENT_MOUSE_EXIT = 1
Se envía cuando el puntero del ratón sale de la ventana.
WindowEvent WINDOW_EVENT_FOCUS_IN = 2
Se envía cuando la ventana toma el foco.
WindowEvent WINDOW_EVENT_FOCUS_OUT = 3
Se envía cuando la ventana pierde el foco.
WindowEvent WINDOW_EVENT_CLOSE_REQUEST = 4
Se envía cuando el usuario ha intentado cerrar la ventana (por ejemplo, se presiona el botón de cerrar).
WindowEvent WINDOW_EVENT_GO_BACK_REQUEST = 5
Se envía al presionar el botón "Atrás" del dispositivo.
Nota: Este evento solo está implementado en Android.
WindowEvent WINDOW_EVENT_DPI_CHANGE = 6
Se envía cuando la ventana se mueve a una pantalla con un DPI diferente o cuando se cambia el DPI de la pantalla.
Nota: Esta opción solo se implementa en macOS y Linux (Wayland).
WindowEvent WINDOW_EVENT_TITLEBAR_CHANGE = 7
Enviado cuando la decoración de la barra de título de la ventana es cambiada (p. ej. WINDOW_FLAG_EXTEND_TO_TITLE está activada o la ventana entra/sale del modo de pantalla completa).
Nota: Esta bandera solo está implementada en macOS.
WindowEvent WINDOW_EVENT_FORCE_CLOSE = 8
Se envía cuando el servidor de visualización fuerza el cierre de la ventana. La ventana ocultará y limpiará inmediatamente cualquier referencia de renderizado interna.
Nota: Esta opción solo se implementa en Linux (Wayland).
enum WindowResizeEdge: 🔗
WindowResizeEdge WINDOW_EDGE_TOP_LEFT = 0
Borde superior izquierdo de una ventana.
WindowResizeEdge WINDOW_EDGE_TOP = 1
Borde superior de una ventana.
WindowResizeEdge WINDOW_EDGE_TOP_RIGHT = 2
Borde superior derecho de una ventana.
WindowResizeEdge WINDOW_EDGE_LEFT = 3
Borde izquierdo de una ventana.
WindowResizeEdge WINDOW_EDGE_RIGHT = 4
Borde derecho de una ventana.
WindowResizeEdge WINDOW_EDGE_BOTTOM_LEFT = 5
Borde inferior izquierdo de una ventana.
WindowResizeEdge WINDOW_EDGE_BOTTOM = 6
Borde inferior de una ventana.
WindowResizeEdge WINDOW_EDGE_BOTTOM_RIGHT = 7
Borde inferior derecho de una ventana.
WindowResizeEdge WINDOW_EDGE_MAX = 8
Representa el tamaño del enum WindowResizeEdge.
enum VSyncMode: 🔗
VSyncMode VSYNC_DISABLED = 0
Sin sincronización vertical, lo que significa que el motor mostrará los fotogramas lo más rápido posible (el tearing puede ser visible). La velocidad de fotogramas es ilimitada (independientemente de Engine.max_fps).
VSyncMode VSYNC_ENABLED = 1
Modo de sincronización vertical por defecto, la imagen sólo se muestra en los intervalos de borrado vertical (no hay tearing visible). La velocidad de fotogramas está limitada por la frecuencia de actualización del monitor (independientemente de Engine.max_fps).
VSyncMode VSYNC_ADAPTIVE = 2
Behaves like VSYNC_DISABLED when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible). Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is limited by the monitor refresh rate (regardless of Engine.max_fps). Behaves like VSYNC_ENABLED when using the Compatibility rendering method.
VSyncMode VSYNC_MAILBOX = 3
Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (regardless of Engine.max_fps).
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). VSYNC_MAILBOX works best when at least twice as many frames as the display refresh rate are rendered. Behaves like VSYNC_ENABLED when using the Compatibility rendering method.
enum HandleType: 🔗
HandleType DISPLAY_HANDLE = 0
Display handle:
Linux (X11):
X11::Display*for the display.Linux (Wayland):
wl_displayfor the display.Android:
EGLDisplayfor the display.
HandleType WINDOW_HANDLE = 1
Window handle:
Windows:
HWNDfor the window.Linux (X11):
X11::Window*for the window.Linux (Wayland):
wl_surfacefor the window.macOS:
NSWindow*for the window.iOS:
UIViewController*for the view controller.Android:
jObjectfor the activity.
HandleType WINDOW_VIEW = 2
Window view:
Windows:
HDCfor the window (only with the Compatibility renderer).macOS:
NSView*for the window main view.iOS:
UIView*for the window main view.
HandleType OPENGL_CONTEXT = 3
OpenGL context (only with the Compatibility renderer):
Windows:
HGLRCfor the window (native GL), orEGLContextfor the window (ANGLE).Linux (X11):
GLXContext*for the window.Linux (Wayland):
EGLContextfor the window.macOS:
NSOpenGLContext*for the window (native GL), orEGLContextfor the window (ANGLE).Android:
EGLContextfor the window.
HandleType EGL_DISPLAY = 4
Windows:
EGLDisplayfor the window (ANGLE).macOS:
EGLDisplayfor the window (ANGLE).Linux (Wayland):
EGLDisplayfor the window.
HandleType EGL_CONFIG = 5
Windows:
EGLConfigfor the window (ANGLE).macOS:
EGLConfigfor the window (ANGLE).Linux (Wayland):
EGLConfigfor the window.
enum TTSUtteranceEvent: 🔗
TTSUtteranceEvent TTS_UTTERANCE_STARTED = 0
Utterance has begun to be spoken.
TTSUtteranceEvent TTS_UTTERANCE_ENDED = 1
La expresión se completó con éxito.
TTSUtteranceEvent TTS_UTTERANCE_CANCELED = 2
Utterance was canceled, or TTS service was unable to process it.
TTSUtteranceEvent TTS_UTTERANCE_BOUNDARY = 3
Utterance reached a word or sentence boundary.
Constantes
INVALID_SCREEN = -1 🔗
El ID que se refiere a una pantalla que no existe. Algunos métodos de DisplayServer lo devuelven si ninguna pantalla coincide con el resultado solicitado.
SCREEN_WITH_MOUSE_FOCUS = -4 🔗
Representa la pantalla que contiene el puntero del ratón.
Nota: En Android, iOS, Web y Linux (Wayland), esta constante siempre representa la pantalla en el índice 0.
SCREEN_WITH_KEYBOARD_FOCUS = -3 🔗
Representa la pantalla que contiene la ventana con el foco del teclado.
Nota: En Android, iOS, Web y Linux (Wayland), esta constante siempre representa la pantalla en el índice 0.
SCREEN_PRIMARY = -2 🔗
Representa la pantalla principal.
Nota: En Android, iOS, Web y Linux (Wayland), esta constante siempre representa la pantalla en el índice 0.
SCREEN_OF_MAIN_WINDOW = -1 🔗
Representa la pantalla donde se encuentra la ventana principal. Este es generalmente el valor por defecto en las funciones que permiten especificar una de varias pantallas.
Nota: En Android, iOS, Web y Linux (Wayland), esta constante siempre representa la pantalla en el índice 0.
MAIN_WINDOW_ID = 0 🔗
El ID de la ventana principal generada por el motor, que puede ser pasado a los métodos que esperan un window_id.
INVALID_WINDOW_ID = -1 🔗
El ID que se refiere a una ventana inexistente. Algunos métodos de DisplayServer lo devuelven si ninguna ventana coincide con el resultado solicitado.
INVALID_INDICATOR_ID = -1 🔗
El ID que se refiere a un indicador de estado de la aplicación inexistente.
Descripciones de Métodos
RID accessibility_create_element(window_id: int, role: AccessibilityRole) 🔗
Creates a new, empty accessibility element resource.
Note: An accessibility element is created and freed automatically for each Node. In general, this function should not be called manually.
RID accessibility_create_sub_element(parent_rid: RID, role: AccessibilityRole, insert_pos: int = -1) 🔗
Creates a new, empty accessibility sub-element resource. Sub-elements can be used to provide accessibility information for objects which are not Nodes, such as list items, table cells, or menu items. Sub-elements are freed automatically when the parent element is freed, or can be freed early using the accessibility_free_element() method.
RID accessibility_create_sub_text_edit_elements(parent_rid: RID, shaped_text: RID, min_height: float, insert_pos: int = -1) 🔗
Creates a new, empty accessibility sub-element from the shaped text buffer. Sub-elements are freed automatically when the parent element is freed, or can be freed early using the accessibility_free_element() method.
Variant accessibility_element_get_meta(id: RID) const 🔗
Devuelve los metadatos del elemento de accesibilidad.
void accessibility_element_set_meta(id: RID, meta: Variant) 🔗
Establece los metadatos del elemento de accesibilidad.
void accessibility_free_element(id: RID) 🔗
Frees an object created by accessibility_create_element(), accessibility_create_sub_element(), or accessibility_create_sub_text_edit_elements().
RID accessibility_get_window_root(window_id: int) const 🔗
Devuelve el elemento de accesibilidad principal de la ventana nativa del sistema operativo.
bool accessibility_has_element(id: RID) const 🔗
Returns true if id is a valid accessibility element.
int accessibility_screen_reader_active() const 🔗
Returns 1 if a screen reader, Braille display or other assistive app is active, 0 otherwise. Returns -1 if status is unknown.
Note: This method is implemented on Linux, macOS, and Windows.
Note: Accessibility debugging tools, such as Accessibility Insights for Windows, macOS Accessibility Inspector, or AT-SPI Browser do not count as assistive apps and will not affect this value. To test your app with these tools, set ProjectSettings.accessibility/general/accessibility_support to 1.
void accessibility_set_window_focused(window_id: int, focused: bool) 🔗
Sets the window focused state for assistive apps.
Note: This method is implemented on Linux, macOS, and Windows.
Note: Advanced users only! Window objects call this method automatically.
void accessibility_set_window_rect(window_id: int, rect_out: Rect2, rect_in: Rect2) 🔗
Sets window outer (with decorations) and inner (without decorations) bounds for assistive apps.
Note: This method is implemented on Linux, macOS, and Windows.
Note: Advanced users only! Window objects call this method automatically.
int accessibility_should_increase_contrast() const 🔗
Returns 1 if a high-contrast user interface theme should be used, 0 otherwise. Returns -1 if status is unknown.
Note: This method is implemented on Linux (X11/Wayland, GNOME), macOS, and Windows.
int accessibility_should_reduce_animation() const 🔗
Returns 1 if flashing, blinking, and other moving content that can cause seizures in users with photosensitive epilepsy should be disabled, 0 otherwise. Returns -1 if status is unknown.
Note: This method is implemented on macOS and Windows.
int accessibility_should_reduce_transparency() const 🔗
Returns 1 if background images, transparency, and other features that can reduce the contrast between the foreground and background should be disabled, 0 otherwise. Returns -1 if status is unknown.
Note: This method is implemented on macOS and Windows.
void accessibility_update_add_action(id: RID, action: AccessibilityAction, callable: Callable) 🔗
Adds a callback for the accessibility action (action which can be performed by using a special screen reader command or buttons on the Braille display), and marks this action as supported. The action callback receives one Variant argument, which value depends on action type.
void accessibility_update_add_child(id: RID, child_id: RID) 🔗
Adds a child accessibility element.
Note: Node children and sub-elements are added to the child list automatically.
void accessibility_update_add_custom_action(id: RID, action_id: int, action_description: String) 🔗
Adds support for a custom accessibility action. action_id is passed as an argument to the callback of ACTION_CUSTOM action.
Adds an element that is controlled by this element.
Adds an element that describes this element.
Adds an element that details this element.
Agrega un elemento hacia el cual fluye este elemento.
Adds an element that labels this element.
Adds an element that is part of the same radio group.
Note: This method should be called on each element of the group, using all other elements as related_id.
void accessibility_update_set_active_descendant(id: RID, other_id: RID) 🔗
Agrega un elemento que es un descendiente activo de este elemento.
void accessibility_update_set_background_color(id: RID, color: Color) 🔗
Establece el color de fondo del elemento.
void accessibility_update_set_bounds(id: RID, p_rect: Rect2) 🔗
Establece el cuadro delimitador del elemento, en relación con la posición del nodo.
void accessibility_update_set_checked(id: RID, checekd: bool) 🔗
Establece el estado del elemento marcado.
void accessibility_update_set_classname(id: RID, classname: String) 🔗
Establece el nombre de la clase del elemento.
void accessibility_update_set_color_value(id: RID, color: Color) 🔗
Establece el valor del color del elemento.
void accessibility_update_set_description(id: RID, description: String) 🔗
Sets element accessibility description.
void accessibility_update_set_error_message(id: RID, other_id: RID) 🔗
Sets an element which contains an error message for this element.
void accessibility_update_set_extra_info(id: RID, name: String) 🔗
Sets element accessibility extra information added to the element name.
void accessibility_update_set_flag(id: RID, flag: AccessibilityFlags, value: bool) 🔗
Establece la bandera del elemento.
void accessibility_update_set_focus(id: RID) 🔗
Establece el elemento enfocado actualmente.
void accessibility_update_set_foreground_color(id: RID, color: Color) 🔗
Establece el color de primer plano del elemento.
void accessibility_update_set_in_page_link_target(id: RID, other_id: RID) 🔗
Establece el elemento de destino para el enlace.
void accessibility_update_set_language(id: RID, language: String) 🔗
Establece el idioma del texto del elemento.
void accessibility_update_set_list_item_count(id: RID, size: int) 🔗
Establece el número de elementos en la lista.
void accessibility_update_set_list_item_expanded(id: RID, expanded: bool) 🔗
Establece el estado de expandido de un elemento de lista/árbol.
void accessibility_update_set_list_item_index(id: RID, index: int) 🔗
Establece la posición del elemento en la lista.
void accessibility_update_set_list_item_level(id: RID, level: int) 🔗
Establece el nivel jerárquico del elemento en la lista.
void accessibility_update_set_list_item_selected(id: RID, selected: bool) 🔗
Establece el estado seleccionado del elemento de lista/árbol.
void accessibility_update_set_list_orientation(id: RID, vertical: bool) 🔗
Establece la orientación de los elementos de la lista.
void accessibility_update_set_live(id: RID, live: AccessibilityLiveMode) 🔗
Establece la prioridad de las actualizaciones de la región en vivo.
void accessibility_update_set_member_of(id: RID, group_id: RID) 🔗
Establece el elemento para que sea miembro del grupo.
void accessibility_update_set_name(id: RID, name: String) 🔗
Establece el nombre de accesibilidad del elemento.
void accessibility_update_set_next_on_line(id: RID, other_id: RID) 🔗
Establece el siguiente elemento en la línea.
void accessibility_update_set_num_jump(id: RID, jump: float) 🔗
Establece el salto del valor numérico.
void accessibility_update_set_num_range(id: RID, min: float, max: float) 🔗
Establece un rango de valores numéricos.
void accessibility_update_set_num_step(id: RID, step: float) 🔗
Establece el paso del valor numérico.
void accessibility_update_set_num_value(id: RID, position: float) 🔗
Establece el valor numérico.
void accessibility_update_set_placeholder(id: RID, placeholder: String) 🔗
Establece el texto de marcador de posición.
void accessibility_update_set_popup_type(id: RID, popup: AccessibilityPopupType) 🔗
Establece el tipo de popup para los botones emergentes.
void accessibility_update_set_previous_on_line(id: RID, other_id: RID) 🔗
Establece el elemento anterior en la línea.
void accessibility_update_set_role(id: RID, role: AccessibilityRole) 🔗
Modifica el rol de accesibilidad del elemento.
void accessibility_update_set_role_description(id: RID, description: String) 🔗
Establece el texto de descripción del rol de accesibilidad del elemento.
void accessibility_update_set_scroll_x(id: RID, position: float) 🔗
Establece la posición x de la barra de desplazamiento.
void accessibility_update_set_scroll_x_range(id: RID, min: float, max: float) 🔗
Sets scroll bar x range.
void accessibility_update_set_scroll_y(id: RID, position: float) 🔗
Establece la posición y de la barra de desplazamiento.
void accessibility_update_set_scroll_y_range(id: RID, min: float, max: float) 🔗
Sets scroll bar y range.
void accessibility_update_set_shortcut(id: RID, shortcut: String) 🔗
Establece la lista de atajos de teclado utilizados por elemento.
void accessibility_update_set_state_description(id: RID, description: String) 🔗
Establece una descripción legible por humanos del estado actual marcado.
void accessibility_update_set_table_cell_position(id: RID, row_index: int, column_index: int) 🔗
Establece la posición de la celda en la tabla.
void accessibility_update_set_table_cell_span(id: RID, row_span: int, column_span: int) 🔗
Establece el espacio entre filas y columnas de celdas.
void accessibility_update_set_table_column_count(id: RID, count: int) 🔗
Establece el número de columnas en la tabla.
void accessibility_update_set_table_column_index(id: RID, index: int) 🔗
Establece la posición de la columna.
void accessibility_update_set_table_row_count(id: RID, count: int) 🔗
Establece el número de filas en la tabla.
void accessibility_update_set_table_row_index(id: RID, index: int) 🔗
Establece la posición de la fila en la tabla.
void accessibility_update_set_text_align(id: RID, align: HorizontalAlignment) 🔗
Establece la alineación del texto del elemento.
void accessibility_update_set_text_decorations(id: RID, underline: bool, strikethrough: bool, overline: bool) 🔗
Establece el subrayado/sobrelineado/tachado del texto.
void accessibility_update_set_text_orientation(id: RID, vertical: bool) 🔗
Establece la orientación del texto.
void accessibility_update_set_text_selection(id: RID, text_start_id: RID, start_char: int, text_end_id: RID, end_char: int) 🔗
Establece la selección de texto en el campo de texto. text_start_id y text_end_id deberían ser elementos creados por accessibility_create_sub_text_edit_elements(). Los desplazamientos de caracteres son relativos al elemento correspondiente.
void accessibility_update_set_tooltip(id: RID, tooltip: String) 🔗
Establece el texto de la información sobre herramientas.
void accessibility_update_set_transform(id: RID, transform: Transform2D) 🔗
Establece la transformación 2D del elemento.
void accessibility_update_set_url(id: RID, url: String) 🔗
Establece la URL del enlace.
void accessibility_update_set_value(id: RID, value: String) 🔗
Establece el valor del texto del elemento.
void beep() const 🔗
Reproduce el sonido de pitido del sistema operativo, si es posible. Debido a que proviene del sistema operativo, el sonido de pitido será audible incluso si la aplicación está silenciada. También puede ser deshabilitado para todo el sistema operativo por el usuario.
Nota: Este método está implementado en macOS, Linux (X11/Wayland) y Windows.
String clipboard_get() const 🔗
Devuelve el portapapeles del usuario como una string si es posible.
Image clipboard_get_image() const 🔗
Devuelve el portapapeles del usuario como una imagen si es posible.
Nota: Este método utiliza los datos de píxeles copiados, p. ej. de un software de edición de imágenes o un navegador web, no un archivo de imagen copiado desde el explorador de archivos.
String clipboard_get_primary() const 🔗
Devuelve el portapapeles primario del usuario como una string, si es posible. Este es el portapapeles que se establece cuando el usuario selecciona texto en cualquier aplicación, en lugar de cuando presiona Ctrl + C. Los datos del portapapeles se pueden pegar haciendo clic con el botón central del ratón en cualquier aplicación que admita el mecanismo del portapapeles primario.
Nota: Este método sólo está implementado en Linux (X11/Wayland).
Devuelve true si hay un contenido de texto en el portapapeles del usuario.
bool clipboard_has_image() const 🔗
Devuelve true si hay un contenido de imagen en el portapapeles del usuario.
void clipboard_set(clipboard: String) 🔗
Establece el contenido del portapapeles del usuario en la string dada.
void clipboard_set_primary(clipboard_primary: String) 🔗
Establece el contenido del portapapeles primario del usuario a la string dada. Este es el portapapeles que se establece cuando el usuario selecciona texto en cualquier aplicación, en lugar de cuando presiona Ctrl + C. Los datos del portapapeles se pueden pegar haciendo clic con el botón central del ratón en cualquier aplicación que admita el mecanismo del portapapeles primario.
Nota: Este método sólo está implementado en Linux (X11/Wayland).
bool color_picker(callback: Callable) 🔗
Muestra el selector de color nativo del sistema operativo.
Las retrollamadas tienen los siguientes argumentos: status: bool, color: Color.
Nota: Este método se implementa si el servidor de visualización tiene la función FEATURE_NATIVE_COLOR_PICKER.
Nota: Este método sólo está implementado en Linux (X11/Wayland).
int create_status_indicator(icon: Texture2D, tooltip: String, callback: Callable) 🔗
Creates a new application status indicator with the specified icon, tooltip, and activation callback.
callback should take two arguments: the pressed mouse button (one of the MouseButton constants) and the click position in screen coordinates (a Vector2i).
CursorShape cursor_get_shape() const 🔗
Devuelve la forma predeterminada del cursor del mouse establecida por cursor_set_shape().
void cursor_set_custom_image(cursor: Resource, shape: CursorShape = 0, hotspot: Vector2 = Vector2(0, 0)) 🔗
Establece una imagen de cursor de ratón personalizada para la shape dada. Esto significa que el sistema operativo del usuario y el tema del cursor del ratón ya no influirán en la apariencia del cursor del ratón.
cursor puede ser un Texture2D o una Image, y no debe ser mayor de 256×256 para que se muestre correctamente. Opcionalmente, hotspot se puede establecer para desplazar la posición de la imagen con respecto al punto de clic. Por defecto, hotspot se establece en la esquina superior izquierda de la imagen. Véase también cursor_set_shape().
void cursor_set_shape(shape: CursorShape) 🔗
Establece la forma predeterminada del cursor del ratón. La apariencia del cursor variará dependiendo del sistema operativo del usuario y del tema del cursor del ratón. Véase también cursor_get_shape() y cursor_set_custom_image().
void delete_status_indicator(id: int) 🔗
Elimina el indicador de estado de la aplicación.
Error dialog_input_text(title: String, description: String, existing_text: String, callback: Callable) 🔗
Muestra un diálogo de entrada de texto que utiliza la apariencia nativa del sistema operativo. callback debería aceptar un único parámetro String que contenga el contenido del campo de texto.
Nota: Este método se implementa si el servidor de visualización tiene la función FEATURE_NATIVE_DIALOG_INPUT. Las plataformas soportadas incluyen macOS, Windows y Android.
Error dialog_show(title: String, description: String, buttons: PackedStringArray, callback: Callable) 🔗
Muestra un diálogo de texto que utiliza la apariencia nativa del sistema operativo. callback debería aceptar un único parámetro int que corresponda al índice del botón pulsado.
Nota: Este método se implementa si el servidor de visualización tiene la función FEATURE_NATIVE_DIALOG. Las plataformas soportadas incluyen macOS, Windows y Android.
void enable_for_stealing_focus(process_id: int) 🔗
Permite que el PID process_id robe el foco de esta ventana. En otras palabras, esto desactiva la protección contra el robo de foco del sistema operativo para el PID especificado.
Nota: Este método sólo se implementa en Windows.
Error file_dialog_show(title: String, current_directory: String, filename: String, show_hidden: bool, mode: FileDialogMode, filters: PackedStringArray, callback: Callable, parent_window_id: int = 0) 🔗
Displays OS native dialog for selecting files or directories in the file system.
Each filter string in the filters array should be formatted like this: *.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also FileDialog.filters.
Callbacks have the following arguments: status: bool, selected_paths: PackedStringArray, selected_filter_index: int. On Android, the third callback argument (selected_filter_index) is always 0.
Note: This method is implemented if the display server has the FEATURE_NATIVE_DIALOG_FILE feature. Supported platforms include Linux (X11/Wayland), Windows, macOS, and Android (API level 29+).
Note: current_directory might be ignored.
Note: Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types.
Note: On Android and Linux, show_hidden is ignored.
Note: On Android and macOS, native file dialogs have no title.
Note: On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use OS.get_granted_permissions() to get a list of saved bookmarks.
Error file_dialog_with_options_show(title: String, current_directory: String, root: String, filename: String, show_hidden: bool, mode: FileDialogMode, filters: PackedStringArray, options: Array[Dictionary], callback: Callable, parent_window_id: int = 0) 🔗
Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
Each filter string in the filters array should be formatted like this: *.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also FileDialog.filters.
options is array of Dictionarys with the following keys:
"name"- option's name String."values"- PackedStringArray of values. If empty, boolean option (check box) is used."default"- default selected option index (int) or default boolean value (bool).
Callbacks have the following arguments: status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary.
Note: This method is implemented if the display server has the FEATURE_NATIVE_DIALOG_FILE_EXTRA feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
Note: current_directory might be ignored.
Note: Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types.
Note: On Linux (X11), show_hidden is ignored.
Note: On macOS, native file dialogs have no title.
Note: On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use OS.get_granted_permissions() to get a list of saved bookmarks.
void force_process_and_drop_events() 🔗
Forces window manager processing while ignoring all InputEvents. See also process_events().
Note: This method is implemented on Windows and macOS.
Color get_accent_color() const 🔗
Devuelve el color de énfasis del tema del sistema operativo. Devuelve Color(0, 0, 0, 0) si se desconoce el color de énfasis.
Nota: Este método está implementado en macOS, Windows, Android y Linux (X11/Wayland).
Color get_base_color() const 🔗
Devuelve el color base del tema del sistema operativo (fondo de control predeterminado). Devuelve Color(0, 0, 0, 0) si se desconoce el color base.
Nota: Este método está implementado en macOS, Windows y Android.
Array[Rect2] get_display_cutouts() const 🔗
Returns an Array 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 get_display_safe_area().
Note: Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
Rect2i get_display_safe_area() const 🔗
Returns the unobscured area of the display where interactive controls should be rendered. See also get_display_cutouts().
Note: Currently only implemented on Android and iOS. On other platforms, screen_get_usable_rect(SCREEN_OF_MAIN_WINDOW) will be returned as a fallback. See also screen_get_usable_rect().
int get_keyboard_focus_screen() const 🔗
Devuelve el índice de la pantalla que contiene la ventana con el foco del teclado, o la pantalla principal si no hay ninguna ventana enfocada.
Nota: Este método está implementado en Linux/X11, macOS y Windows. En otras plataformas, este método siempre devuelve la pantalla principal.
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).
The names of built-in display servers are Windows, macOS, X11 (Linux), Wayland (Linux), Android, iOS, web (HTML5), and headless (when started with the --headless command line argument).
int get_primary_screen() const 🔗
Devuelve el índice de la pantalla principal.
Nota: Este método está implementado en Linux/X11, macOS y Windows. En otras plataformas, este método siempre devuelve 0.
int get_screen_count() const 🔗
Devuelve el número de pantallas disponibles.
Nota: Este método está implementado en Linux (X11 y Wayland), macOS y Windows. En otras plataformas, este método siempre devuelve 1.
int get_screen_from_rect(rect: Rect2) const 🔗
Devuelve el índice de la pantalla que más se superpone con el rectángulo dado. Devuelve INVALID_SCREEN si el rectángulo no se superpone con ninguna pantalla o no tiene área.
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/swap_cancel_ok.
Note: This doesn't affect native dialogs such as the ones spawned by dialog_show().
int get_window_at_screen_position(position: Vector2i) const 🔗
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:
* (0, 0) +-------+
| |
+-------------+ | |
| | | |
| | | |
+-------------+ +-------+
PackedInt32Array get_window_list() const 🔗
Devuelve la lista de IDs de ventana de Godot que pertenecen a este proceso.
Nota: Los diálogos nativos no se incluyen en esta lista.
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new checkable item with text label to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new checkable item with text label and icon icon to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new item with text label and icon icon to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new radio-checkable item with text label and icon icon to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See global_menu_set_item_checked() for more info on how to control it.
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new item with text label to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new item with text label to the global menu with ID menu_root.
Contrarily to normal binary items, multistate items can have more than two states, as defined by max_states. Each press or activate of the item will increase the state by one. The default value is defined by default_state.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: By default, there's no indication of the current item state, it should be changed manually.
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a new radio-checkable item with text label to the global menu with ID menu_root.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
An accelerator can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The accelerator is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).
Note: Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See global_menu_set_item_checked() for more info on how to control it.
Note: The callback and key_callback Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to tag.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds a separator between items to the global menu with ID menu_root. Separators also occupy an index.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Adds an item that will act as a submenu of the global menu menu_root. The submenu argument is the ID of the global menu root that will be shown when the item is clicked.
Returns index of the inserted item, it's not guaranteed to be the same as index value.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Removes all items from the global menu with ID menu_root.
Note: This method is implemented only on macOS.
Supported system menu IDs:
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
"_window" - Window menu (macOS, custom items added after "Bring All to Front").
"_help" - Help menu (macOS).
Obsoleto: Use NativeMenu or PopupMenu instead.
Devuelve el acelerador del elemento en el índice idx. Los aceleradores son combinaciones especiales de teclas que activan el elemento, independientemente del control que tenga el foco.
Nota: Este método solo se implementa en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Devuelve la devolución de llamada del elemento en el índice idx.
Nota: Este método solo se implementa en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Devuelve el número de elementos del menú global con ID menu_root.
Nota: Este método solo se implementa en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Devuelve el icono del elemento en el índice idx.
Nota: Este método solo se implementa en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Devuelve el desplazamiento horizontal del elemento en el idx dado.
Nota: Este método solo se implementa en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
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.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
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.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the callback of the item accelerator at index idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns number of states of a multistate item. See global_menu_add_multistate_item() for details.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the state of a multistate item. See global_menu_add_multistate_item() for details.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the submenu ID of the item at index idx. See global_menu_add_submenu_item() for more info on how to add a submenu.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the metadata of the specified item, which might be of any type. You can set it with global_menu_set_item_tag(), which provides a simple way of assigning context data to items.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the text of the item at index idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns the tooltip associated with the specified index idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns Dictionary of supported system menu IDs and names.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns true if the item at index idx is checkable in some way, i.e. if it has a checkbox or radio button.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns true if the item at index idx is checked.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns true if the item at index idx is disabled. When it is disabled it can't be selected, or its action invoked.
See global_menu_set_item_disabled() for more info on how to disable an item.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns true if the item at index idx is hidden.
See global_menu_set_item_hidden() for more info on how to hide an item.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Returns true if the item at index idx has radio button-style checkability.
Note: This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Removes the item at index idx from the global menu menu_root.
Note: The indices of items after the removed item will be shifted by one.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
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 (Ctrl + A).
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the callback of the item at index idx. Callback is emitted when an item is pressed.
Note: The callback Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets whether the item at index idx has a checkbox. If false, sets the type of the item to plain text.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the checkstate status of the item at index idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Enables/disables the item at index idx. When it is disabled, it can't be selected and its action can't be invoked.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
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.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the callback of the item at index idx. The callback is emitted when an item is hovered.
Note: The callback Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Replaces the Texture2D icon of the specified idx.
Note: This method is implemented only on macOS.
Note: This method is not supported by macOS "_dock" menu items.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the horizontal offset of the item at the given idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the callback of the item at index idx. Callback is emitted when its accelerator is activated.
Note: The key_callback Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets number of state of a multistate item. See global_menu_add_multistate_item() for details.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
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.
Note: This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Establece el estado de un elemento multiestado. Véase global_menu_add_multistate_item() para obtener más detalles.
Nota: Este método solo está implementado en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Establece el submenú del elemento en el índice idx. El submenú es el ID de una raíz de menú global que se mostraría cuando se hace clic en el elemento.
Nota: Este método solo está implementado en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Establece los metadatos de un elemento, que pueden ser de cualquier tipo. Puedes obtenerlo más tarde con global_menu_get_item_tag(), que proporciona una forma sencilla de asignar datos de contexto a los elementos.
Nota: Este método solo está implementado en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Establece el texto del elemento en el índice idx.
Nota: Este método solo está implementado en macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Sets the String tooltip of the item at the specified index idx.
Note: This method is implemented only on macOS.
Obsoleto: Use NativeMenu or PopupMenu instead.
Registra callables para emitir cuando el menú está a punto de mostrarse o cerrarse, respectivamente. Los métodos de callback no deben tener argumentos.
bool has_additional_outputs() const 🔗
Devuelve true si se han registrado salidas adicionales a través de register_additional_output().
bool has_feature(feature: Feature) const 🔗
Devuelve true si la feature especificada es compatible con el DisplayServer actual, false en caso contrario.
bool has_hardware_keyboard() const 🔗
Devuelve true si un teclado físico está conectado.
Nota: Este método está implementado en Android e iOS. En otras plataformas, este método siempre devuelve true.
void help_set_search_callbacks(search_callback: Callable, action_callback: Callable) 🔗
Sets native help system search callbacks.
search_callback has the following arguments: String search_string, int result_limit and return a Dictionary with "key, display name" pairs for the search results. Called when the user enters search terms in the Help menu.
action_callback has the following arguments: String key. Called when the user selects a search result in the Help menu.
Note: This method is implemented only on macOS.
Vector2i ime_get_selection() const 🔗
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.
Note: This method is implemented only on macOS.
Returns the composition string contained within the Input Method Editor window.
Note: This method is implemented only on macOS.
Devuelve true si el sistema operativo está usando el modo oscuro.
Nota: Este método solo está implementado en Android, iOS, macOS, Windows y Linux (X11/Wayland).
bool is_dark_mode_supported() const 🔗
Devuelve true si el sistema operativo usa el modo oscuro.
Nota: Este método está implementado en Android, iOS, macOS, Windows y Linux (X11/Wayland).
bool is_touchscreen_available() const 🔗
Devuelve true si los eventos táctiles están disponibles (Android o iOS), la capacidad se detecta en la plataforma web o si ProjectSettings.input_devices/pointing/emulate_touch_from_mouse es true.
bool is_window_transparency_available() const 🔗
Devuelve true si el fondo de la ventana puede ser transparente. Este método devuelve false si ProjectSettings.display/window/per_pixel_transparency/allowed está establecido a false, o si la transparencia no es compatible con el renderizador o el compositor del sistema operativo.
int keyboard_get_current_layout() const 🔗
Devuelve el índice de la disposición del teclado activa.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
Key keyboard_get_keycode_from_physical(keycode: Key) const 🔗
Convierte un keycode físico (US QWERTY) a uno en la disposición del teclado activa.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
Key keyboard_get_label_from_physical(keycode: Key) const 🔗
Convierte un keycode físico (US QWERTY) a la etiqueta localizada impresa en la tecla en la disposición del teclado activa.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
int keyboard_get_layout_count() const 🔗
Devuelve el número de distribuciones de teclado.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
String keyboard_get_layout_language(index: int) const 🔗
Devuelve el código de idioma ISO-639/BCP-47 de la distribución de teclado en la posición index.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
String keyboard_get_layout_name(index: int) const 🔗
Devuelve el nombre localizado de la distribución de teclado en la posición index.
Note: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
void keyboard_set_current_layout(index: int) 🔗
Establece la distribución de teclado activa.
Nota: Este método está implementado en Linux (X11/Wayland), macOS y Windows.
BitField[MouseButtonMask] mouse_get_button_state() const 🔗
Devuelve el estado actual de los botones del ratón (si cada botón está presionado) como una máscara de bits. Si se presionan varios botones del ratón al mismo tiempo, los bits se suman. Equivalente a Input.get_mouse_button_mask().
MouseMode mouse_get_mode() const 🔗
Devuelve el modo actual del ratón. Véase también mouse_set_mode().
Vector2i mouse_get_position() const 🔗
Devuelve la posición actual del cursor del ratón en coordenadas de pantalla.
void mouse_set_mode(mouse_mode: MouseMode) 🔗
Establece el modo actual del ratón. Véase también mouse_get_mode().
void process_events() 🔗
Realiza el procesamiento del administrador de ventanas, incluyendo el vaciado de entrada. Véase también force_process_and_drop_events(), Input.flush_buffered_events() y Input.use_accumulated_input.
void register_additional_output(object: Object) 🔗
Registra un Object que representa una salida adicional que también se renderizará, más allá de las ventanas normales. El Object solo se utiliza como un identificador, que puede ser pasado más tarde a unregister_additional_output().
Esto se puede usar para evitar que Godot omita el renderizado cuando no hay ventanas normales visibles.
int screen_get_dpi(screen: int = -1) const 🔗
Returns the dots per inch density of the specified screen. Returns platform specific default value if screen is invalid.
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: On macOS, returned value is inaccurate if fractional display scaling mode is used.
Note: On Android devices, the actual screen densities are grouped into six generalized densities:
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
Note: This method is implemented on Android, iOS, Linux (X11/Wayland), macOS, Web, and Windows. On other platforms, this method always returns 72.
Image screen_get_image(screen: int = -1) const 🔗
Returns a screenshot of the screen. Returns null if screen is invalid or the DisplayServer fails to capture screenshot.
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: This method is implemented on Linux (X11, excluding XWayland), macOS, and Windows. On other platforms, this method always returns null.
Note: On macOS, this method requires the "Screen Recording" permission. If permission is not granted, this method returns a screenshot that will not include other application windows or OS elements not related to the application.
Image screen_get_image_rect(rect: Rect2i) const 🔗
Returns a screenshot of the screen region defined by rect. Returns null if rect is outside screen bounds or the DisplayServer fails to capture screenshot.
Note: This method is implemented on macOS and Windows. On other platforms, this method always returns null.
Note: On macOS, this method requires the "Screen Recording" permission. If permission is not granted, this method returns a screenshot that will not include other application windows or OS elements not related to the application.
float screen_get_max_scale() const 🔗
Returns the greatest scale factor of all screens.
Note: On macOS returned value is 2.0 if there is at least one hiDPI (Retina) screen in the system, and 1.0 in all other cases.
Note: This method is implemented only on macOS.
ScreenOrientation screen_get_orientation(screen: int = -1) const 🔗
Returns the screen's current orientation. See also screen_set_orientation(). Returns SCREEN_LANDSCAPE if screen is invalid.
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: This method is implemented on Android and iOS. On other platforms, this method always returns SCREEN_LANDSCAPE.
Color screen_get_pixel(position: Vector2i) const 🔗
Returns color of the display pixel at the position.
Note: This method is implemented on Linux (X11, excluding XWayland), macOS, and Windows. On other platforms, this method always returns Color.
Note: On macOS, this method requires the "Screen Recording" permission. If permission is not granted, this method returns a screenshot that will only contain the desktop wallpaper, the current application's window, and other related UI elements.
Vector2i screen_get_position(screen: int = -1) const 🔗
Returns the screen's top-left corner position in pixels. Returns Vector2i.ZERO if screen is invalid. 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 might be located outside any display like this:
* (0, 0) +-------+
| |
+-------------+ | |
| | | |
| | | |
+-------------+ +-------+
See also screen_get_size().
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
float screen_get_refresh_rate(screen: int = -1) const 🔗
Returns the current refresh rate of the specified screen. Returns -1.0 if screen is invalid or the DisplayServer fails to find the refresh rate for the specified screen.
To fallback to a default refresh rate if the method fails, try:
var refresh_rate = DisplayServer.screen_get_refresh_rate()
if refresh_rate < 0:
refresh_rate = 60.0
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: This method is implemented on Android, iOS, macOS, Linux (X11 and Wayland), and Windows. On other platforms, this method always returns -1.0.
float screen_get_scale(screen: int = -1) const 🔗
Returns the scale factor of the specified screen by index. Returns 1.0 if screen is invalid.
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: On macOS, the returned value is 2.0 for hiDPI (Retina) screens, and 1.0 for all other cases.
Note: On Linux (Wayland), the returned value is accurate only when screen is SCREEN_OF_MAIN_WINDOW. Due to API limitations, passing a direct index will return a rounded-up integer, if the screen has a fractional scale (e.g. 1.25 would get rounded up to 2.0).
Note: This method is implemented on Android, iOS, Web, macOS, and Linux (Wayland). On other platforms, this method always returns 1.0.
Vector2i screen_get_size(screen: int = -1) const 🔗
Returns the screen's size in pixels. See also screen_get_position() and screen_get_usable_rect(). Returns Vector2i.ZERO if screen is invalid.
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Rect2i screen_get_usable_rect(screen: int = -1) const 🔗
Returns the portion of the screen that is not obstructed by a status bar in pixels. See also screen_get_size().
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: This method is implemented on Linux/X11, macOS, and Windows. On other platforms, this method always returns Rect2i(screen_get_position(screen), screen_get_size(screen)).
bool screen_is_kept_on() const 🔗
Returns true if the screen should never be turned off by the operating system's power-saving measures. See also screen_set_keep_on().
void screen_set_keep_on(enable: bool) 🔗
Sets whether the screen should never be turned off by the operating system's power-saving measures. See also screen_is_kept_on().
void screen_set_orientation(orientation: ScreenOrientation, screen: int = -1) 🔗
Sets the screen's orientation. See also screen_get_orientation().
Note: One of the following constants can be used as screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS, or SCREEN_WITH_KEYBOARD_FOCUS.
Note: This method is implemented on Android and iOS.
Note: On iOS, this method has no effect if ProjectSettings.display/window/handheld/orientation is not set to SCREEN_SENSOR.
void set_hardware_keyboard_connection_change_callback(callable: Callable) 🔗
Sets the callable that should be called when hardware keyboard is connected/disconnected. callable should accept a single bool parameter indicating whether the keyboard is connected (true) or disconnected (false).
Note: This method is only implemented on Android.
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 set_native_icon() instead.
Note: Requires support for FEATURE_ICON.
void set_native_icon(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, set_native_icon() 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 set_icon() instead.
Note: Requires support for FEATURE_NATIVE_ICON.
void set_system_theme_change_callback(callable: Callable) 🔗
Sets the callable that should be called when system theme settings are changed. Callback method should have zero arguments.
Note: This method is implemented on Android, iOS, macOS, Windows, and Linux (X11/Wayland).
void show_emoji_and_symbol_picker() const 🔗
Opens system emoji and symbol picker.
Note: This method is implemented on macOS and Windows.
Rect2 status_indicator_get_rect(id: int) const 🔗
Returns the rectangle for the given status indicator id in screen coordinates. If the status indicator is not visible, returns an empty Rect2.
Note: This method is implemented on macOS and Windows.
void status_indicator_set_callback(id: int, callback: Callable) 🔗
Sets the application status indicator activation callback. callback should take two arguments: int mouse button index (one of MouseButton values) and Vector2i click position in screen coordinates.
Note: This method is implemented on macOS and Windows.
void status_indicator_set_icon(id: int, icon: Texture2D) 🔗
Sets the application status indicator icon.
Note: This method is implemented on macOS and Windows.
Sets the application status indicator native popup menu.
Note: On macOS, the menu is activated by any mouse button. Its activation callback is not triggered.
Note: On Windows, the menu is activated by the right mouse button, selecting the status icon and pressing Shift + F10, or the applications key. The menu's activation callback for the other mouse buttons is still triggered.
Note: Native popup is only supported if NativeMenu supports the NativeMenu.FEATURE_POPUP_MENU feature.
void status_indicator_set_tooltip(id: int, tooltip: String) 🔗
Sets the application status indicator tooltip.
Note: This method is implemented on macOS and Windows.
String tablet_get_current_driver() const 🔗
Returns current active tablet driver name.
Note: This method is implemented only on Windows.
int tablet_get_driver_count() const 🔗
Returns the total number of available tablet drivers.
Note: This method is implemented only on Windows.
String tablet_get_driver_name(idx: int) const 🔗
Returns the tablet driver name for the given index.
Note: This method is implemented only on Windows.
void tablet_set_current_driver(name: String) 🔗
Set active tablet driver name.
Supported drivers:
winink: Windows Ink API, default.wintab: Wacom Wintab API (compatible device driver required).dummy: Dummy driver, tablet input is disabled.
Note: This method is implemented only on Windows.
Array[Dictionary] tts_get_voices() const 🔗
Returns an Array of voice information dictionaries.
Each Dictionary contains two String entries:
nameis voice name.idis voice identifier.languageis language code inlang_Variantformat. Thelangpart is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. TheVariantpart is an engine-dependent string describing country, region or/and dialect.
Note that Godot depends on system libraries for text-to-speech functionality. These libraries are installed by default on Windows and macOS, but not on all Linux distributions. If they are not present, this method will return an empty list. This applies to both Godot users on Linux, as well as end-users on Linux running Godot games that use text-to-speech.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
PackedStringArray tts_get_voices_for_language(language: String) const 🔗
Returns a PackedStringArray of voice identifiers for the language.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
Returns true if the synthesizer is in a paused state.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
bool tts_is_speaking() const 🔗
Returns true if the synthesizer is generating speech, or have utterance waiting in the queue.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void tts_pause() 🔗
Puts the synthesizer into a paused state.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void tts_resume() 🔗
Resumes the synthesizer if it was paused.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void tts_set_utterance_callback(event: TTSUtteranceEvent, callable: Callable) 🔗
Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
TTS_UTTERANCE_STARTED, TTS_UTTERANCE_ENDED, and TTS_UTTERANCE_CANCELED callable's method should take one int parameter, the utterance ID.
TTS_UTTERANCE_BOUNDARY callable's method should take two int parameters, the index of the character and the utterance ID.
Note: The granularity of the boundary callbacks is engine dependent.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void tts_speak(text: String, voice: String, volume: int = 50, pitch: float = 1.0, rate: float = 1.0, utterance_id: int = 0, interrupt: bool = false) 🔗
Adds an utterance to the queue. If interrupt is true, the queue is cleared first.
voiceidentifier is one of the"id"values returned by tts_get_voices() or one of the values returned by tts_get_voices_for_language().volumeranges from0(lowest) to100(highest).pitchranges from0.0(lowest) to2.0(highest),1.0is default pitch for the current voice.rateranges from0.1(lowest) to10.0(highest),1.0is a normal speaking rate. Other values act as a percentage relative.utterance_idis passed as a parameter to the callback functions.
Note: On Windows and Linux (X11/Wayland), utterance text can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling tts_speak().
Note: The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void tts_stop() 🔗
Stops synthesis in progress and removes all utterances from the queue.
Note: This method is implemented on Android, iOS, Web, Linux (X11/Wayland), macOS, and Windows.
void unregister_additional_output(object: Object) 🔗
Unregisters an Object representing an additional output, that was registered via register_additional_output().
int virtual_keyboard_get_height() const 🔗
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
Note: On Android 7 and 8, the keyboard height may return 0 the first time the keyboard is opened in non-immersive mode. This behavior does not occur in immersive mode.
void virtual_keyboard_hide() 🔗
Oculta el teclado virtual si se muestra, no hace nada más.
void virtual_keyboard_show(existing_text: String, position: Rect2 = Rect2(0, 0, 0, 0), type: VirtualKeyboardType = 0, max_length: int = -1, cursor_start: int = -1, cursor_end: int = -1) 🔗
Shows the virtual keyboard if the platform has one.
existing_text parameter is useful for implementing your own LineEdit or TextEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
position parameter is the screen space Rect2 of the edited text.
type parameter allows configuring which type of virtual keyboard to show.
max_length limits the number of characters that can be entered if different from -1.
cursor_start can optionally define the current text cursor position if cursor_end is not set.
cursor_start and cursor_end can optionally define the current text selection.
Note: This method is implemented on Android, iOS and Web.
void warp_mouse(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.
Note: warp_mouse() is only supported on Windows, macOS, and Linux (X11/Wayland). It has no effect on Android, iOS, and Web.
bool window_can_draw(window_id: int = 0) const 🔗
Devuelve true si se puede dibujar algo en la ventana especificada window_id, false en caso contrario. Usar el argumento línea de comandos --disable-render-loop o una compilación devolverá false.
int window_get_active_popup() const 🔗
Devuelve el ID de la ventana emergente activa, o INVALID_WINDOW_ID si no hay ninguna.
int window_get_attached_instance_id(window_id: int = 0) const 🔗
Devuelve el Object.get_instance_id() de la Window al que está adjunto window_id.
int window_get_current_screen(window_id: int = 0) const 🔗
Devuelve la pantalla en la que se encuentra actualmente la ventana especificada por window_id. Si la pantalla se superpone a varias pantallas, se devuelve la pantalla en la que se encuentra el centro de la ventana. Véase también window_set_current_screen(). Devuelve INVALID_SCREEN si window_id no es válido.
Nota: Este método está implementado en Linux/X11, macOS y Windows. En otras plataformas, este método siempre devuelve 0.
bool window_get_flag(flag: WindowFlags, window_id: int = 0) const 🔗
Devuelve el valor actual del flag de la ventana dada.
Vector2i window_get_max_size(window_id: int = 0) const 🔗
Devuelve el tamaño máximo de la ventana (en píxeles). Véase también window_set_max_size().
Vector2i window_get_min_size(window_id: int = 0) const 🔗
Devuelve el tamaño mínimo de la ventana (en píxeles). Véase también window_set_min_size().
WindowMode window_get_mode(window_id: int = 0) const 🔗
Devuelve el modo de la ventana dada.
int window_get_native_handle(handle_type: HandleType, window_id: int = 0) const 🔗
Devuelve punteros a la estructura interna para su uso en plugins.
Nota: Este método está implementado en Android, Linux (X11/Wayland), macOS y Windows.
Rect2i window_get_popup_safe_rect(window: int) const 🔗
Devuelve el cuadro delimitador del control, o el elemento del menú que se utilizó para abrir la ventana emergente, en el sistema de coordenadas de la pantalla.
Vector2i window_get_position(window_id: int = 0) const 🔗
Devuelve la posición del área del cliente de la ventana dada en la pantalla.
Vector2i window_get_position_with_decorations(window_id: int = 0) const 🔗
Devuelve la posición de la ventana dada en la pantalla, incluyendo los bordes dibujados por el sistema operativo. Véase también window_get_position().
Vector3i window_get_safe_title_margins(window_id: int = 0) const 🔗
Devuelve los márgenes izquierdos (x), los márgenes derechos (y) y la altura (z) del título que son seguros de usar (no contiene botones u otros elementos) cuando la bandera WINDOW_FLAG_EXTEND_TO_TITLE está establecida.
Vector2i window_get_size(window_id: int = 0) const 🔗
Devuelve el tamaño de la ventana especificada por window_id (en píxeles), excluyendo los bordes dibujados por el sistema operativo. Esto también se llama el "área del cliente". Véase también window_get_size_with_decorations(), window_set_size() y window_get_position().
Vector2i window_get_size_with_decorations(window_id: int = 0) const 🔗
Devuelve el tamaño de la ventana especificada por window_id (en píxeles), incluyendo los bordes dibujados por el sistema operativo. Véase también window_get_size().
Vector2i window_get_title_size(title: String, window_id: int = 0) const 🔗
Devuelve el tamaño estimado de la barra de título de la ventana (incluyendo el texto y los botones de la ventana) para la ventana especificada por window_id (en píxeles). Este método no cambia el título de la ventana.
Nota: Este método está implementado en macOS y Windows.
VSyncMode window_get_vsync_mode(window_id: int = 0) const 🔗
Devuelve el modo V-Sync de la ventana dada.
bool window_is_focused(window_id: int = 0) const 🔗
Devuelve true si la ventana especificada por window_id está enfocada.
bool window_is_maximize_allowed(window_id: int = 0) const 🔗
Devuelve true si la ventana dada puede ser maximizada (el botón de maximizar está habilitado).
bool window_maximize_on_title_dbl_click() const 🔗
Devuelve true si el doble clic en el título de una ventana debería maximizarla.
Nota: Este método solo está implementado en macOS.
bool window_minimize_on_title_dbl_click() const 🔗
Devuelve true si el doble clic en el título de una ventana debería minimizarla.
Nota: Este método solo está implementado en macOS.
void window_move_to_foreground(window_id: int = 0) 🔗
Mueve la ventana especificada por window_id al frente, de forma que sea visible sobre otras ventanas.
void window_request_attention(window_id: int = 0) 🔗
Hace que la ventana especificada por window_id solicite atención, lo que se materializa mediante el parpadeo del título de la ventana y la entrada de la barra de tareas hasta que la ventana esté enfocada. Esto normalmente no tiene un efecto visible si la ventana está actualmente enfocada. El comportamiento exacto varía según el sistema operativo.
void window_set_current_screen(screen: int, window_id: int = 0) 🔗
Mueve la ventana especificada por window_id a la screen especificada. Véase también window_get_current_screen().
Nota: Se puede utilizar una de las siguientes constantes como screen: SCREEN_OF_MAIN_WINDOW, SCREEN_PRIMARY, SCREEN_WITH_MOUSE_FOCUS o SCREEN_WITH_KEYBOARD_FOCUS.
Nota: Este método está implementado en Linux/X11, macOS y Windows.
void window_set_drop_files_callback(callback: Callable, window_id: int = 0) 🔗
Establece la callback que debe llamarse cuando se sueltan archivos desde el administrador de archivos del sistema operativo en la ventana especificada por window_id. callback debe tomar un argumento PackedStringArray, que es la lista de archivos soltados.
Advertencia: ¡Solo para usuarios avanzados! Agregar tal callback a un nodo Window anulará su implementación por defecto, lo que puede introducir errores.
Nota: Este método está implementado en Windows, macOS, Linux (X11/Wayland) y Web.
void window_set_exclusive(window_id: int, exclusive: bool) 🔗
Si se establece en true, esta ventana siempre permanecerá encima de su ventana padre, la ventana padre ignorará la entrada mientras esta ventana esté abierta.
Nota: En macOS, las ventanas exclusivas están confinadas al mismo espacio (escritorio virtual o pantalla) que la ventana padre.
Nota: Este método está implementado en macOS y Windows.
void window_set_flag(flag: WindowFlags, enabled: bool, window_id: int = 0) 🔗
Activa o desactiva la flag dado de la ventana dada.
void window_set_ime_active(active: bool, window_id: int = 0) 🔗
Establece si el Editor de Método de Entrada debe estar habilitado para la ventana especificada por window_id. Véase también window_set_ime_position().
void window_set_ime_position(position: Vector2i, window_id: int = 0) 🔗
Establece la posición de la ventana emergente del Editor de Método de Entrada para el window_id especificado. Solo es efectivo si window_set_ime_active() se estableció en true para el window_id especificado.
void window_set_input_event_callback(callback: Callable, window_id: int = 0) 🔗
Establece la callback que debe llamarse cuando cualquier InputEvent se envíe a la ventana especificada por window_id.
Advertencia: ¡Solo para usuarios avanzados! Agregar tal callback a un nodo Window anulará su implementación por defecto, lo que puede introducir errores.
void window_set_input_text_callback(callback: Callable, window_id: int = 0) 🔗
Establece la callback que debe llamarse cuando se introduce texto utilizando el teclado virtual en la ventana especificada por window_id.
Advertencia: ¡Solo para usuarios avanzados! Agregar tal callback a un nodo Window anulará su implementación por defecto, lo que puede introducir errores.
void window_set_max_size(max_size: Vector2i, window_id: int = 0) 🔗
Establece el tamaño máximo de la ventana especificada por window_id en píxeles. Normalmente, el usuario no podrá arrastrar la ventana para hacerla más grande que el tamaño especificado. Véase también window_get_max_size().
Nota: Se recomienda cambiar este valor utilizando Window.max_size en su lugar.
Nota: Utilizando herramientas de terceros, es posible que los usuarios deshabiliten las restricciones de geometría de la ventana y, por lo tanto, eviten este límite.
void window_set_min_size(min_size: Vector2i, window_id: int = 0) 🔗
Establece el tamaño mínimo para la ventana dada a min_size en píxeles. Normalmente, el usuario no podrá arrastrar la ventana para hacerla más pequeña que el tamaño especificado. Véase también window_get_min_size().
Nota: Se recomienda cambiar este valor usando Window.min_size en su lugar.
Nota: Por defecto, la ventana principal tiene un tamaño mínimo de Vector2i(64, 64). Esto evita problemas que pueden surgir cuando la ventana se redimensiona a un tamaño cercano a cero.
Nota: Usando herramientas de terceros, es posible que los usuarios deshabiliten las restricciones de geometría de la ventana y por lo tanto eviten este límite.
void window_set_mode(mode: WindowMode, window_id: int = 0) 🔗
Establece el modo de ventana para la ventana dada a mode.
Nota: En Android, establecerlo en WINDOW_MODE_FULLSCREEN o WINDOW_MODE_EXCLUSIVE_FULLSCREEN activará el modo inmersivo.
Nota: Establecer la ventana en pantalla completa establece forzosamente la bandera sin bordes a true, así que asegúrate de volver a establecerlo en false cuando no se desee.
void window_set_mouse_passthrough(region: PackedVector2Array, window_id: int = 0) 🔗
Establece una región poligonal de la ventana que acepta eventos del ratón. Los eventos del ratón fuera de la región se pasarán a través.
Pasar un array vacío desactivará el soporte de passthrough (todos los eventos del ratón serán interceptados por la ventana, que es el comportamiento por defecto).
# Establecer la región, usando el nodo Path2D.
DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
# Establecer la región, usando el nodo Polygon2D.
DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
# Restablecer la región a su valor por defecto.
DisplayServer.window_set_mouse_passthrough([])
// Establecer la región, usando el nodo Path2D.
DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
// Establecer la región, usando el nodo Polygon2D.
DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
// Restablecer la región a su valor por defecto.
DisplayServer.WindowSetMousePassthrough([]);
Nota: En Windows, la porción de una ventana que se encuentra fuera de la región no se dibuja, mientras que en Linux (X11) y macOS sí lo hace.
Nota: Este método está implementado en Linux (X11), macOS y Windows.
void window_set_popup_safe_rect(window: int, rect: Rect2i) 🔗
Establece el cuadro delimitador del control, o el elemento del menú que se utilizó para abrir la ventana emergente, en el sistema de coordenadas de la pantalla. Hacer clic en esta área no cerrará automáticamente esta ventana emergente.
void window_set_position(position: Vector2i, window_id: int = 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:
* (0, 0) +-------+
| |
+-------------+ | |
| | | |
| | | |
+-------------+ +-------+
See also window_get_position() and window_set_size().
Note: It's recommended to change this value using Window.position instead.
Note: On Linux (Wayland): this method is a no-op.
void window_set_rect_changed_callback(callback: Callable, window_id: int = 0) 🔗
Sets the callback that will be called when the window specified by window_id is moved or resized.
Warning: Advanced users only! Adding such a callback to a Window node will override its default implementation, which can introduce bugs.
void window_set_size(size: Vector2i, window_id: int = 0) 🔗
Establece el tamaño de la ventana dada a size (en píxeles). Véase también window_get_size() y window_get_position().
Nota: Se recomienda cambiar este valor usando Window.size en su lugar.
void window_set_title(title: String, window_id: int = 0) 🔗
Establece el título de la ventana dada a title.
Nota: Se recomienda cambiar este valor usando Window.title en su lugar.
Nota: Evita cambiar el título de la ventana cada fotograma, ya que esto puede causar problemas de rendimiento en ciertos administradores de ventanas. Intenta cambiar el título de la ventana solo unas pocas veces por segundo como máximo.
void window_set_transient(window_id: int, parent_window_id: int) 🔗
Sets window transient parent. Transient window 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.
Note: It's recommended to change this value using Window.transient instead.
Note: The behavior might be different depending on the platform.
void window_set_vsync_mode(vsync_mode: VSyncMode, window_id: int = 0) 🔗
Sets the V-Sync mode of the given window. See also ProjectSettings.display/window/vsync/vsync_mode.
Depending on the platform and used renderer, the engine will fall back to VSYNC_ENABLED if the desired mode is not supported.
Note: V-Sync modes other than VSYNC_ENABLED are only supported in the Forward+ and Mobile rendering methods, not Compatibility.
void window_set_window_buttons_offset(offset: Vector2i, window_id: int = 0) 🔗
When WINDOW_FLAG_EXTEND_TO_TITLE flag is set, set offset to the center of the first titlebar button.
Note: This flag is implemented only on macOS.
void window_set_window_event_callback(callback: Callable, window_id: int = 0) 🔗
Sets the callback that will be called when an event occurs in the window specified by window_id.
Warning: Advanced users only! Adding such a callback to a Window node will override its default implementation, which can introduce bugs.
void window_start_drag(window_id: int = 0) 🔗
Starts an interactive drag operation on the window with the given window_id, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features.
Note: This method is implemented on Linux (X11/Wayland), macOS, and Windows.
void window_start_resize(edge: WindowResizeEdge, window_id: int = 0) 🔗
Starts an interactive resize operation on the window with the given window_id, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's edge.
Note: This method is implemented on Linux (X11/Wayland), macOS, and Windows.