2
0

class_window.rst 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.1/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/Window.xml.
  6. .. _class_Window:
  7. Window
  8. ======
  9. **Inherits:** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AcceptDialog<class_AcceptDialog>`, :ref:`Popup<class_Popup>`
  11. Base class for all windows, dialogs, and popups.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A node that creates a window. The window can either be a native system window or embedded inside another **Window** (see :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>`).
  16. At runtime, **Window**\ s will not close automatically when requested. You need to handle it manually using the :ref:`close_requested<class_Window_signal_close_requested>` signal (this applies both to pressing the close button and clicking outside of a popup).
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`always_on_top<class_Window_property_always_on_top>` | ``false`` |
  24. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`auto_translate<class_Window_property_auto_translate>` | ``true`` |
  26. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`borderless<class_Window_property_borderless>` | ``false`` |
  28. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  29. | :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` | :ref:`content_scale_aspect<class_Window_property_content_scale_aspect>` | ``0`` |
  30. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  31. | :ref:`float<class_float>` | :ref:`content_scale_factor<class_Window_property_content_scale_factor>` | ``1.0`` |
  32. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  33. | :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` | :ref:`content_scale_mode<class_Window_property_content_scale_mode>` | ``0`` |
  34. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  35. | :ref:`Vector2i<class_Vector2i>` | :ref:`content_scale_size<class_Window_property_content_scale_size>` | ``Vector2i(0, 0)`` |
  36. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  37. | :ref:`int<class_int>` | :ref:`current_screen<class_Window_property_current_screen>` | |
  38. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`exclusive<class_Window_property_exclusive>` | ``false`` |
  40. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`extend_to_title<class_Window_property_extend_to_title>` | ``false`` |
  42. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  43. | :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` | :ref:`initial_position<class_Window_property_initial_position>` | ``0`` |
  44. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  45. | :ref:`Vector2i<class_Vector2i>` | :ref:`max_size<class_Window_property_max_size>` | ``Vector2i(0, 0)`` |
  46. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  47. | :ref:`Vector2i<class_Vector2i>` | :ref:`min_size<class_Window_property_min_size>` | ``Vector2i(0, 0)`` |
  48. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  49. | :ref:`Mode<enum_Window_Mode>` | :ref:`mode<class_Window_property_mode>` | ``0`` |
  50. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`mouse_passthrough<class_Window_property_mouse_passthrough>` | ``false`` |
  52. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  53. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`mouse_passthrough_polygon<class_Window_property_mouse_passthrough_polygon>` | ``PackedVector2Array()`` |
  54. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`popup_window<class_Window_property_popup_window>` | ``false`` |
  56. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  57. | :ref:`Vector2i<class_Vector2i>` | :ref:`position<class_Window_property_position>` | ``Vector2i(0, 0)`` |
  58. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  59. | :ref:`Vector2i<class_Vector2i>` | :ref:`size<class_Window_property_size>` | ``Vector2i(100, 100)`` |
  60. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  61. | :ref:`Theme<class_Theme>` | :ref:`theme<class_Window_property_theme>` | |
  62. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  63. | :ref:`StringName<class_StringName>` | :ref:`theme_type_variation<class_Window_property_theme_type_variation>` | ``&""`` |
  64. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  65. | :ref:`String<class_String>` | :ref:`title<class_Window_property_title>` | ``""`` |
  66. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`transient<class_Window_property_transient>` | ``false`` |
  68. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  69. | :ref:`bool<class_bool>` | :ref:`transparent<class_Window_property_transparent>` | ``false`` |
  70. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`unfocusable<class_Window_property_unfocusable>` | ``false`` |
  72. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`unresizable<class_Window_property_unresizable>` | ``false`` |
  74. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`visible<class_Window_property_visible>` | ``true`` |
  76. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`wrap_controls<class_Window_property_wrap_controls>` | ``false`` |
  78. +-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  79. .. rst-class:: classref-reftable-group
  80. Methods
  81. -------
  82. .. table::
  83. :widths: auto
  84. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`add_theme_color_override<class_Window_method_add_theme_color_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`Color<class_Color>` color **)** |
  86. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`add_theme_constant_override<class_Window_method_add_theme_constant_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` constant **)** |
  88. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`add_theme_font_override<class_Window_method_add_theme_font_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`Font<class_Font>` font **)** |
  90. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`add_theme_font_size_override<class_Window_method_add_theme_font_size_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` font_size **)** |
  92. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`add_theme_icon_override<class_Window_method_add_theme_icon_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`Texture2D<class_Texture2D>` texture **)** |
  94. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`add_theme_stylebox_override<class_Window_method_add_theme_stylebox_override>` **(** :ref:`StringName<class_StringName>` name, :ref:`StyleBox<class_StyleBox>` stylebox **)** |
  96. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`begin_bulk_theme_override<class_Window_method_begin_bulk_theme_override>` **(** **)** |
  98. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`bool<class_bool>` | :ref:`can_draw<class_Window_method_can_draw>` **(** **)** |const| |
  100. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`child_controls_changed<class_Window_method_child_controls_changed>` **(** **)** |
  102. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`end_bulk_theme_override<class_Window_method_end_bulk_theme_override>` **(** **)** |
  104. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Vector2<class_Vector2>` | :ref:`get_contents_minimum_size<class_Window_method_get_contents_minimum_size>` **(** **)** |const| |
  106. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`get_flag<class_Window_method_get_flag>` **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const| |
  108. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`LayoutDirection<enum_Window_LayoutDirection>` | :ref:`get_layout_direction<class_Window_method_get_layout_direction>` **(** **)** |const| |
  110. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_position_with_decorations<class_Window_method_get_position_with_decorations>` **(** **)** |const| |
  112. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_size_with_decorations<class_Window_method_get_size_with_decorations>` **(** **)** |const| |
  114. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :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| |
  116. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :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| |
  118. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`float<class_float>` | :ref:`get_theme_default_base_scale<class_Window_method_get_theme_default_base_scale>` **(** **)** |const| |
  120. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`Font<class_Font>` | :ref:`get_theme_default_font<class_Window_method_get_theme_default_font>` **(** **)** |const| |
  122. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`int<class_int>` | :ref:`get_theme_default_font_size<class_Window_method_get_theme_default_font_size>` **(** **)** |const| |
  124. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :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| |
  126. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :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| |
  128. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :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| |
  130. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :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| |
  132. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`int<class_int>` | :ref:`get_window_id<class_Window_method_get_window_id>` **(** **)** |const| |
  134. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`grab_focus<class_Window_method_grab_focus>` **(** **)** |
  136. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`bool<class_bool>` | :ref:`has_focus<class_Window_method_has_focus>` **(** **)** |const| |
  138. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :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| |
  140. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`bool<class_bool>` | :ref:`has_theme_color_override<class_Window_method_has_theme_color_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  142. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :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| |
  144. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`has_theme_constant_override<class_Window_method_has_theme_constant_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  146. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :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| |
  148. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`bool<class_bool>` | :ref:`has_theme_font_override<class_Window_method_has_theme_font_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  150. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :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| |
  152. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`bool<class_bool>` | :ref:`has_theme_font_size_override<class_Window_method_has_theme_font_size_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  154. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :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| |
  156. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`bool<class_bool>` | :ref:`has_theme_icon_override<class_Window_method_has_theme_icon_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  158. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :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| |
  160. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`bool<class_bool>` | :ref:`has_theme_stylebox_override<class_Window_method_has_theme_stylebox_override>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
  162. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`hide<class_Window_method_hide>` **(** **)** |
  164. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`bool<class_bool>` | :ref:`is_embedded<class_Window_method_is_embedded>` **(** **)** |const| |
  166. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`bool<class_bool>` | :ref:`is_layout_rtl<class_Window_method_is_layout_rtl>` **(** **)** |const| |
  168. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`bool<class_bool>` | :ref:`is_maximize_allowed<class_Window_method_is_maximize_allowed>` **(** **)** |const| |
  170. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`bool<class_bool>` | :ref:`is_using_font_oversampling<class_Window_method_is_using_font_oversampling>` **(** **)** |const| |
  172. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`move_to_foreground<class_Window_method_move_to_foreground>` **(** **)** |
  174. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`popup<class_Window_method_popup>` **(** :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)** |
  176. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`popup_centered<class_Window_method_popup_centered>` **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)** |
  178. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | 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 **)** |
  180. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | void | :ref:`popup_centered_ratio<class_Window_method_popup_centered_ratio>` **(** :ref:`float<class_float>` ratio=0.8 **)** |
  182. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | void | :ref:`popup_exclusive<class_Window_method_popup_exclusive>` **(** :ref:`Node<class_Node>` from_node, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)** |
  184. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | void | :ref:`popup_exclusive_centered<class_Window_method_popup_exclusive_centered>` **(** :ref:`Node<class_Node>` from_node, :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)** |
  186. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`popup_exclusive_centered_clamped<class_Window_method_popup_exclusive_centered_clamped>` **(** :ref:`Node<class_Node>` from_node, :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0), :ref:`float<class_float>` fallback_ratio=0.75 **)** |
  188. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | void | :ref:`popup_exclusive_centered_ratio<class_Window_method_popup_exclusive_centered_ratio>` **(** :ref:`Node<class_Node>` from_node, :ref:`float<class_float>` ratio=0.8 **)** |
  190. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | void | :ref:`popup_exclusive_on_parent<class_Window_method_popup_exclusive_on_parent>` **(** :ref:`Node<class_Node>` from_node, :ref:`Rect2i<class_Rect2i>` parent_rect **)** |
  192. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | void | :ref:`popup_on_parent<class_Window_method_popup_on_parent>` **(** :ref:`Rect2i<class_Rect2i>` parent_rect **)** |
  194. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | void | :ref:`remove_theme_color_override<class_Window_method_remove_theme_color_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  196. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | void | :ref:`remove_theme_constant_override<class_Window_method_remove_theme_constant_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  198. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | void | :ref:`remove_theme_font_override<class_Window_method_remove_theme_font_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  200. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | void | :ref:`remove_theme_font_size_override<class_Window_method_remove_theme_font_size_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  202. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | void | :ref:`remove_theme_icon_override<class_Window_method_remove_theme_icon_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  204. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | void | :ref:`remove_theme_stylebox_override<class_Window_method_remove_theme_stylebox_override>` **(** :ref:`StringName<class_StringName>` name **)** |
  206. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | void | :ref:`request_attention<class_Window_method_request_attention>` **(** **)** |
  208. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | void | :ref:`reset_size<class_Window_method_reset_size>` **(** **)** |
  210. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | void | :ref:`set_flag<class_Window_method_set_flag>` **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)** |
  212. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | void | :ref:`set_ime_active<class_Window_method_set_ime_active>` **(** :ref:`bool<class_bool>` active **)** |
  214. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | void | :ref:`set_ime_position<class_Window_method_set_ime_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  216. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | void | :ref:`set_layout_direction<class_Window_method_set_layout_direction>` **(** :ref:`LayoutDirection<enum_Window_LayoutDirection>` direction **)** |
  218. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | void | :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` **(** :ref:`bool<class_bool>` unparent **)** |
  220. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`set_use_font_oversampling<class_Window_method_set_use_font_oversampling>` **(** :ref:`bool<class_bool>` enable **)** |
  222. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | void | :ref:`show<class_Window_method_show>` **(** **)** |
  224. +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. .. rst-class:: classref-reftable-group
  226. Theme Properties
  227. ----------------
  228. .. table::
  229. :widths: auto
  230. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  231. | :ref:`Color<class_Color>` | :ref:`title_color<class_Window_theme_color_title_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  232. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  233. | :ref:`Color<class_Color>` | :ref:`title_outline_modulate<class_Window_theme_color_title_outline_modulate>` | ``Color(1, 1, 1, 1)`` |
  234. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  235. | :ref:`int<class_int>` | :ref:`close_h_offset<class_Window_theme_constant_close_h_offset>` | ``18`` |
  236. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  237. | :ref:`int<class_int>` | :ref:`close_v_offset<class_Window_theme_constant_close_v_offset>` | ``24`` |
  238. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  239. | :ref:`int<class_int>` | :ref:`resize_margin<class_Window_theme_constant_resize_margin>` | ``4`` |
  240. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  241. | :ref:`int<class_int>` | :ref:`title_height<class_Window_theme_constant_title_height>` | ``36`` |
  242. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  243. | :ref:`int<class_int>` | :ref:`title_outline_size<class_Window_theme_constant_title_outline_size>` | ``0`` |
  244. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  245. | :ref:`Font<class_Font>` | :ref:`title_font<class_Window_theme_font_title_font>` | |
  246. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  247. | :ref:`int<class_int>` | :ref:`title_font_size<class_Window_theme_font_size_title_font_size>` | |
  248. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  249. | :ref:`Texture2D<class_Texture2D>` | :ref:`close<class_Window_theme_icon_close>` | |
  250. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  251. | :ref:`Texture2D<class_Texture2D>` | :ref:`close_pressed<class_Window_theme_icon_close_pressed>` | |
  252. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  253. | :ref:`StyleBox<class_StyleBox>` | :ref:`embedded_border<class_Window_theme_style_embedded_border>` | |
  254. +-----------------------------------+--------------------------------------------------------------------------------+-----------------------------------+
  255. .. rst-class:: classref-section-separator
  256. ----
  257. .. rst-class:: classref-descriptions-group
  258. Signals
  259. -------
  260. .. _class_Window_signal_about_to_popup:
  261. .. rst-class:: classref-signal
  262. **about_to_popup** **(** **)**
  263. Emitted right after :ref:`popup<class_Window_method_popup>` call, before the **Window** appears or does anything.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_Window_signal_close_requested:
  267. .. rst-class:: classref-signal
  268. **close_requested** **(** **)**
  269. Emitted when the **Window**'s close button is pressed or when :ref:`popup_window<class_Window_property_popup_window>` is enabled and user clicks outside the window.
  270. This signal can be used to handle window closing, e.g. by connecting it to :ref:`hide<class_Window_method_hide>`.
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_Window_signal_dpi_changed:
  274. .. rst-class:: classref-signal
  275. **dpi_changed** **(** **)**
  276. Emitted when the **Window**'s DPI changes as a result of OS-level changes (e.g. moving the window from a Retina display to a lower resolution one).
  277. \ **Note:** Only implemented on macOS.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_Window_signal_files_dropped:
  281. .. rst-class:: classref-signal
  282. **files_dropped** **(** :ref:`PackedStringArray<class_PackedStringArray>` files **)**
  283. Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths.
  284. Note that this method only works with native windows, i.e. the main window and **Window**-derived nodes when :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` is disabled in the main viewport.
  285. Example usage:
  286. ::
  287. func _ready():
  288. get_viewport().files_dropped.connect(on_files_dropped)
  289. func on_files_dropped(files):
  290. print(files)
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_Window_signal_focus_entered:
  294. .. rst-class:: classref-signal
  295. **focus_entered** **(** **)**
  296. Emitted when the **Window** gains focus.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_Window_signal_focus_exited:
  300. .. rst-class:: classref-signal
  301. **focus_exited** **(** **)**
  302. Emitted when the **Window** loses its focus.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_Window_signal_go_back_requested:
  306. .. rst-class:: classref-signal
  307. **go_back_requested** **(** **)**
  308. Emitted when a go back request is sent (e.g. pressing the "Back" button on Android), right after :ref:`Node.NOTIFICATION_WM_GO_BACK_REQUEST<class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST>`.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_Window_signal_mouse_entered:
  312. .. rst-class:: classref-signal
  313. **mouse_entered** **(** **)**
  314. Emitted when the mouse cursor enters the **Window**'s area, regardless if it's currently focused or not.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_Window_signal_mouse_exited:
  318. .. rst-class:: classref-signal
  319. **mouse_exited** **(** **)**
  320. Emitted when the mouse cursor exits the **Window**'s area (including when it's hovered over another window on top of this one).
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_Window_signal_theme_changed:
  324. .. rst-class:: classref-signal
  325. **theme_changed** **(** **)**
  326. Emitted when the :ref:`NOTIFICATION_THEME_CHANGED<class_Window_constant_NOTIFICATION_THEME_CHANGED>` notification is sent.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_Window_signal_titlebar_changed:
  330. .. rst-class:: classref-signal
  331. **titlebar_changed** **(** **)**
  332. Emitted when window title bar decorations are changed, e.g. macOS window enter/exit full screen mode, or extend-to-title flag is changed.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_Window_signal_visibility_changed:
  336. .. rst-class:: classref-signal
  337. **visibility_changed** **(** **)**
  338. Emitted when **Window** is made visible or disappears.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_Window_signal_window_input:
  342. .. rst-class:: classref-signal
  343. **window_input** **(** :ref:`InputEvent<class_InputEvent>` event **)**
  344. Emitted when the **Window** is currently focused and receives any input, passing the received event as an argument. The event's position, if present, is in the embedder's coordinate system.
  345. .. rst-class:: classref-section-separator
  346. ----
  347. .. rst-class:: classref-descriptions-group
  348. Enumerations
  349. ------------
  350. .. _enum_Window_Mode:
  351. .. rst-class:: classref-enumeration
  352. enum **Mode**:
  353. .. _class_Window_constant_MODE_WINDOWED:
  354. .. rst-class:: classref-enumeration-constant
  355. :ref:`Mode<enum_Window_Mode>` **MODE_WINDOWED** = ``0``
  356. Windowed mode, i.e. **Window** doesn't occupy the whole screen (unless set to the size of the screen).
  357. .. _class_Window_constant_MODE_MINIMIZED:
  358. .. rst-class:: classref-enumeration-constant
  359. :ref:`Mode<enum_Window_Mode>` **MODE_MINIMIZED** = ``1``
  360. Minimized window mode, i.e. **Window** is not visible and available on window manager's window list. Normally happens when the minimize button is pressed.
  361. .. _class_Window_constant_MODE_MAXIMIZED:
  362. .. rst-class:: classref-enumeration-constant
  363. :ref:`Mode<enum_Window_Mode>` **MODE_MAXIMIZED** = ``2``
  364. Maximized window mode, i.e. **Window** will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed.
  365. .. _class_Window_constant_MODE_FULLSCREEN:
  366. .. rst-class:: classref-enumeration-constant
  367. :ref:`Mode<enum_Window_Mode>` **MODE_FULLSCREEN** = ``3``
  368. Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project.
  369. Regardless of the platform, enabling full screen 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 full screen mode.
  370. .. _class_Window_constant_MODE_EXCLUSIVE_FULLSCREEN:
  371. .. rst-class:: classref-enumeration-constant
  372. :ref:`Mode<enum_Window_Mode>` **MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  373. Exclusive full screen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to :ref:`MODE_FULLSCREEN<class_Window_constant_MODE_FULLSCREEN>`.
  374. Only one window in exclusive full screen mode can be visible on a given screen at a time. If multiple windows are in exclusive full screen mode for the same screen, the last one being set to this mode takes precedence.
  375. Regardless of the platform, enabling full screen 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 full screen mode.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _enum_Window_Flags:
  379. .. rst-class:: classref-enumeration
  380. enum **Flags**:
  381. .. _class_Window_constant_FLAG_RESIZE_DISABLED:
  382. .. rst-class:: classref-enumeration-constant
  383. :ref:`Flags<enum_Window_Flags>` **FLAG_RESIZE_DISABLED** = ``0``
  384. The window can't be resized by dragging its resize grip. It's still possible to resize the window using :ref:`size<class_Window_property_size>`. This flag is ignored for full screen windows. Set with :ref:`unresizable<class_Window_property_unresizable>`.
  385. .. _class_Window_constant_FLAG_BORDERLESS:
  386. .. rst-class:: classref-enumeration-constant
  387. :ref:`Flags<enum_Window_Flags>` **FLAG_BORDERLESS** = ``1``
  388. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. Set with :ref:`borderless<class_Window_property_borderless>`.
  389. .. _class_Window_constant_FLAG_ALWAYS_ON_TOP:
  390. .. rst-class:: classref-enumeration-constant
  391. :ref:`Flags<enum_Window_Flags>` **FLAG_ALWAYS_ON_TOP** = ``2``
  392. The window is floating on top of all other windows. This flag is ignored for full-screen windows. Set with :ref:`always_on_top<class_Window_property_always_on_top>`.
  393. .. _class_Window_constant_FLAG_TRANSPARENT:
  394. .. rst-class:: classref-enumeration-constant
  395. :ref:`Flags<enum_Window_Flags>` **FLAG_TRANSPARENT** = ``3``
  396. The window background can be transparent. Set with :ref:`transparent<class_Window_property_transparent>`.
  397. \ **Note:** This flag has no effect if either :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>`, or the window's :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` is set to ``false``.
  398. .. _class_Window_constant_FLAG_NO_FOCUS:
  399. .. rst-class:: classref-enumeration-constant
  400. :ref:`Flags<enum_Window_Flags>` **FLAG_NO_FOCUS** = ``4``
  401. The window can't be focused. No-focus window will ignore all input, except mouse clicks. Set with :ref:`unfocusable<class_Window_property_unfocusable>`.
  402. .. _class_Window_constant_FLAG_POPUP:
  403. .. rst-class:: classref-enumeration-constant
  404. :ref:`Flags<enum_Window_Flags>` **FLAG_POPUP** = ``5``
  405. Window is part of menu or :ref:`OptionButton<class_OptionButton>` dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see :ref:`transient<class_Window_property_transient>`).
  406. \ **Note:** This flag has no effect in embedded windows (unless said window is a :ref:`Popup<class_Popup>`).
  407. .. _class_Window_constant_FLAG_EXTEND_TO_TITLE:
  408. .. rst-class:: classref-enumeration-constant
  409. :ref:`Flags<enum_Window_Flags>` **FLAG_EXTEND_TO_TITLE** = ``6``
  410. Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. Set with :ref:`extend_to_title<class_Window_property_extend_to_title>`.
  411. \ **Note:** This flag is implemented only on macOS.
  412. \ **Note:** This flag has no effect in embedded windows.
  413. .. _class_Window_constant_FLAG_MOUSE_PASSTHROUGH:
  414. .. rst-class:: classref-enumeration-constant
  415. :ref:`Flags<enum_Window_Flags>` **FLAG_MOUSE_PASSTHROUGH** = ``7``
  416. All mouse events are passed to the underlying window of the same application.
  417. \ **Note:** This flag has no effect in embedded windows.
  418. .. _class_Window_constant_FLAG_MAX:
  419. .. rst-class:: classref-enumeration-constant
  420. :ref:`Flags<enum_Window_Flags>` **FLAG_MAX** = ``8``
  421. Max value of the :ref:`Flags<enum_Window_Flags>`.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _enum_Window_ContentScaleMode:
  425. .. rst-class:: classref-enumeration
  426. enum **ContentScaleMode**:
  427. .. _class_Window_constant_CONTENT_SCALE_MODE_DISABLED:
  428. .. rst-class:: classref-enumeration-constant
  429. :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_DISABLED** = ``0``
  430. The content will not be scaled to match the **Window**'s size.
  431. .. _class_Window_constant_CONTENT_SCALE_MODE_CANVAS_ITEMS:
  432. .. rst-class:: classref-enumeration-constant
  433. :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_CANVAS_ITEMS** = ``1``
  434. The content will be rendered at the target size. This is more performance-expensive than :ref:`CONTENT_SCALE_MODE_VIEWPORT<class_Window_constant_CONTENT_SCALE_MODE_VIEWPORT>`, but provides better results.
  435. .. _class_Window_constant_CONTENT_SCALE_MODE_VIEWPORT:
  436. .. rst-class:: classref-enumeration-constant
  437. :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_VIEWPORT** = ``2``
  438. The content will be rendered at the base size and then scaled to the target size. More performant than :ref:`CONTENT_SCALE_MODE_CANVAS_ITEMS<class_Window_constant_CONTENT_SCALE_MODE_CANVAS_ITEMS>`, but results in pixelated image.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _enum_Window_ContentScaleAspect:
  442. .. rst-class:: classref-enumeration
  443. enum **ContentScaleAspect**:
  444. .. _class_Window_constant_CONTENT_SCALE_ASPECT_IGNORE:
  445. .. rst-class:: classref-enumeration-constant
  446. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_IGNORE** = ``0``
  447. The aspect will be ignored. Scaling will simply stretch the content to fit the target size.
  448. .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP:
  449. .. rst-class:: classref-enumeration-constant
  450. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP** = ``1``
  451. The content's aspect will be preserved. If the target size has different aspect from the base one, the image will be centered and black bars will appear on left and right sides.
  452. .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_WIDTH:
  453. .. rst-class:: classref-enumeration-constant
  454. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP_WIDTH** = ``2``
  455. The content can be expanded vertically. Scaling horizontally will result in keeping the width ratio and then black bars on left and right sides.
  456. .. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_HEIGHT:
  457. .. rst-class:: classref-enumeration-constant
  458. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP_HEIGHT** = ``3``
  459. The content can be expanded horizontally. Scaling vertically will result in keeping the height ratio and then black bars on top and bottom sides.
  460. .. _class_Window_constant_CONTENT_SCALE_ASPECT_EXPAND:
  461. .. rst-class:: classref-enumeration-constant
  462. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_EXPAND** = ``4``
  463. The content's aspect will be preserved. If the target size has different aspect from the base one, the content will stay in the top-left corner and add an extra visible area in the stretched space.
  464. .. rst-class:: classref-item-separator
  465. ----
  466. .. _enum_Window_LayoutDirection:
  467. .. rst-class:: classref-enumeration
  468. enum **LayoutDirection**:
  469. .. _class_Window_constant_LAYOUT_DIRECTION_INHERITED:
  470. .. rst-class:: classref-enumeration-constant
  471. :ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_INHERITED** = ``0``
  472. Automatic layout direction, determined from the parent window layout direction.
  473. .. _class_Window_constant_LAYOUT_DIRECTION_LOCALE:
  474. .. rst-class:: classref-enumeration-constant
  475. :ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_LOCALE** = ``1``
  476. Automatic layout direction, determined from the current locale.
  477. .. _class_Window_constant_LAYOUT_DIRECTION_LTR:
  478. .. rst-class:: classref-enumeration-constant
  479. :ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_LTR** = ``2``
  480. Left-to-right layout direction.
  481. .. _class_Window_constant_LAYOUT_DIRECTION_RTL:
  482. .. rst-class:: classref-enumeration-constant
  483. :ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_RTL** = ``3``
  484. Right-to-left layout direction.
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _enum_Window_WindowInitialPosition:
  488. .. rst-class:: classref-enumeration
  489. enum **WindowInitialPosition**:
  490. .. _class_Window_constant_WINDOW_INITIAL_POSITION_ABSOLUTE:
  491. .. rst-class:: classref-enumeration-constant
  492. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_ABSOLUTE** = ``0``
  493. Initial window position is determined by :ref:`position<class_Window_property_position>`.
  494. .. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN:
  495. .. rst-class:: classref-enumeration-constant
  496. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN** = ``1``
  497. Initial window position is the center of the primary screen.
  498. .. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN:
  499. .. rst-class:: classref-enumeration-constant
  500. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN** = ``2``
  501. Initial window position is the center of the main window screen.
  502. .. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN:
  503. .. rst-class:: classref-enumeration-constant
  504. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN** = ``3``
  505. Initial window position is the center of :ref:`current_screen<class_Window_property_current_screen>` screen.
  506. .. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS:
  507. .. rst-class:: classref-enumeration-constant
  508. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS** = ``4``
  509. Initial window position is the center of the screen containing the mouse pointer.
  510. .. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS:
  511. .. rst-class:: classref-enumeration-constant
  512. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS** = ``5``
  513. Initial window position is the center of the screen containing the window with the keyboard focus.
  514. .. rst-class:: classref-section-separator
  515. ----
  516. .. rst-class:: classref-descriptions-group
  517. Constants
  518. ---------
  519. .. _class_Window_constant_NOTIFICATION_VISIBILITY_CHANGED:
  520. .. rst-class:: classref-constant
  521. **NOTIFICATION_VISIBILITY_CHANGED** = ``30``
  522. Emitted when **Window**'s visibility changes, right before :ref:`visibility_changed<class_Window_signal_visibility_changed>`.
  523. .. _class_Window_constant_NOTIFICATION_THEME_CHANGED:
  524. .. rst-class:: classref-constant
  525. **NOTIFICATION_THEME_CHANGED** = ``32``
  526. Sent when the node needs to refresh its theme items. This happens in one of the following cases:
  527. - The :ref:`theme<class_Window_property_theme>` property is changed on this node or any of its ancestors.
  528. - The :ref:`theme_type_variation<class_Window_property_theme_type_variation>` property is changed on this node.
  529. - The node enters the scene tree.
  530. \ **Note:** As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
  531. .. rst-class:: classref-section-separator
  532. ----
  533. .. rst-class:: classref-descriptions-group
  534. Property Descriptions
  535. ---------------------
  536. .. _class_Window_property_always_on_top:
  537. .. rst-class:: classref-property
  538. :ref:`bool<class_bool>` **always_on_top** = ``false``
  539. .. rst-class:: classref-property-setget
  540. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  541. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  542. If ``true``, the window will be on top of all other windows. Does not work if :ref:`transient<class_Window_property_transient>` is enabled.
  543. .. rst-class:: classref-item-separator
  544. ----
  545. .. _class_Window_property_auto_translate:
  546. .. rst-class:: classref-property
  547. :ref:`bool<class_bool>` **auto_translate** = ``true``
  548. .. rst-class:: classref-property-setget
  549. - void **set_auto_translate** **(** :ref:`bool<class_bool>` value **)**
  550. - :ref:`bool<class_bool>` **is_auto_translating** **(** **)**
  551. Toggles if any text should automatically change to its translated version depending on the current locale.
  552. .. rst-class:: classref-item-separator
  553. ----
  554. .. _class_Window_property_borderless:
  555. .. rst-class:: classref-property
  556. :ref:`bool<class_bool>` **borderless** = ``false``
  557. .. rst-class:: classref-property-setget
  558. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  559. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  560. If ``true``, the window will have no borders.
  561. .. rst-class:: classref-item-separator
  562. ----
  563. .. _class_Window_property_content_scale_aspect:
  564. .. rst-class:: classref-property
  565. :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **content_scale_aspect** = ``0``
  566. .. rst-class:: classref-property-setget
  567. - void **set_content_scale_aspect** **(** :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` value **)**
  568. - :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **get_content_scale_aspect** **(** **)**
  569. Specifies how the content's aspect behaves when the **Window** is resized. The base aspect is determined by :ref:`content_scale_size<class_Window_property_content_scale_size>`.
  570. .. rst-class:: classref-item-separator
  571. ----
  572. .. _class_Window_property_content_scale_factor:
  573. .. rst-class:: classref-property
  574. :ref:`float<class_float>` **content_scale_factor** = ``1.0``
  575. .. rst-class:: classref-property-setget
  576. - void **set_content_scale_factor** **(** :ref:`float<class_float>` value **)**
  577. - :ref:`float<class_float>` **get_content_scale_factor** **(** **)**
  578. Specifies the base scale of **Window**'s content when its :ref:`size<class_Window_property_size>` is equal to :ref:`content_scale_size<class_Window_property_content_scale_size>`.
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _class_Window_property_content_scale_mode:
  582. .. rst-class:: classref-property
  583. :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **content_scale_mode** = ``0``
  584. .. rst-class:: classref-property-setget
  585. - void **set_content_scale_mode** **(** :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` value **)**
  586. - :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **get_content_scale_mode** **(** **)**
  587. Specifies how the content is scaled when the **Window** is resized.
  588. .. rst-class:: classref-item-separator
  589. ----
  590. .. _class_Window_property_content_scale_size:
  591. .. rst-class:: classref-property
  592. :ref:`Vector2i<class_Vector2i>` **content_scale_size** = ``Vector2i(0, 0)``
  593. .. rst-class:: classref-property-setget
  594. - void **set_content_scale_size** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  595. - :ref:`Vector2i<class_Vector2i>` **get_content_scale_size** **(** **)**
  596. Base size of the content (i.e. nodes that are drawn inside the window). If non-zero, **Window**'s content will be scaled when the window is resized to a different size.
  597. .. rst-class:: classref-item-separator
  598. ----
  599. .. _class_Window_property_current_screen:
  600. .. rst-class:: classref-property
  601. :ref:`int<class_int>` **current_screen**
  602. .. rst-class:: classref-property-setget
  603. - void **set_current_screen** **(** :ref:`int<class_int>` value **)**
  604. - :ref:`int<class_int>` **get_current_screen** **(** **)**
  605. The screen the window is currently on.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_Window_property_exclusive:
  609. .. rst-class:: classref-property
  610. :ref:`bool<class_bool>` **exclusive** = ``false``
  611. .. rst-class:: classref-property-setget
  612. - void **set_exclusive** **(** :ref:`bool<class_bool>` value **)**
  613. - :ref:`bool<class_bool>` **is_exclusive** **(** **)**
  614. If ``true``, the **Window** will be in exclusive mode. Exclusive windows are always on top of their parent and will block all input going to the parent **Window**.
  615. Needs :ref:`transient<class_Window_property_transient>` enabled to work.
  616. .. rst-class:: classref-item-separator
  617. ----
  618. .. _class_Window_property_extend_to_title:
  619. .. rst-class:: classref-property
  620. :ref:`bool<class_bool>` **extend_to_title** = ``false``
  621. .. rst-class:: classref-property-setget
  622. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  623. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  624. If ``true``, the **Window** contents is expanded to the full size of the window, window title bar is transparent.
  625. \ **Note:** This property is implemented only on macOS.
  626. \ **Note:** This property only works with native windows.
  627. .. rst-class:: classref-item-separator
  628. ----
  629. .. _class_Window_property_initial_position:
  630. .. rst-class:: classref-property
  631. :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **initial_position** = ``0``
  632. .. rst-class:: classref-property-setget
  633. - void **set_initial_position** **(** :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` value **)**
  634. - :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **get_initial_position** **(** **)**
  635. Specifies the initial type of position for the **Window**. See :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` constants.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_Window_property_max_size:
  639. .. rst-class:: classref-property
  640. :ref:`Vector2i<class_Vector2i>` **max_size** = ``Vector2i(0, 0)``
  641. .. rst-class:: classref-property-setget
  642. - void **set_max_size** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  643. - :ref:`Vector2i<class_Vector2i>` **get_max_size** **(** **)**
  644. If non-zero, the **Window** can't be resized to be bigger than this size.
  645. \ **Note:** This property will be ignored if the value is lower than :ref:`min_size<class_Window_property_min_size>`.
  646. .. rst-class:: classref-item-separator
  647. ----
  648. .. _class_Window_property_min_size:
  649. .. rst-class:: classref-property
  650. :ref:`Vector2i<class_Vector2i>` **min_size** = ``Vector2i(0, 0)``
  651. .. rst-class:: classref-property-setget
  652. - void **set_min_size** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  653. - :ref:`Vector2i<class_Vector2i>` **get_min_size** **(** **)**
  654. If non-zero, the **Window** can't be resized to be smaller than this size.
  655. \ **Note:** This property will be ignored in favor of :ref:`get_contents_minimum_size<class_Window_method_get_contents_minimum_size>` if :ref:`wrap_controls<class_Window_property_wrap_controls>` is enabled and if its size is bigger.
  656. .. rst-class:: classref-item-separator
  657. ----
  658. .. _class_Window_property_mode:
  659. .. rst-class:: classref-property
  660. :ref:`Mode<enum_Window_Mode>` **mode** = ``0``
  661. .. rst-class:: classref-property-setget
  662. - void **set_mode** **(** :ref:`Mode<enum_Window_Mode>` value **)**
  663. - :ref:`Mode<enum_Window_Mode>` **get_mode** **(** **)**
  664. Set's the window's current mode.
  665. \ **Note:** Fullscreen mode is not exclusive full screen on Windows and Linux.
  666. \ **Note:** This method only works with native windows, i.e. the main window and **Window**-derived nodes when :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` is disabled in the main viewport.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_Window_property_mouse_passthrough:
  670. .. rst-class:: classref-property
  671. :ref:`bool<class_bool>` **mouse_passthrough** = ``false``
  672. .. rst-class:: classref-property-setget
  673. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  674. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  675. If ``true``, all mouse events will be passed to the underlying window of the same application. See also :ref:`mouse_passthrough_polygon<class_Window_property_mouse_passthrough_polygon>`.
  676. \ **Note:** This property is implemented on Linux (X11), macOS and Windows.
  677. \ **Note:** This property only works with native windows.
  678. .. rst-class:: classref-item-separator
  679. ----
  680. .. _class_Window_property_mouse_passthrough_polygon:
  681. .. rst-class:: classref-property
  682. :ref:`PackedVector2Array<class_PackedVector2Array>` **mouse_passthrough_polygon** = ``PackedVector2Array()``
  683. .. rst-class:: classref-property-setget
  684. - void **set_mouse_passthrough_polygon** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` value **)**
  685. - :ref:`PackedVector2Array<class_PackedVector2Array>` **get_mouse_passthrough_polygon** **(** **)**
  686. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  687. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  688. .. tabs::
  689. .. code-tab:: gdscript
  690. # Set region, using Path2D node.
  691. $Window.mouse_passthrough_polygon = $Path2D.curve.get_baked_points()
  692. # Set region, using Polygon2D node.
  693. $Window.mouse_passthrough_polygon = $Polygon2D.polygon
  694. # Reset region to default.
  695. $Window.mouse_passthrough_polygon = []
  696. .. code-tab:: csharp
  697. // Set region, using Path2D node.
  698. GetNode<Window>("Window").MousePassthrough = GetNode<Path2D>("Path2D").Curve.GetBakedPoints();
  699. // Set region, using Polygon2D node.
  700. GetNode<Window>("Window").MousePassthrough = GetNode<Polygon2D>("Polygon2D").Polygon;
  701. // Reset region to default.
  702. GetNode<Window>("Window").MousePassthrough = new Vector2[] {};
  703. \ **Note:** This property is ignored if :ref:`mouse_passthrough<class_Window_property_mouse_passthrough>` is set to ``true``.
  704. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  705. \ **Note:** This property is implemented on Linux (X11), macOS and Windows.
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _class_Window_property_popup_window:
  709. .. rst-class:: classref-property
  710. :ref:`bool<class_bool>` **popup_window** = ``false``
  711. .. rst-class:: classref-property-setget
  712. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  713. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  714. If ``true``, the **Window** will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless :ref:`exclusive<class_Window_property_exclusive>` is enabled).
  715. \ **Note:** This property only works with native windows.
  716. .. rst-class:: classref-item-separator
  717. ----
  718. .. _class_Window_property_position:
  719. .. rst-class:: classref-property
  720. :ref:`Vector2i<class_Vector2i>` **position** = ``Vector2i(0, 0)``
  721. .. rst-class:: classref-property-setget
  722. - void **set_position** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  723. - :ref:`Vector2i<class_Vector2i>` **get_position** **(** **)**
  724. The window's position in pixels.
  725. If :ref:`ProjectSettings.display/window/subwindows/embed_subwindows<class_ProjectSettings_property_display/window/subwindows/embed_subwindows>` is ``false``, the position is in absolute screen coordinates. This typically applies to editor plugins. If the setting is ``true``, the window's position is in the coordinates of its parent :ref:`Viewport<class_Viewport>`.
  726. \ **Note:** This property only works if :ref:`initial_position<class_Window_property_initial_position>` is set to :ref:`WINDOW_INITIAL_POSITION_ABSOLUTE<class_Window_constant_WINDOW_INITIAL_POSITION_ABSOLUTE>`.
  727. .. rst-class:: classref-item-separator
  728. ----
  729. .. _class_Window_property_size:
  730. .. rst-class:: classref-property
  731. :ref:`Vector2i<class_Vector2i>` **size** = ``Vector2i(100, 100)``
  732. .. rst-class:: classref-property-setget
  733. - void **set_size** **(** :ref:`Vector2i<class_Vector2i>` value **)**
  734. - :ref:`Vector2i<class_Vector2i>` **get_size** **(** **)**
  735. The window's size in pixels.
  736. .. rst-class:: classref-item-separator
  737. ----
  738. .. _class_Window_property_theme:
  739. .. rst-class:: classref-property
  740. :ref:`Theme<class_Theme>` **theme**
  741. .. rst-class:: classref-property-setget
  742. - void **set_theme** **(** :ref:`Theme<class_Theme>` value **)**
  743. - :ref:`Theme<class_Theme>` **get_theme** **(** **)**
  744. The :ref:`Theme<class_Theme>` resource this node and all its :ref:`Control<class_Control>` and **Window** children use. If a child node has its own :ref:`Theme<class_Theme>` resource set, theme items are merged with child's definitions having higher priority.
  745. \ **Note:** **Window** styles will have no effect unless the window is embedded.
  746. .. rst-class:: classref-item-separator
  747. ----
  748. .. _class_Window_property_theme_type_variation:
  749. .. rst-class:: classref-property
  750. :ref:`StringName<class_StringName>` **theme_type_variation** = ``&""``
  751. .. rst-class:: classref-property-setget
  752. - void **set_theme_type_variation** **(** :ref:`StringName<class_StringName>` value **)**
  753. - :ref:`StringName<class_StringName>` **get_theme_type_variation** **(** **)**
  754. The name of a theme type variation used by this **Window** to look up its own theme items. See :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>` for more details.
  755. .. rst-class:: classref-item-separator
  756. ----
  757. .. _class_Window_property_title:
  758. .. rst-class:: classref-property
  759. :ref:`String<class_String>` **title** = ``""``
  760. .. rst-class:: classref-property-setget
  761. - void **set_title** **(** :ref:`String<class_String>` value **)**
  762. - :ref:`String<class_String>` **get_title** **(** **)**
  763. The window's title. If the **Window** is native, title styles set in :ref:`Theme<class_Theme>` will have no effect.
  764. .. rst-class:: classref-item-separator
  765. ----
  766. .. _class_Window_property_transient:
  767. .. rst-class:: classref-property
  768. :ref:`bool<class_bool>` **transient** = ``false``
  769. .. rst-class:: classref-property-setget
  770. - void **set_transient** **(** :ref:`bool<class_bool>` value **)**
  771. - :ref:`bool<class_bool>` **is_transient** **(** **)**
  772. If ``true``, the **Window** is transient, i.e. it's considered a child of another **Window**. The transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
  773. Note that behavior might be different depending on the platform.
  774. .. rst-class:: classref-item-separator
  775. ----
  776. .. _class_Window_property_transparent:
  777. .. rst-class:: classref-property
  778. :ref:`bool<class_bool>` **transparent** = ``false``
  779. .. rst-class:: classref-property-setget
  780. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  781. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  782. If ``true``, the **Window**'s background can be transparent. This is best used with embedded windows.
  783. \ **Note:** Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  784. \ **Note:** This property has no effect if either :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>`, or the window's :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` is set to ``false``.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_Window_property_unfocusable:
  788. .. rst-class:: classref-property
  789. :ref:`bool<class_bool>` **unfocusable** = ``false``
  790. .. rst-class:: classref-property-setget
  791. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  792. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  793. If ``true``, the **Window** can't be focused nor interacted with. It can still be visible.
  794. .. rst-class:: classref-item-separator
  795. ----
  796. .. _class_Window_property_unresizable:
  797. .. rst-class:: classref-property
  798. :ref:`bool<class_bool>` **unresizable** = ``false``
  799. .. rst-class:: classref-property-setget
  800. - void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  801. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  802. If ``true``, the window can't be resized. Minimize and maximize buttons are disabled.
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_Window_property_visible:
  806. .. rst-class:: classref-property
  807. :ref:`bool<class_bool>` **visible** = ``true``
  808. .. rst-class:: classref-property-setget
  809. - void **set_visible** **(** :ref:`bool<class_bool>` value **)**
  810. - :ref:`bool<class_bool>` **is_visible** **(** **)**
  811. If ``true``, the window is visible.
  812. .. rst-class:: classref-item-separator
  813. ----
  814. .. _class_Window_property_wrap_controls:
  815. .. rst-class:: classref-property
  816. :ref:`bool<class_bool>` **wrap_controls** = ``false``
  817. .. rst-class:: classref-property-setget
  818. - void **set_wrap_controls** **(** :ref:`bool<class_bool>` value **)**
  819. - :ref:`bool<class_bool>` **is_wrapping_controls** **(** **)**
  820. If ``true``, the window's size will automatically update when a child node is added or removed, ignoring :ref:`min_size<class_Window_property_min_size>` if the new size is bigger.
  821. If ``false``, you need to call :ref:`child_controls_changed<class_Window_method_child_controls_changed>` manually.
  822. .. rst-class:: classref-section-separator
  823. ----
  824. .. rst-class:: classref-descriptions-group
  825. Method Descriptions
  826. -------------------
  827. .. _class_Window_method_add_theme_color_override:
  828. .. rst-class:: classref-method
  829. void **add_theme_color_override** **(** :ref:`StringName<class_StringName>` name, :ref:`Color<class_Color>` color **)**
  830. Creates a local override for a theme :ref:`Color<class_Color>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_color_override<class_Window_method_remove_theme_color_override>`.
  831. See also :ref:`get_theme_color<class_Window_method_get_theme_color>` and :ref:`Control.add_theme_color_override<class_Control_method_add_theme_color_override>` for more details.
  832. .. rst-class:: classref-item-separator
  833. ----
  834. .. _class_Window_method_add_theme_constant_override:
  835. .. rst-class:: classref-method
  836. void **add_theme_constant_override** **(** :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` constant **)**
  837. Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_constant_override<class_Window_method_remove_theme_constant_override>`.
  838. See also :ref:`get_theme_constant<class_Window_method_get_theme_constant>`.
  839. .. rst-class:: classref-item-separator
  840. ----
  841. .. _class_Window_method_add_theme_font_override:
  842. .. rst-class:: classref-method
  843. void **add_theme_font_override** **(** :ref:`StringName<class_StringName>` name, :ref:`Font<class_Font>` font **)**
  844. Creates a local override for a theme :ref:`Font<class_Font>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_override<class_Window_method_remove_theme_font_override>`.
  845. See also :ref:`get_theme_font<class_Window_method_get_theme_font>`.
  846. .. rst-class:: classref-item-separator
  847. ----
  848. .. _class_Window_method_add_theme_font_size_override:
  849. .. rst-class:: classref-method
  850. void **add_theme_font_size_override** **(** :ref:`StringName<class_StringName>` name, :ref:`int<class_int>` font_size **)**
  851. Creates a local override for a theme font size with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_font_size_override<class_Window_method_remove_theme_font_size_override>`.
  852. See also :ref:`get_theme_font_size<class_Window_method_get_theme_font_size>`.
  853. .. rst-class:: classref-item-separator
  854. ----
  855. .. _class_Window_method_add_theme_icon_override:
  856. .. rst-class:: classref-method
  857. void **add_theme_icon_override** **(** :ref:`StringName<class_StringName>` name, :ref:`Texture2D<class_Texture2D>` texture **)**
  858. Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_icon_override<class_Window_method_remove_theme_icon_override>`.
  859. See also :ref:`get_theme_icon<class_Window_method_get_theme_icon>`.
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_Window_method_add_theme_stylebox_override:
  863. .. rst-class:: classref-method
  864. void **add_theme_stylebox_override** **(** :ref:`StringName<class_StringName>` name, :ref:`StyleBox<class_StyleBox>` stylebox **)**
  865. Creates a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed with :ref:`remove_theme_stylebox_override<class_Window_method_remove_theme_stylebox_override>`.
  866. See also :ref:`get_theme_stylebox<class_Window_method_get_theme_stylebox>` and :ref:`Control.add_theme_stylebox_override<class_Control_method_add_theme_stylebox_override>` for more details.
  867. .. rst-class:: classref-item-separator
  868. ----
  869. .. _class_Window_method_begin_bulk_theme_override:
  870. .. rst-class:: classref-method
  871. void **begin_bulk_theme_override** **(** **)**
  872. Prevents ``*_theme_*_override`` methods from emitting :ref:`NOTIFICATION_THEME_CHANGED<class_Window_constant_NOTIFICATION_THEME_CHANGED>` until :ref:`end_bulk_theme_override<class_Window_method_end_bulk_theme_override>` is called.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_Window_method_can_draw:
  876. .. rst-class:: classref-method
  877. :ref:`bool<class_bool>` **can_draw** **(** **)** |const|
  878. Returns whether the window is being drawn to the screen.
  879. .. rst-class:: classref-item-separator
  880. ----
  881. .. _class_Window_method_child_controls_changed:
  882. .. rst-class:: classref-method
  883. void **child_controls_changed** **(** **)**
  884. Requests an update of the **Window** size to fit underlying :ref:`Control<class_Control>` nodes.
  885. .. rst-class:: classref-item-separator
  886. ----
  887. .. _class_Window_method_end_bulk_theme_override:
  888. .. rst-class:: classref-method
  889. void **end_bulk_theme_override** **(** **)**
  890. Ends a bulk theme override update. See :ref:`begin_bulk_theme_override<class_Window_method_begin_bulk_theme_override>`.
  891. .. rst-class:: classref-item-separator
  892. ----
  893. .. _class_Window_method_get_contents_minimum_size:
  894. .. rst-class:: classref-method
  895. :ref:`Vector2<class_Vector2>` **get_contents_minimum_size** **(** **)** |const|
  896. Returns the combined minimum size from the child :ref:`Control<class_Control>` nodes of the window. Use :ref:`child_controls_changed<class_Window_method_child_controls_changed>` to update it when child nodes have changed.
  897. .. rst-class:: classref-item-separator
  898. ----
  899. .. _class_Window_method_get_flag:
  900. .. rst-class:: classref-method
  901. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flags<enum_Window_Flags>` flag **)** |const|
  902. Returns ``true`` if the ``flag`` is set.
  903. .. rst-class:: classref-item-separator
  904. ----
  905. .. _class_Window_method_get_layout_direction:
  906. .. rst-class:: classref-method
  907. :ref:`LayoutDirection<enum_Window_LayoutDirection>` **get_layout_direction** **(** **)** |const|
  908. Returns layout direction and text writing direction.
  909. .. rst-class:: classref-item-separator
  910. ----
  911. .. _class_Window_method_get_position_with_decorations:
  912. .. rst-class:: classref-method
  913. :ref:`Vector2i<class_Vector2i>` **get_position_with_decorations** **(** **)** |const|
  914. Returns the window's position including its border.
  915. .. rst-class:: classref-item-separator
  916. ----
  917. .. _class_Window_method_get_size_with_decorations:
  918. .. rst-class:: classref-method
  919. :ref:`Vector2i<class_Vector2i>` **get_size_with_decorations** **(** **)** |const|
  920. Returns the window's size including its border.
  921. .. rst-class:: classref-item-separator
  922. ----
  923. .. _class_Window_method_get_theme_color:
  924. .. rst-class:: classref-method
  925. :ref:`Color<class_Color>` **get_theme_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  926. Returns a :ref:`Color<class_Color>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a color item with the specified ``name`` and ``theme_type``.
  927. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for more details.
  928. .. rst-class:: classref-item-separator
  929. ----
  930. .. _class_Window_method_get_theme_constant:
  931. .. rst-class:: classref-method
  932. :ref:`int<class_int>` **get_theme_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  933. Returns a constant from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a constant item with the specified ``name`` and ``theme_type``.
  934. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for more details.
  935. .. rst-class:: classref-item-separator
  936. ----
  937. .. _class_Window_method_get_theme_default_base_scale:
  938. .. rst-class:: classref-method
  939. :ref:`float<class_float>` **get_theme_default_base_scale** **(** **)** |const|
  940. Returns the default base scale value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_base_scale<class_Theme_property_default_base_scale>` value.
  941. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_Window_method_get_theme_default_font:
  945. .. rst-class:: classref-method
  946. :ref:`Font<class_Font>` **get_theme_default_font** **(** **)** |const|
  947. Returns the default font from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font<class_Theme_property_default_font>` value.
  948. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  949. .. rst-class:: classref-item-separator
  950. ----
  951. .. _class_Window_method_get_theme_default_font_size:
  952. .. rst-class:: classref-method
  953. :ref:`int<class_int>` **get_theme_default_font_size** **(** **)** |const|
  954. Returns the default font size value from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a valid :ref:`Theme.default_font_size<class_Theme_property_default_font_size>` value.
  955. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  956. .. rst-class:: classref-item-separator
  957. ----
  958. .. _class_Window_method_get_theme_font:
  959. .. rst-class:: classref-method
  960. :ref:`Font<class_Font>` **get_theme_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  961. Returns a :ref:`Font<class_Font>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font item with the specified ``name`` and ``theme_type``.
  962. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  963. .. rst-class:: classref-item-separator
  964. ----
  965. .. _class_Window_method_get_theme_font_size:
  966. .. rst-class:: classref-method
  967. :ref:`int<class_int>` **get_theme_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  968. Returns a font size from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a font size item with the specified ``name`` and ``theme_type``.
  969. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  970. .. rst-class:: classref-item-separator
  971. ----
  972. .. _class_Window_method_get_theme_icon:
  973. .. rst-class:: classref-method
  974. :ref:`Texture2D<class_Texture2D>` **get_theme_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  975. Returns an icon from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has an icon item with the specified ``name`` and ``theme_type``.
  976. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  977. .. rst-class:: classref-item-separator
  978. ----
  979. .. _class_Window_method_get_theme_stylebox:
  980. .. rst-class:: classref-method
  981. :ref:`StyleBox<class_StyleBox>` **get_theme_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  982. Returns a :ref:`StyleBox<class_StyleBox>` from the first matching :ref:`Theme<class_Theme>` in the tree if that :ref:`Theme<class_Theme>` has a stylebox item with the specified ``name`` and ``theme_type``.
  983. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_Window_method_get_window_id:
  987. .. rst-class:: classref-method
  988. :ref:`int<class_int>` **get_window_id** **(** **)** |const|
  989. Returns the ID of the window.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_Window_method_grab_focus:
  993. .. rst-class:: classref-method
  994. void **grab_focus** **(** **)**
  995. Causes the window to grab focus, allowing it to receive user input.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_Window_method_has_focus:
  999. .. rst-class:: classref-method
  1000. :ref:`bool<class_bool>` **has_focus** **(** **)** |const|
  1001. Returns ``true`` if the window is focused.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_Window_method_has_theme_color:
  1005. .. rst-class:: classref-method
  1006. :ref:`bool<class_bool>` **has_theme_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1007. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a color item with the specified ``name`` and ``theme_type``.
  1008. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1009. .. rst-class:: classref-item-separator
  1010. ----
  1011. .. _class_Window_method_has_theme_color_override:
  1012. .. rst-class:: classref-method
  1013. :ref:`bool<class_bool>` **has_theme_color_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1014. Returns ``true`` if there is a local override for a theme :ref:`Color<class_Color>` with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1015. See :ref:`add_theme_color_override<class_Window_method_add_theme_color_override>`.
  1016. .. rst-class:: classref-item-separator
  1017. ----
  1018. .. _class_Window_method_has_theme_constant:
  1019. .. rst-class:: classref-method
  1020. :ref:`bool<class_bool>` **has_theme_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1021. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a constant item with the specified ``name`` and ``theme_type``.
  1022. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1023. .. rst-class:: classref-item-separator
  1024. ----
  1025. .. _class_Window_method_has_theme_constant_override:
  1026. .. rst-class:: classref-method
  1027. :ref:`bool<class_bool>` **has_theme_constant_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1028. Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1029. See :ref:`add_theme_constant_override<class_Window_method_add_theme_constant_override>`.
  1030. .. rst-class:: classref-item-separator
  1031. ----
  1032. .. _class_Window_method_has_theme_font:
  1033. .. rst-class:: classref-method
  1034. :ref:`bool<class_bool>` **has_theme_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1035. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font item with the specified ``name`` and ``theme_type``.
  1036. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1037. .. rst-class:: classref-item-separator
  1038. ----
  1039. .. _class_Window_method_has_theme_font_override:
  1040. .. rst-class:: classref-method
  1041. :ref:`bool<class_bool>` **has_theme_font_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1042. Returns ``true`` if there is a local override for a theme :ref:`Font<class_Font>` with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1043. See :ref:`add_theme_font_override<class_Window_method_add_theme_font_override>`.
  1044. .. rst-class:: classref-item-separator
  1045. ----
  1046. .. _class_Window_method_has_theme_font_size:
  1047. .. rst-class:: classref-method
  1048. :ref:`bool<class_bool>` **has_theme_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1049. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a font size item with the specified ``name`` and ``theme_type``.
  1050. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_Window_method_has_theme_font_size_override:
  1054. .. rst-class:: classref-method
  1055. :ref:`bool<class_bool>` **has_theme_font_size_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1056. Returns ``true`` if there is a local override for a theme font size with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1057. See :ref:`add_theme_font_size_override<class_Window_method_add_theme_font_size_override>`.
  1058. .. rst-class:: classref-item-separator
  1059. ----
  1060. .. _class_Window_method_has_theme_icon:
  1061. .. rst-class:: classref-method
  1062. :ref:`bool<class_bool>` **has_theme_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1063. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has an icon item with the specified ``name`` and ``theme_type``.
  1064. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1065. .. rst-class:: classref-item-separator
  1066. ----
  1067. .. _class_Window_method_has_theme_icon_override:
  1068. .. rst-class:: classref-method
  1069. :ref:`bool<class_bool>` **has_theme_icon_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1070. Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1071. See :ref:`add_theme_icon_override<class_Window_method_add_theme_icon_override>`.
  1072. .. rst-class:: classref-item-separator
  1073. ----
  1074. .. _class_Window_method_has_theme_stylebox:
  1075. .. rst-class:: classref-method
  1076. :ref:`bool<class_bool>` **has_theme_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type="" **)** |const|
  1077. Returns ``true`` if there is a matching :ref:`Theme<class_Theme>` in the tree that has a stylebox item with the specified ``name`` and ``theme_type``.
  1078. See :ref:`Control.get_theme_color<class_Control_method_get_theme_color>` for details.
  1079. .. rst-class:: classref-item-separator
  1080. ----
  1081. .. _class_Window_method_has_theme_stylebox_override:
  1082. .. rst-class:: classref-method
  1083. :ref:`bool<class_bool>` **has_theme_stylebox_override** **(** :ref:`StringName<class_StringName>` name **)** |const|
  1084. Returns ``true`` if there is a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name`` in this :ref:`Control<class_Control>` node.
  1085. See :ref:`add_theme_stylebox_override<class_Window_method_add_theme_stylebox_override>`.
  1086. .. rst-class:: classref-item-separator
  1087. ----
  1088. .. _class_Window_method_hide:
  1089. .. rst-class:: classref-method
  1090. void **hide** **(** **)**
  1091. Hides the window. This is not the same as minimized state. Hidden window can't be interacted with and needs to be made visible with :ref:`show<class_Window_method_show>`.
  1092. .. rst-class:: classref-item-separator
  1093. ----
  1094. .. _class_Window_method_is_embedded:
  1095. .. rst-class:: classref-method
  1096. :ref:`bool<class_bool>` **is_embedded** **(** **)** |const|
  1097. Returns ``true`` if the window is currently embedded in another window.
  1098. .. rst-class:: classref-item-separator
  1099. ----
  1100. .. _class_Window_method_is_layout_rtl:
  1101. .. rst-class:: classref-method
  1102. :ref:`bool<class_bool>` **is_layout_rtl** **(** **)** |const|
  1103. Returns ``true`` if layout is right-to-left.
  1104. .. rst-class:: classref-item-separator
  1105. ----
  1106. .. _class_Window_method_is_maximize_allowed:
  1107. .. rst-class:: classref-method
  1108. :ref:`bool<class_bool>` **is_maximize_allowed** **(** **)** |const|
  1109. Returns ``true`` if the window can be maximized (the maximize button is enabled).
  1110. .. rst-class:: classref-item-separator
  1111. ----
  1112. .. _class_Window_method_is_using_font_oversampling:
  1113. .. rst-class:: classref-method
  1114. :ref:`bool<class_bool>` **is_using_font_oversampling** **(** **)** |const|
  1115. Returns ``true`` if font oversampling is enabled. See :ref:`set_use_font_oversampling<class_Window_method_set_use_font_oversampling>`.
  1116. .. rst-class:: classref-item-separator
  1117. ----
  1118. .. _class_Window_method_move_to_foreground:
  1119. .. rst-class:: classref-method
  1120. void **move_to_foreground** **(** **)**
  1121. Moves the **Window** on top of other windows and focuses it.
  1122. .. rst-class:: classref-item-separator
  1123. ----
  1124. .. _class_Window_method_popup:
  1125. .. rst-class:: classref-method
  1126. void **popup** **(** :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)**
  1127. Shows the **Window** and makes it transient (see :ref:`transient<class_Window_property_transient>`). If ``rect`` is provided, it will be set as the **Window**'s size. Fails if called on the main window.
  1128. .. rst-class:: classref-item-separator
  1129. ----
  1130. .. _class_Window_method_popup_centered:
  1131. .. rst-class:: classref-method
  1132. void **popup_centered** **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)**
  1133. Popups the **Window** at the center of the current screen, with optionally given minimum size. If the **Window** is embedded, it will be centered in the parent :ref:`Viewport<class_Viewport>` instead.
  1134. \ **Note:** Calling it with the default value of ``minsize`` is equivalent to calling it with :ref:`size<class_Window_property_size>`.
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_Window_method_popup_centered_clamped:
  1138. .. rst-class:: classref-method
  1139. void **popup_centered_clamped** **(** :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0), :ref:`float<class_float>` fallback_ratio=0.75 **)**
  1140. Popups the **Window** centered inside its parent **Window**. ``fallback_ratio`` determines the maximum size of the **Window**, in relation to its parent.
  1141. \ **Note:** Calling it with the default value of ``minsize`` is equivalent to calling it with :ref:`size<class_Window_property_size>`.
  1142. .. rst-class:: classref-item-separator
  1143. ----
  1144. .. _class_Window_method_popup_centered_ratio:
  1145. .. rst-class:: classref-method
  1146. void **popup_centered_ratio** **(** :ref:`float<class_float>` ratio=0.8 **)**
  1147. If **Window** is embedded, popups the **Window** centered inside its embedder and sets its size as a ``ratio`` of embedder's size.
  1148. If **Window** is a native window, popups the **Window** centered inside the screen of its parent **Window** and sets its size as a ``ratio`` of the screen size.
  1149. .. rst-class:: classref-item-separator
  1150. ----
  1151. .. _class_Window_method_popup_exclusive:
  1152. .. rst-class:: classref-method
  1153. void **popup_exclusive** **(** :ref:`Node<class_Node>` from_node, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)**
  1154. Attempts to parent this dialog to the last exclusive window relative to ``from_node``, and then calls :ref:`popup<class_Window_method_popup>` on it. The dialog must have no current parent, otherwise the method fails.
  1155. See also :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` and :ref:`Node.get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`.
  1156. .. rst-class:: classref-item-separator
  1157. ----
  1158. .. _class_Window_method_popup_exclusive_centered:
  1159. .. rst-class:: classref-method
  1160. void **popup_exclusive_centered** **(** :ref:`Node<class_Node>` from_node, :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0) **)**
  1161. Attempts to parent this dialog to the last exclusive window relative to ``from_node``, and then calls :ref:`popup_centered<class_Window_method_popup_centered>` on it. The dialog must have no current parent, otherwise the method fails.
  1162. See also :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` and :ref:`Node.get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`.
  1163. .. rst-class:: classref-item-separator
  1164. ----
  1165. .. _class_Window_method_popup_exclusive_centered_clamped:
  1166. .. rst-class:: classref-method
  1167. void **popup_exclusive_centered_clamped** **(** :ref:`Node<class_Node>` from_node, :ref:`Vector2i<class_Vector2i>` minsize=Vector2i(0, 0), :ref:`float<class_float>` fallback_ratio=0.75 **)**
  1168. Attempts to parent this dialog to the last exclusive window relative to ``from_node``, and then calls :ref:`popup_centered_clamped<class_Window_method_popup_centered_clamped>` on it. The dialog must have no current parent, otherwise the method fails.
  1169. See also :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` and :ref:`Node.get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`.
  1170. .. rst-class:: classref-item-separator
  1171. ----
  1172. .. _class_Window_method_popup_exclusive_centered_ratio:
  1173. .. rst-class:: classref-method
  1174. void **popup_exclusive_centered_ratio** **(** :ref:`Node<class_Node>` from_node, :ref:`float<class_float>` ratio=0.8 **)**
  1175. Attempts to parent this dialog to the last exclusive window relative to ``from_node``, and then calls :ref:`popup_centered_ratio<class_Window_method_popup_centered_ratio>` on it. The dialog must have no current parent, otherwise the method fails.
  1176. See also :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` and :ref:`Node.get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`.
  1177. .. rst-class:: classref-item-separator
  1178. ----
  1179. .. _class_Window_method_popup_exclusive_on_parent:
  1180. .. rst-class:: classref-method
  1181. void **popup_exclusive_on_parent** **(** :ref:`Node<class_Node>` from_node, :ref:`Rect2i<class_Rect2i>` parent_rect **)**
  1182. Attempts to parent this dialog to the last exclusive window relative to ``from_node``, and then calls :ref:`popup_on_parent<class_Window_method_popup_on_parent>` on it. The dialog must have no current parent, otherwise the method fails.
  1183. See also :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>` and :ref:`Node.get_last_exclusive_window<class_Node_method_get_last_exclusive_window>`.
  1184. .. rst-class:: classref-item-separator
  1185. ----
  1186. .. _class_Window_method_popup_on_parent:
  1187. .. rst-class:: classref-method
  1188. void **popup_on_parent** **(** :ref:`Rect2i<class_Rect2i>` parent_rect **)**
  1189. Popups the **Window** with a position shifted by parent **Window**'s position. If the **Window** is embedded, has the same effect as :ref:`popup<class_Window_method_popup>`.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_Window_method_remove_theme_color_override:
  1193. .. rst-class:: classref-method
  1194. void **remove_theme_color_override** **(** :ref:`StringName<class_StringName>` name **)**
  1195. Removes a local override for a theme :ref:`Color<class_Color>` with the specified ``name`` previously added by :ref:`add_theme_color_override<class_Window_method_add_theme_color_override>` or via the Inspector dock.
  1196. .. rst-class:: classref-item-separator
  1197. ----
  1198. .. _class_Window_method_remove_theme_constant_override:
  1199. .. rst-class:: classref-method
  1200. void **remove_theme_constant_override** **(** :ref:`StringName<class_StringName>` name **)**
  1201. Removes a local override for a theme constant with the specified ``name`` previously added by :ref:`add_theme_constant_override<class_Window_method_add_theme_constant_override>` or via the Inspector dock.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_Window_method_remove_theme_font_override:
  1205. .. rst-class:: classref-method
  1206. void **remove_theme_font_override** **(** :ref:`StringName<class_StringName>` name **)**
  1207. Removes a local override for a theme :ref:`Font<class_Font>` with the specified ``name`` previously added by :ref:`add_theme_font_override<class_Window_method_add_theme_font_override>` or via the Inspector dock.
  1208. .. rst-class:: classref-item-separator
  1209. ----
  1210. .. _class_Window_method_remove_theme_font_size_override:
  1211. .. rst-class:: classref-method
  1212. void **remove_theme_font_size_override** **(** :ref:`StringName<class_StringName>` name **)**
  1213. Removes a local override for a theme font size with the specified ``name`` previously added by :ref:`add_theme_font_size_override<class_Window_method_add_theme_font_size_override>` or via the Inspector dock.
  1214. .. rst-class:: classref-item-separator
  1215. ----
  1216. .. _class_Window_method_remove_theme_icon_override:
  1217. .. rst-class:: classref-method
  1218. void **remove_theme_icon_override** **(** :ref:`StringName<class_StringName>` name **)**
  1219. Removes a local override for a theme icon with the specified ``name`` previously added by :ref:`add_theme_icon_override<class_Window_method_add_theme_icon_override>` or via the Inspector dock.
  1220. .. rst-class:: classref-item-separator
  1221. ----
  1222. .. _class_Window_method_remove_theme_stylebox_override:
  1223. .. rst-class:: classref-method
  1224. void **remove_theme_stylebox_override** **(** :ref:`StringName<class_StringName>` name **)**
  1225. Removes a local override for a theme :ref:`StyleBox<class_StyleBox>` with the specified ``name`` previously added by :ref:`add_theme_stylebox_override<class_Window_method_add_theme_stylebox_override>` or via the Inspector dock.
  1226. .. rst-class:: classref-item-separator
  1227. ----
  1228. .. _class_Window_method_request_attention:
  1229. .. rst-class:: classref-method
  1230. void **request_attention** **(** **)**
  1231. Tells the OS that the **Window** needs an attention. This makes the window stand out in some way depending on the system, e.g. it might blink on the task bar.
  1232. .. rst-class:: classref-item-separator
  1233. ----
  1234. .. _class_Window_method_reset_size:
  1235. .. rst-class:: classref-method
  1236. void **reset_size** **(** **)**
  1237. Resets the size to the minimum size, which is the max of :ref:`min_size<class_Window_property_min_size>` and (if :ref:`wrap_controls<class_Window_property_wrap_controls>` is enabled) :ref:`get_contents_minimum_size<class_Window_method_get_contents_minimum_size>`. This is equivalent to calling ``set_size(Vector2i())`` (or any size below the minimum).
  1238. .. rst-class:: classref-item-separator
  1239. ----
  1240. .. _class_Window_method_set_flag:
  1241. .. rst-class:: classref-method
  1242. void **set_flag** **(** :ref:`Flags<enum_Window_Flags>` flag, :ref:`bool<class_bool>` enabled **)**
  1243. Sets a specified window flag.
  1244. .. rst-class:: classref-item-separator
  1245. ----
  1246. .. _class_Window_method_set_ime_active:
  1247. .. rst-class:: classref-method
  1248. void **set_ime_active** **(** :ref:`bool<class_bool>` active **)**
  1249. If ``active`` is ``true``, enables system's native IME (Input Method Editor).
  1250. .. rst-class:: classref-item-separator
  1251. ----
  1252. .. _class_Window_method_set_ime_position:
  1253. .. rst-class:: classref-method
  1254. void **set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1255. Moves IME to the given position.
  1256. .. rst-class:: classref-item-separator
  1257. ----
  1258. .. _class_Window_method_set_layout_direction:
  1259. .. rst-class:: classref-method
  1260. void **set_layout_direction** **(** :ref:`LayoutDirection<enum_Window_LayoutDirection>` direction **)**
  1261. Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
  1262. .. rst-class:: classref-item-separator
  1263. ----
  1264. .. _class_Window_method_set_unparent_when_invisible:
  1265. .. rst-class:: classref-method
  1266. void **set_unparent_when_invisible** **(** :ref:`bool<class_bool>` unparent **)**
  1267. If ``unparent`` is ``true``, the window is automatically unparented when going invisible.
  1268. \ **Note:** Make sure to keep a reference to the node, otherwise it will be orphaned. You also need to manually call :ref:`Node.queue_free<class_Node_method_queue_free>` to free the window if it's not parented.
  1269. .. rst-class:: classref-item-separator
  1270. ----
  1271. .. _class_Window_method_set_use_font_oversampling:
  1272. .. rst-class:: classref-method
  1273. void **set_use_font_oversampling** **(** :ref:`bool<class_bool>` enable **)**
  1274. Enables font oversampling. This makes fonts look better when they are scaled up.
  1275. .. rst-class:: classref-item-separator
  1276. ----
  1277. .. _class_Window_method_show:
  1278. .. rst-class:: classref-method
  1279. void **show** **(** **)**
  1280. Makes the **Window** appear. This enables interactions with the **Window** and doesn't change any of its property other than visibility (unlike e.g. :ref:`popup<class_Window_method_popup>`).
  1281. .. rst-class:: classref-section-separator
  1282. ----
  1283. .. rst-class:: classref-descriptions-group
  1284. Theme Property Descriptions
  1285. ---------------------------
  1286. .. _class_Window_theme_color_title_color:
  1287. .. rst-class:: classref-themeproperty
  1288. :ref:`Color<class_Color>` **title_color** = ``Color(0.875, 0.875, 0.875, 1)``
  1289. The color of the title's text.
  1290. .. rst-class:: classref-item-separator
  1291. ----
  1292. .. _class_Window_theme_color_title_outline_modulate:
  1293. .. rst-class:: classref-themeproperty
  1294. :ref:`Color<class_Color>` **title_outline_modulate** = ``Color(1, 1, 1, 1)``
  1295. The color of the title's text outline.
  1296. .. rst-class:: classref-item-separator
  1297. ----
  1298. .. _class_Window_theme_constant_close_h_offset:
  1299. .. rst-class:: classref-themeproperty
  1300. :ref:`int<class_int>` **close_h_offset** = ``18``
  1301. Horizontal position offset of the close button.
  1302. .. rst-class:: classref-item-separator
  1303. ----
  1304. .. _class_Window_theme_constant_close_v_offset:
  1305. .. rst-class:: classref-themeproperty
  1306. :ref:`int<class_int>` **close_v_offset** = ``24``
  1307. Vertical position offset of the close button.
  1308. .. rst-class:: classref-item-separator
  1309. ----
  1310. .. _class_Window_theme_constant_resize_margin:
  1311. .. rst-class:: classref-themeproperty
  1312. :ref:`int<class_int>` **resize_margin** = ``4``
  1313. Defines the outside margin at which the window border can be grabbed with mouse and resized.
  1314. .. rst-class:: classref-item-separator
  1315. ----
  1316. .. _class_Window_theme_constant_title_height:
  1317. .. rst-class:: classref-themeproperty
  1318. :ref:`int<class_int>` **title_height** = ``36``
  1319. Height of the title bar.
  1320. .. rst-class:: classref-item-separator
  1321. ----
  1322. .. _class_Window_theme_constant_title_outline_size:
  1323. .. rst-class:: classref-themeproperty
  1324. :ref:`int<class_int>` **title_outline_size** = ``0``
  1325. The size of the title outline.
  1326. .. rst-class:: classref-item-separator
  1327. ----
  1328. .. _class_Window_theme_font_title_font:
  1329. .. rst-class:: classref-themeproperty
  1330. :ref:`Font<class_Font>` **title_font**
  1331. The font used to draw the title.
  1332. .. rst-class:: classref-item-separator
  1333. ----
  1334. .. _class_Window_theme_font_size_title_font_size:
  1335. .. rst-class:: classref-themeproperty
  1336. :ref:`int<class_int>` **title_font_size**
  1337. The size of the title font.
  1338. .. rst-class:: classref-item-separator
  1339. ----
  1340. .. _class_Window_theme_icon_close:
  1341. .. rst-class:: classref-themeproperty
  1342. :ref:`Texture2D<class_Texture2D>` **close**
  1343. The icon for the close button.
  1344. .. rst-class:: classref-item-separator
  1345. ----
  1346. .. _class_Window_theme_icon_close_pressed:
  1347. .. rst-class:: classref-themeproperty
  1348. :ref:`Texture2D<class_Texture2D>` **close_pressed**
  1349. The icon for the close button when it's being pressed.
  1350. .. rst-class:: classref-item-separator
  1351. ----
  1352. .. _class_Window_theme_style_embedded_border:
  1353. .. rst-class:: classref-themeproperty
  1354. :ref:`StyleBox<class_StyleBox>` **embedded_border**
  1355. The background style used when the **Window** is embedded. Note that this is drawn only under the window's content, excluding the title. For proper borders and title bar style, you can use ``expand_margin_*`` properties of :ref:`StyleBoxFlat<class_StyleBoxFlat>`.
  1356. \ **Note:** The content background will not be visible unless :ref:`transparent<class_Window_property_transparent>` is enabled.
  1357. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1358. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1359. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1360. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1361. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1362. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1363. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`