1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111 |
- :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/<name>/doc_classes.
- .. _class_Window:
- Window
- ======
- **Inherits:** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`AcceptDialog<class_AcceptDialog>`, :ref:`Popup<class_Popup>`
- Base class for all windows.
- Description
- -----------
- A node that creates a window.
- Properties
- ----------
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`always_on_top<class_Window_property_always_on_top>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`auto_translate<class_Window_property_auto_translate>` | ``true`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`borderless<class_Window_property_borderless>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` | :ref:`content_scale_aspect<class_Window_property_content_scale_aspect>` | ``0`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` | :ref:`content_scale_mode<class_Window_property_content_scale_mode>` | ``0`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`content_scale_size<class_Window_property_content_scale_size>` | ``Vector2i(0, 0)`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`int<class_int>` | :ref:`current_screen<class_Window_property_current_screen>` | ``0`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`exclusive<class_Window_property_exclusive>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`max_size<class_Window_property_max_size>` | ``Vector2i(0, 0)`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`min_size<class_Window_property_min_size>` | ``Vector2i(0, 0)`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Mode<enum_Window_Mode>` | :ref:`mode<class_Window_property_mode>` | ``0`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`position<class_Window_property_position>` | ``Vector2i(0, 0)`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`size<class_Window_property_size>` | ``Vector2i(100, 100)`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`Theme<class_Theme>` | :ref:`theme<class_Window_property_theme>` | |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`theme_type_variation<class_Window_property_theme_type_variation>` | ``&""`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`String<class_String>` | :ref:`title<class_Window_property_title>` | ``""`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`transient<class_Window_property_transient>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`transparent<class_Window_property_transparent>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`unfocusable<class_Window_property_unfocusable>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`unresizable<class_Window_property_unresizable>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`visible<class_Window_property_visible>` | ``true`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- | :ref:`bool<class_bool>` | :ref:`wrap_controls<class_Window_property_wrap_controls>` | ``false`` |
- +-----------------------------------------------------------+-------------------------------------------------------------------------+------------------------+
- Methods
- -------
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`can_draw<class_Window_method_can_draw>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`child_controls_changed<class_Window_method_child_controls_changed>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_contents_minimum_size<class_Window_method_get_contents_minimum_size>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_flag<class_Window_method_get_flag>` **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`LayoutDirection<enum_Window_LayoutDirection>` | :ref:`get_layout_direction<class_Window_method_get_layout_direction>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`get_real_size<class_Window_method_get_real_size>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`get_theme_color<class_Window_method_get_theme_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_theme_constant<class_Window_method_get_theme_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_theme_default_base_scale<class_Window_method_get_theme_default_base_scale>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`get_theme_default_font<class_Window_method_get_theme_default_font>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_theme_default_font_size<class_Window_method_get_theme_default_font_size>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`get_theme_font<class_Window_method_get_theme_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_theme_font_size<class_Window_method_get_theme_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`get_theme_icon<class_Window_method_get_theme_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`get_theme_stylebox<class_Window_method_get_theme_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`grab_focus<class_Window_method_grab_focus>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_focus<class_Window_method_has_focus>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_color<class_Window_method_has_theme_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_constant<class_Window_method_has_theme_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_font<class_Window_method_has_theme_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_font_size<class_Window_method_has_theme_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_icon<class_Window_method_has_theme_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_theme_stylebox<class_Window_method_has_theme_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`hide<class_Window_method_hide>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_embedded<class_Window_method_is_embedded>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_layout_rtl<class_Window_method_is_layout_rtl>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_maximize_allowed<class_Window_method_is_maximize_allowed>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_using_font_oversampling<class_Window_method_is_using_font_oversampling>` **(** **)** |const| |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`move_to_foreground<class_Window_method_move_to_foreground>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`popup<class_Window_method_popup>` **(** :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`popup_centered<class_Window_method_popup_centered>` **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`popup_centered_clamped<class_Window_method_popup_centered_clamped>` **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0), :ref:`float<class_float>` fallback_ratio=0.75 **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`popup_centered_ratio<class_Window_method_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.8 **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`popup_on_parent<class_Window_method_popup_on_parent>` **(** :ref:`Rect2i<class_Rect2i>` parent_rect **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`request_attention<class_Window_method_request_attention>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_flag<class_Window_method_set_flag>` **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_ime_active<class_Window_method_set_ime_active>` **(** :ref:`bool<class_bool>` active **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_ime_position<class_Window_method_set_ime_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_layout_direction<class_Window_method_set_layout_direction>` **(** :ref:`LayoutDirection<enum_Window_LayoutDirection>` direction **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_use_font_oversampling<class_Window_method_set_use_font_oversampling>` **(** :ref:`bool<class_bool>` enable **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`show<class_Window_method_show>` **(** **)** |
- +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Theme Properties
- ----------------
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`close<class_Window_theme_icon_close>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`close_h_ofs<class_Window_theme_constant_close_h_ofs>` | ``18`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`close_pressed<class_Window_theme_icon_close_pressed>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`close_v_ofs<class_Window_theme_constant_close_v_ofs>` | ``18`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`embedded_border<class_Window_theme_style_embedded_border>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`resize_margin<class_Window_theme_constant_resize_margin>` | ``4`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`scaleborder_size<class_Window_theme_constant_scaleborder_size>` | ``4`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`title_color<class_Window_theme_color_title_color>` | ``Color(0, 0, 0, 1)`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`Font<class_Font>` | :ref:`title_font<class_Window_theme_font_title_font>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`title_font_size<class_Window_theme_font_size_title_font_size>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`title_height<class_Window_theme_constant_title_height>` | ``20`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`title_outline_modulate<class_Window_theme_color_title_outline_modulate>` | ``Color(1, 1, 1, 1)`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`title_outline_size<class_Window_theme_constant_title_outline_size>` | ``0`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-----------------------+
- 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<class_PackedStringArray>` files **)**
- ----
- .. _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_visibility_changed:
- - **visibility_changed** **(** **)**
- ----
- .. _class_Window_signal_window_input:
- - **window_input** **(** :ref:`InputEvent<class_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:
- 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.
- ----
- .. _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_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_MAX** = **5**
- ----
- .. _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 control 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<class_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<class_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<class_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<enum_Window_ContentScaleAspect>` **content_scale_aspect**
- +-----------+---------------------------------+
- | *Default* | ``0`` |
- +-----------+---------------------------------+
- | *Setter* | set_content_scale_aspect(value) |
- +-----------+---------------------------------+
- | *Getter* | get_content_scale_aspect() |
- +-----------+---------------------------------+
- ----
- .. _class_Window_property_content_scale_mode:
- - :ref:`ContentScaleMode<enum_Window_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<class_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<class_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<class_bool>` **exclusive**
- +-----------+----------------------+
- | *Default* | ``false`` |
- +-----------+----------------------+
- | *Setter* | set_exclusive(value) |
- +-----------+----------------------+
- | *Getter* | is_exclusive() |
- +-----------+----------------------+
- ----
- .. _class_Window_property_max_size:
- - :ref:`Vector2i<class_Vector2i>` **max_size**
- +-----------+---------------------+
- | *Default* | ``Vector2i(0, 0)`` |
- +-----------+---------------------+
- | *Setter* | set_max_size(value) |
- +-----------+---------------------+
- | *Getter* | get_max_size() |
- +-----------+---------------------+
- ----
- .. _class_Window_property_min_size:
- - :ref:`Vector2i<class_Vector2i>` **min_size**
- +-----------+---------------------+
- | *Default* | ``Vector2i(0, 0)`` |
- +-----------+---------------------+
- | *Setter* | set_min_size(value) |
- +-----------+---------------------+
- | *Getter* | get_min_size() |
- +-----------+---------------------+
- ----
- .. _class_Window_property_mode:
- - :ref:`Mode<enum_Window_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_position:
- - :ref:`Vector2i<class_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<class_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<class_Theme>` **theme**
- +----------+------------------+
- | *Setter* | set_theme(value) |
- +----------+------------------+
- | *Getter* | get_theme() |
- +----------+------------------+
- ----
- .. _class_Window_property_theme_type_variation:
- - :ref:`StringName<class_StringName>` **theme_type_variation**
- +-----------+---------------------------------+
- | *Default* | ``&""`` |
- +-----------+---------------------------------+
- | *Setter* | set_theme_type_variation(value) |
- +-----------+---------------------------------+
- | *Getter* | get_theme_type_variation() |
- +-----------+---------------------------------+
- ----
- .. _class_Window_property_title:
- - :ref:`String<class_String>` **title**
- +-----------+------------------+
- | *Default* | ``""`` |
- +-----------+------------------+
- | *Setter* | set_title(value) |
- +-----------+------------------+
- | *Getter* | get_title() |
- +-----------+------------------+
- The window's title.
- ----
- .. _class_Window_property_transient:
- - :ref:`bool<class_bool>` **transient**
- +-----------+----------------------+
- | *Default* | ``false`` |
- +-----------+----------------------+
- | *Setter* | set_transient(value) |
- +-----------+----------------------+
- | *Getter* | is_transient() |
- +-----------+----------------------+
- ----
- .. _class_Window_property_transparent:
- - :ref:`bool<class_bool>` **transparent**
- +-----------+-----------------+
- | *Default* | ``false`` |
- +-----------+-----------------+
- | *Setter* | set_flag(value) |
- +-----------+-----------------+
- | *Getter* | get_flag() |
- +-----------+-----------------+
- ----
- .. _class_Window_property_unfocusable:
- - :ref:`bool<class_bool>` **unfocusable**
- +-----------+-----------------+
- | *Default* | ``false`` |
- +-----------+-----------------+
- | *Setter* | set_flag(value) |
- +-----------+-----------------+
- | *Getter* | get_flag() |
- +-----------+-----------------+
- ----
- .. _class_Window_property_unresizable:
- - :ref:`bool<class_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<class_bool>` **visible**
- +-----------+--------------------+
- | *Default* | ``true`` |
- +-----------+--------------------+
- | *Setter* | set_visible(value) |
- +-----------+--------------------+
- | *Getter* | is_visible() |
- +-----------+--------------------+
- If ``true``, the window is visible.
- ----
- .. _class_Window_property_wrap_controls:
- - :ref:`bool<class_bool>` **wrap_controls**
- +-----------+--------------------------+
- | *Default* | ``false`` |
- +-----------+--------------------------+
- | *Setter* | set_wrap_controls(value) |
- +-----------+--------------------------+
- | *Getter* | is_wrapping_controls() |
- +-----------+--------------------------+
- Method Descriptions
- -------------------
- .. _class_Window_method_can_draw:
- - :ref:`bool<class_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<class_Vector2>` **get_contents_minimum_size** **(** **)** |const|
- Returns the combined minimum size from the child :ref:`Control<class_Control>` nodes of the window.
- ----
- .. _class_Window_method_get_flag:
- - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
- Returns ``true`` if the flag is set.
- ----
- .. _class_Window_method_get_layout_direction:
- - :ref:`LayoutDirection<enum_Window_LayoutDirection>` **get_layout_direction** **(** **)** |const|
- Returns layout direction and text writing direction.
- ----
- .. _class_Window_method_get_real_size:
- - :ref:`Vector2i<class_Vector2i>` **get_real_size** **(** **)** |const|
- Returns the window's size including its border.
- ----
- .. _class_Window_method_get_theme_color:
- - :ref:`Color<class_Color>` **get_theme_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_get_theme_constant:
- - :ref:`int<class_int>` **get_theme_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_get_theme_default_base_scale:
- - :ref:`float<class_float>` **get_theme_default_base_scale** **(** **)** |const|
- ----
- .. _class_Window_method_get_theme_default_font:
- - :ref:`Font<class_Font>` **get_theme_default_font** **(** **)** |const|
- ----
- .. _class_Window_method_get_theme_default_font_size:
- - :ref:`int<class_int>` **get_theme_default_font_size** **(** **)** |const|
- ----
- .. _class_Window_method_get_theme_font:
- - :ref:`Font<class_Font>` **get_theme_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- Returns the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``.
- ----
- .. _class_Window_method_get_theme_font_size:
- - :ref:`int<class_int>` **get_theme_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- Returns the font size at ``name`` if the theme has ``theme_type``.
- ----
- .. _class_Window_method_get_theme_icon:
- - :ref:`Texture2D<class_Texture2D>` **get_theme_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_get_theme_stylebox:
- - :ref:`StyleBox<class_StyleBox>` **get_theme_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_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<class_bool>` **has_focus** **(** **)** |const|
- Returns ``true`` if the window is focused.
- ----
- .. _class_Window_method_has_theme_color:
- - :ref:`bool<class_bool>` **has_theme_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_has_theme_constant:
- - :ref:`bool<class_bool>` **has_theme_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_has_theme_font:
- - :ref:`bool<class_bool>` **has_theme_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- Returns ``true`` if :ref:`Font<class_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<class_bool>` **has_theme_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_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<class_bool>` **has_theme_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_has_theme_stylebox:
- - :ref:`bool<class_bool>` **has_theme_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
- ----
- .. _class_Window_method_hide:
- - void **hide** **(** **)**
- ----
- .. _class_Window_method_is_embedded:
- - :ref:`bool<class_bool>` **is_embedded** **(** **)** |const|
- Returns ``true`` if the window is currently embedded in another window.
- ----
- .. _class_Window_method_is_layout_rtl:
- - :ref:`bool<class_bool>` **is_layout_rtl** **(** **)** |const|
- Returns ``true`` if layout is right-to-left.
- ----
- .. _class_Window_method_is_maximize_allowed:
- - :ref:`bool<class_bool>` **is_maximize_allowed** **(** **)** |const|
- ----
- .. _class_Window_method_is_using_font_oversampling:
- - :ref:`bool<class_bool>` **is_using_font_oversampling** **(** **)** |const|
- ----
- .. _class_Window_method_move_to_foreground:
- - void **move_to_foreground** **(** **)**
- ----
- .. _class_Window_method_popup:
- - void **popup** **(** :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)**
- ----
- .. _class_Window_method_popup_centered:
- - void **popup_centered** **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)**
- ----
- .. _class_Window_method_popup_centered_clamped:
- - void **popup_centered_clamped** **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0), :ref:`float<class_float>` fallback_ratio=0.75 **)**
- ----
- .. _class_Window_method_popup_centered_ratio:
- - void **popup_centered_ratio** **(** :ref:`float<class_float>` ratio=0.8 **)**
- ----
- .. _class_Window_method_popup_on_parent:
- - void **popup_on_parent** **(** :ref:`Rect2i<class_Rect2i>` parent_rect **)**
- ----
- .. _class_Window_method_request_attention:
- - void **request_attention** **(** **)**
- ----
- .. _class_Window_method_set_flag:
- - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
- Sets a specified window flag.
- ----
- .. _class_Window_method_set_ime_active:
- - void **set_ime_active** **(** :ref:`bool<class_bool>` active **)**
- ----
- .. _class_Window_method_set_ime_position:
- - void **set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
- ----
- .. _class_Window_method_set_layout_direction:
- - void **set_layout_direction** **(** :ref:`LayoutDirection<enum_Window_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<class_bool>` enable **)**
- ----
- .. _class_Window_method_show:
- - void **show** **(** **)**
- Theme Property Descriptions
- ---------------------------
- .. _class_Window_theme_icon_close:
- - :ref:`Texture2D<class_Texture2D>` **close**
- ----
- .. _class_Window_theme_constant_close_h_ofs:
- - :ref:`int<class_int>` **close_h_ofs**
- +-----------+--------+
- | *Default* | ``18`` |
- +-----------+--------+
- ----
- .. _class_Window_theme_icon_close_pressed:
- - :ref:`Texture2D<class_Texture2D>` **close_pressed**
- ----
- .. _class_Window_theme_constant_close_v_ofs:
- - :ref:`int<class_int>` **close_v_ofs**
- +-----------+--------+
- | *Default* | ``18`` |
- +-----------+--------+
- ----
- .. _class_Window_theme_style_embedded_border:
- - :ref:`StyleBox<class_StyleBox>` **embedded_border**
- ----
- .. _class_Window_theme_constant_resize_margin:
- - :ref:`int<class_int>` **resize_margin**
- +-----------+-------+
- | *Default* | ``4`` |
- +-----------+-------+
- ----
- .. _class_Window_theme_constant_scaleborder_size:
- - :ref:`int<class_int>` **scaleborder_size**
- +-----------+-------+
- | *Default* | ``4`` |
- +-----------+-------+
- ----
- .. _class_Window_theme_color_title_color:
- - :ref:`Color<class_Color>` **title_color**
- +-----------+-----------------------+
- | *Default* | ``Color(0, 0, 0, 1)`` |
- +-----------+-----------------------+
- ----
- .. _class_Window_theme_font_title_font:
- - :ref:`Font<class_Font>` **title_font**
- ----
- .. _class_Window_theme_font_size_title_font_size:
- - :ref:`int<class_int>` **title_font_size**
- The size of the title font.
- ----
- .. _class_Window_theme_constant_title_height:
- - :ref:`int<class_int>` **title_height**
- +-----------+--------+
- | *Default* | ``20`` |
- +-----------+--------+
- ----
- .. _class_Window_theme_color_title_outline_modulate:
- - :ref:`Color<class_Color>` **title_outline_modulate**
- +-----------+-----------------------+
- | *Default* | ``Color(1, 1, 1, 1)`` |
- +-----------+-----------------------+
- The color of the title outline.
- ----
- .. _class_Window_theme_constant_title_outline_size:
- - :ref:`int<class_int>` **title_outline_size**
- +-----------+-------+
- | *Default* | ``0`` |
- +-----------+-------+
- The size of the title outline.
- .. |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.)`
|