class_window.rst 158 KB

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