:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Window.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Window: Window ====== **Inherits:** :ref:`Viewport` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`AcceptDialog`, :ref:`Popup` Base class for all windows. Description ----------- A node that creates a window. Properties ---------- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`always_on_top` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`auto_translate` | ``true`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`borderless` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`ContentScaleAspect` | :ref:`content_scale_aspect` | ``0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`float` | :ref:`content_scale_factor` | ``1.0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`ContentScaleMode` | :ref:`content_scale_mode` | ``0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Vector2i` | :ref:`content_scale_size` | ``Vector2i(0, 0)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`int` | :ref:`current_screen` | ``0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`exclusive` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Vector2i` | :ref:`max_size` | ``Vector2i(0, 0)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Vector2i` | :ref:`min_size` | ``Vector2i(0, 0)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Mode` | :ref:`mode` | ``0`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`popup_window` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Vector2i` | :ref:`position` | ``Vector2i(0, 0)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Vector2i` | :ref:`size` | ``Vector2i(100, 100)`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`Theme` | :ref:`theme` | | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`StringName` | :ref:`theme_type_variation` | ``&""`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`String` | :ref:`title` | ``""`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`transient` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`transparent` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`unfocusable` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`unresizable` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`visible` | ``true`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ | :ref:`bool` | :ref:`wrap_controls` | ``false`` | +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+ Methods ------- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`can_draw` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`child_controls_changed` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_contents_minimum_size` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_flag` **(** :ref:`Flags` flag **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`LayoutDirection` | :ref:`get_layout_direction` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`get_real_size` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_theme_color` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_theme_constant` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_theme_default_base_scale` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Font` | :ref:`get_theme_default_font` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_theme_default_font_size` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Font` | :ref:`get_theme_font` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_theme_font_size` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :ref:`get_theme_icon` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StyleBox` | :ref:`get_theme_stylebox` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`grab_focus` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_focus` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_color` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_constant` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_font` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_font_size` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_icon` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_theme_stylebox` **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`hide` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_embedded` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_layout_rtl` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_maximize_allowed` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_using_font_oversampling` **(** **)** |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_to_foreground` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup` **(** :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup_centered` **(** :ref:`Vector2i` minsize=Vector2i(0, 0) **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup_centered_clamped` **(** :ref:`Vector2i` minsize=Vector2i(0, 0), :ref:`float` fallback_ratio=0.75 **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup_centered_ratio` **(** :ref:`float` ratio=0.8 **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`popup_on_parent` **(** :ref:`Rect2i` parent_rect **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`request_attention` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reset_size` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flag` **(** :ref:`Flags` flag, :ref:`bool` enabled **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_ime_active` **(** :ref:`bool` active **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_ime_position` **(** :ref:`Vector2i` position **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_layout_direction` **(** :ref:`LayoutDirection` direction **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_use_font_oversampling` **(** :ref:`bool` enable **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`show` **(** **)** | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Color` | :ref:`title_color` | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Color` | :ref:`title_outline_modulate` | ``Color(1, 1, 1, 1)`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`close_h_ofs` | ``18`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`close_v_ofs` | ``24`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`resize_margin` | ``4`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`scaleborder_size` | ``4`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`title_height` | ``36`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`title_outline_size` | ``0`` | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Font` | :ref:`title_font` | | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`title_font_size` | | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Texture2D` | :ref:`close` | | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`Texture2D` | :ref:`close_pressed` | | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`embedded_border` | | +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+ Signals ------- .. _class_Window_signal_about_to_popup: - **about_to_popup** **(** **)** ---- .. _class_Window_signal_close_requested: - **close_requested** **(** **)** ---- .. _class_Window_signal_files_dropped: - **files_dropped** **(** :ref:`PackedStringArray` files **)** Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths. ---- .. _class_Window_signal_focus_entered: - **focus_entered** **(** **)** ---- .. _class_Window_signal_focus_exited: - **focus_exited** **(** **)** ---- .. _class_Window_signal_go_back_requested: - **go_back_requested** **(** **)** ---- .. _class_Window_signal_mouse_entered: - **mouse_entered** **(** **)** ---- .. _class_Window_signal_mouse_exited: - **mouse_exited** **(** **)** ---- .. _class_Window_signal_theme_changed: - **theme_changed** **(** **)** ---- .. _class_Window_signal_visibility_changed: - **visibility_changed** **(** **)** ---- .. _class_Window_signal_window_input: - **window_input** **(** :ref:`InputEvent` event **)** Enumerations ------------ .. _enum_Window_Mode: .. _class_Window_constant_MODE_WINDOWED: .. _class_Window_constant_MODE_MINIMIZED: .. _class_Window_constant_MODE_MAXIMIZED: .. _class_Window_constant_MODE_FULLSCREEN: .. _class_Window_constant_MODE_EXCLUSIVE_FULLSCREEN: enum **Mode**: - **MODE_WINDOWED** = **0** --- Windowed mode. - **MODE_MINIMIZED** = **1** --- Minimized window mode. - **MODE_MAXIMIZED** = **2** --- Maximized window mode. - **MODE_FULLSCREEN** = **3** --- Fullscreen window mode. Note that this is not *exclusive* fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling fullscreen mode. - **MODE_EXCLUSIVE_FULLSCREEN** = **4** --- Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to :ref:`MODE_FULLSCREEN`. Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence. Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling fullscreen mode. ---- .. _enum_Window_Flags: .. _class_Window_constant_FLAG_RESIZE_DISABLED: .. _class_Window_constant_FLAG_BORDERLESS: .. _class_Window_constant_FLAG_ALWAYS_ON_TOP: .. _class_Window_constant_FLAG_TRANSPARENT: .. _class_Window_constant_FLAG_NO_FOCUS: .. _class_Window_constant_FLAG_POPUP: .. _class_Window_constant_FLAG_MAX: enum **Flags**: - **FLAG_RESIZE_DISABLED** = **0** --- The window's ability to be resized. - **FLAG_BORDERLESS** = **1** --- Borderless window. - **FLAG_ALWAYS_ON_TOP** = **2** --- Flag for making the window always on top of all other windows. - **FLAG_TRANSPARENT** = **3** - **FLAG_NO_FOCUS** = **4** - **FLAG_POPUP** = **5** - **FLAG_MAX** = **6** ---- .. _enum_Window_ContentScaleMode: .. _class_Window_constant_CONTENT_SCALE_MODE_DISABLED: .. _class_Window_constant_CONTENT_SCALE_MODE_CANVAS_ITEMS: .. _class_Window_constant_CONTENT_SCALE_MODE_VIEWPORT: enum **ContentScaleMode**: - **CONTENT_SCALE_MODE_DISABLED** = **0** - **CONTENT_SCALE_MODE_CANVAS_ITEMS** = **1** - **CONTENT_SCALE_MODE_VIEWPORT** = **2** ---- .. _enum_Window_ContentScaleAspect: .. _class_Window_constant_CONTENT_SCALE_ASPECT_IGNORE: .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP: .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_WIDTH: .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_HEIGHT: .. _class_Window_constant_CONTENT_SCALE_ASPECT_EXPAND: enum **ContentScaleAspect**: - **CONTENT_SCALE_ASPECT_IGNORE** = **0** - **CONTENT_SCALE_ASPECT_KEEP** = **1** - **CONTENT_SCALE_ASPECT_KEEP_WIDTH** = **2** - **CONTENT_SCALE_ASPECT_KEEP_HEIGHT** = **3** - **CONTENT_SCALE_ASPECT_EXPAND** = **4** ---- .. _enum_Window_LayoutDirection: .. _class_Window_constant_LAYOUT_DIRECTION_INHERITED: .. _class_Window_constant_LAYOUT_DIRECTION_LOCALE: .. _class_Window_constant_LAYOUT_DIRECTION_LTR: .. _class_Window_constant_LAYOUT_DIRECTION_RTL: enum **LayoutDirection**: - **LAYOUT_DIRECTION_INHERITED** = **0** --- Automatic layout direction, determined from the parent window layout direction. - **LAYOUT_DIRECTION_LOCALE** = **1** --- Automatic layout direction, determined from the current locale. - **LAYOUT_DIRECTION_LTR** = **2** --- Left-to-right layout direction. - **LAYOUT_DIRECTION_RTL** = **3** --- Right-to-left layout direction. Constants --------- .. _class_Window_constant_NOTIFICATION_VISIBILITY_CHANGED: - **NOTIFICATION_VISIBILITY_CHANGED** = **30** Property Descriptions --------------------- .. _class_Window_property_always_on_top: - :ref:`bool` **always_on_top** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ If ``true``, the window will be on top of all other windows. ---- .. _class_Window_property_auto_translate: - :ref:`bool` **auto_translate** +-----------+---------------------------+ | *Default* | ``true`` | +-----------+---------------------------+ | *Setter* | set_auto_translate(value) | +-----------+---------------------------+ | *Getter* | is_auto_translating() | +-----------+---------------------------+ Toggles if any text should automatically change to its translated version depending on the current locale. ---- .. _class_Window_property_borderless: - :ref:`bool` **borderless** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ If ``true``, the window will have no borders. ---- .. _class_Window_property_content_scale_aspect: - :ref:`ContentScaleAspect` **content_scale_aspect** +-----------+---------------------------------+ | *Default* | ``0`` | +-----------+---------------------------------+ | *Setter* | set_content_scale_aspect(value) | +-----------+---------------------------------+ | *Getter* | get_content_scale_aspect() | +-----------+---------------------------------+ ---- .. _class_Window_property_content_scale_factor: - :ref:`float` **content_scale_factor** +-----------+---------------------------------+ | *Default* | ``1.0`` | +-----------+---------------------------------+ | *Setter* | set_content_scale_factor(value) | +-----------+---------------------------------+ | *Getter* | get_content_scale_factor() | +-----------+---------------------------------+ ---- .. _class_Window_property_content_scale_mode: - :ref:`ContentScaleMode` **content_scale_mode** +-----------+-------------------------------+ | *Default* | ``0`` | +-----------+-------------------------------+ | *Setter* | set_content_scale_mode(value) | +-----------+-------------------------------+ | *Getter* | get_content_scale_mode() | +-----------+-------------------------------+ ---- .. _class_Window_property_content_scale_size: - :ref:`Vector2i` **content_scale_size** +-----------+-------------------------------+ | *Default* | ``Vector2i(0, 0)`` | +-----------+-------------------------------+ | *Setter* | set_content_scale_size(value) | +-----------+-------------------------------+ | *Getter* | get_content_scale_size() | +-----------+-------------------------------+ ---- .. _class_Window_property_current_screen: - :ref:`int` **current_screen** +-----------+---------------------------+ | *Default* | ``0`` | +-----------+---------------------------+ | *Setter* | set_current_screen(value) | +-----------+---------------------------+ | *Getter* | get_current_screen() | +-----------+---------------------------+ The screen the window is currently on. ---- .. _class_Window_property_exclusive: - :ref:`bool` **exclusive** +-----------+----------------------+ | *Default* | ``false`` | +-----------+----------------------+ | *Setter* | set_exclusive(value) | +-----------+----------------------+ | *Getter* | is_exclusive() | +-----------+----------------------+ ---- .. _class_Window_property_max_size: - :ref:`Vector2i` **max_size** +-----------+---------------------+ | *Default* | ``Vector2i(0, 0)`` | +-----------+---------------------+ | *Setter* | set_max_size(value) | +-----------+---------------------+ | *Getter* | get_max_size() | +-----------+---------------------+ ---- .. _class_Window_property_min_size: - :ref:`Vector2i` **min_size** +-----------+---------------------+ | *Default* | ``Vector2i(0, 0)`` | +-----------+---------------------+ | *Setter* | set_min_size(value) | +-----------+---------------------+ | *Getter* | get_min_size() | +-----------+---------------------+ ---- .. _class_Window_property_mode: - :ref:`Mode` **mode** +-----------+-----------------+ | *Default* | ``0`` | +-----------+-----------------+ | *Setter* | set_mode(value) | +-----------+-----------------+ | *Getter* | get_mode() | +-----------+-----------------+ Set's the window's current mode. \ **Note:** Fullscreen mode is not exclusive fullscreen on Windows and Linux. ---- .. _class_Window_property_popup_window: - :ref:`bool` **popup_window** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ ---- .. _class_Window_property_position: - :ref:`Vector2i` **position** +-----------+---------------------+ | *Default* | ``Vector2i(0, 0)`` | +-----------+---------------------+ | *Setter* | set_position(value) | +-----------+---------------------+ | *Getter* | get_position() | +-----------+---------------------+ The window's position in pixels. ---- .. _class_Window_property_size: - :ref:`Vector2i` **size** +-----------+------------------------+ | *Default* | ``Vector2i(100, 100)`` | +-----------+------------------------+ | *Setter* | set_size(value) | +-----------+------------------------+ | *Getter* | get_size() | +-----------+------------------------+ The window's size in pixels. ---- .. _class_Window_property_theme: - :ref:`Theme` **theme** +----------+------------------+ | *Setter* | set_theme(value) | +----------+------------------+ | *Getter* | get_theme() | +----------+------------------+ ---- .. _class_Window_property_theme_type_variation: - :ref:`StringName` **theme_type_variation** +-----------+---------------------------------+ | *Default* | ``&""`` | +-----------+---------------------------------+ | *Setter* | set_theme_type_variation(value) | +-----------+---------------------------------+ | *Getter* | get_theme_type_variation() | +-----------+---------------------------------+ ---- .. _class_Window_property_title: - :ref:`String` **title** +-----------+------------------+ | *Default* | ``""`` | +-----------+------------------+ | *Setter* | set_title(value) | +-----------+------------------+ | *Getter* | get_title() | +-----------+------------------+ The window's title. ---- .. _class_Window_property_transient: - :ref:`bool` **transient** +-----------+----------------------+ | *Default* | ``false`` | +-----------+----------------------+ | *Setter* | set_transient(value) | +-----------+----------------------+ | *Getter* | is_transient() | +-----------+----------------------+ ---- .. _class_Window_property_transparent: - :ref:`bool` **transparent** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ ---- .. _class_Window_property_unfocusable: - :ref:`bool` **unfocusable** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ ---- .. _class_Window_property_unresizable: - :ref:`bool` **unresizable** +-----------+-----------------+ | *Default* | ``false`` | +-----------+-----------------+ | *Setter* | set_flag(value) | +-----------+-----------------+ | *Getter* | get_flag() | +-----------+-----------------+ If ``true``, the window can't be resized. ---- .. _class_Window_property_visible: - :ref:`bool` **visible** +-----------+--------------------+ | *Default* | ``true`` | +-----------+--------------------+ | *Setter* | set_visible(value) | +-----------+--------------------+ | *Getter* | is_visible() | +-----------+--------------------+ If ``true``, the window is visible. ---- .. _class_Window_property_wrap_controls: - :ref:`bool` **wrap_controls** +-----------+--------------------------+ | *Default* | ``false`` | +-----------+--------------------------+ | *Setter* | set_wrap_controls(value) | +-----------+--------------------------+ | *Getter* | is_wrapping_controls() | +-----------+--------------------------+ Method Descriptions ------------------- .. _class_Window_method_can_draw: - :ref:`bool` **can_draw** **(** **)** |const| Returns whether the window is being drawn to the screen. ---- .. _class_Window_method_child_controls_changed: - void **child_controls_changed** **(** **)** ---- .. _class_Window_method_get_contents_minimum_size: - :ref:`Vector2` **get_contents_minimum_size** **(** **)** |const| Returns the combined minimum size from the child :ref:`Control` nodes of the window. ---- .. _class_Window_method_get_flag: - :ref:`bool` **get_flag** **(** :ref:`Flags` flag **)** |const| Returns ``true`` if the flag is set. ---- .. _class_Window_method_get_layout_direction: - :ref:`LayoutDirection` **get_layout_direction** **(** **)** |const| Returns layout direction and text writing direction. ---- .. _class_Window_method_get_real_size: - :ref:`Vector2i` **get_real_size** **(** **)** |const| Returns the window's size including its border. ---- .. _class_Window_method_get_theme_color: - :ref:`Color` **get_theme_color** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_get_theme_constant: - :ref:`int` **get_theme_constant** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_get_theme_default_base_scale: - :ref:`float` **get_theme_default_base_scale** **(** **)** |const| ---- .. _class_Window_method_get_theme_default_font: - :ref:`Font` **get_theme_default_font** **(** **)** |const| ---- .. _class_Window_method_get_theme_default_font_size: - :ref:`int` **get_theme_default_font_size** **(** **)** |const| ---- .. _class_Window_method_get_theme_font: - :ref:`Font` **get_theme_font** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| Returns the :ref:`Font` at ``name`` if the theme has ``theme_type``. ---- .. _class_Window_method_get_theme_font_size: - :ref:`int` **get_theme_font_size** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| Returns the font size at ``name`` if the theme has ``theme_type``. ---- .. _class_Window_method_get_theme_icon: - :ref:`Texture2D` **get_theme_icon** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_get_theme_stylebox: - :ref:`StyleBox` **get_theme_stylebox** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_grab_focus: - void **grab_focus** **(** **)** Causes the window to grab focus, allowing it to receive user input. ---- .. _class_Window_method_has_focus: - :ref:`bool` **has_focus** **(** **)** |const| Returns ``true`` if the window is focused. ---- .. _class_Window_method_has_theme_color: - :ref:`bool` **has_theme_color** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_has_theme_constant: - :ref:`bool` **has_theme_constant** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_has_theme_font: - :ref:`bool` **has_theme_font** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| Returns ``true`` if :ref:`Font` with ``name`` is in ``theme_type``. Returns ``false`` if the theme does not have ``theme_type``. ---- .. _class_Window_method_has_theme_font_size: - :ref:`bool` **has_theme_font_size** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| Returns ``true`` if font size with ``name`` is in ``theme_type``. Returns ``false`` if the theme does not have ``theme_type``. ---- .. _class_Window_method_has_theme_icon: - :ref:`bool` **has_theme_icon** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_has_theme_stylebox: - :ref:`bool` **has_theme_stylebox** **(** :ref:`StringName` name, :ref:`StringName` theme_type="" **)** |const| ---- .. _class_Window_method_hide: - void **hide** **(** **)** ---- .. _class_Window_method_is_embedded: - :ref:`bool` **is_embedded** **(** **)** |const| Returns ``true`` if the window is currently embedded in another window. ---- .. _class_Window_method_is_layout_rtl: - :ref:`bool` **is_layout_rtl** **(** **)** |const| Returns ``true`` if layout is right-to-left. ---- .. _class_Window_method_is_maximize_allowed: - :ref:`bool` **is_maximize_allowed** **(** **)** |const| ---- .. _class_Window_method_is_using_font_oversampling: - :ref:`bool` **is_using_font_oversampling** **(** **)** |const| ---- .. _class_Window_method_move_to_foreground: - void **move_to_foreground** **(** **)** ---- .. _class_Window_method_popup: - void **popup** **(** :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** ---- .. _class_Window_method_popup_centered: - void **popup_centered** **(** :ref:`Vector2i` minsize=Vector2i(0, 0) **)** ---- .. _class_Window_method_popup_centered_clamped: - void **popup_centered_clamped** **(** :ref:`Vector2i` minsize=Vector2i(0, 0), :ref:`float` fallback_ratio=0.75 **)** ---- .. _class_Window_method_popup_centered_ratio: - void **popup_centered_ratio** **(** :ref:`float` ratio=0.8 **)** ---- .. _class_Window_method_popup_on_parent: - void **popup_on_parent** **(** :ref:`Rect2i` parent_rect **)** ---- .. _class_Window_method_request_attention: - void **request_attention** **(** **)** ---- .. _class_Window_method_reset_size: - void **reset_size** **(** **)** Resets the size to the minimum size, which is the max of :ref:`min_size` and (if :ref:`wrap_controls` is enabled) :ref:`get_contents_minimum_size`. This is equivalent to calling ``set_size(Vector2i())`` (or any size below the minimum). ---- .. _class_Window_method_set_flag: - void **set_flag** **(** :ref:`Flags` flag, :ref:`bool` enabled **)** Sets a specified window flag. ---- .. _class_Window_method_set_ime_active: - void **set_ime_active** **(** :ref:`bool` active **)** ---- .. _class_Window_method_set_ime_position: - void **set_ime_position** **(** :ref:`Vector2i` position **)** ---- .. _class_Window_method_set_layout_direction: - void **set_layout_direction** **(** :ref:`LayoutDirection` direction **)** Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). ---- .. _class_Window_method_set_use_font_oversampling: - void **set_use_font_oversampling** **(** :ref:`bool` enable **)** ---- .. _class_Window_method_show: - void **show** **(** **)** Theme Property Descriptions --------------------------- .. _class_Window_theme_color_title_color: - :ref:`Color` **title_color** +-----------+-----------------------------------+ | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------+-----------------------------------+ ---- .. _class_Window_theme_color_title_outline_modulate: - :ref:`Color` **title_outline_modulate** +-----------+-----------------------+ | *Default* | ``Color(1, 1, 1, 1)`` | +-----------+-----------------------+ The color of the title outline. ---- .. _class_Window_theme_constant_close_h_ofs: - :ref:`int` **close_h_ofs** +-----------+--------+ | *Default* | ``18`` | +-----------+--------+ ---- .. _class_Window_theme_constant_close_v_ofs: - :ref:`int` **close_v_ofs** +-----------+--------+ | *Default* | ``24`` | +-----------+--------+ ---- .. _class_Window_theme_constant_resize_margin: - :ref:`int` **resize_margin** +-----------+-------+ | *Default* | ``4`` | +-----------+-------+ ---- .. _class_Window_theme_constant_scaleborder_size: - :ref:`int` **scaleborder_size** +-----------+-------+ | *Default* | ``4`` | +-----------+-------+ ---- .. _class_Window_theme_constant_title_height: - :ref:`int` **title_height** +-----------+--------+ | *Default* | ``36`` | +-----------+--------+ ---- .. _class_Window_theme_constant_title_outline_size: - :ref:`int` **title_outline_size** +-----------+-------+ | *Default* | ``0`` | +-----------+-------+ The size of the title outline. ---- .. _class_Window_theme_font_title_font: - :ref:`Font` **title_font** ---- .. _class_Window_theme_font_size_title_font_size: - :ref:`int` **title_font_size** The size of the title font. ---- .. _class_Window_theme_icon_close: - :ref:`Texture2D` **close** ---- .. _class_Window_theme_icon_close_pressed: - :ref:`Texture2D` **close_pressed** ---- .. _class_Window_theme_style_embedded_border: - :ref:`StyleBox` **embedded_border** .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`