class_window.rst 135 KB

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