class_window.rst 109 KB

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