class_window.rst 144 KB

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