class_displayserver.rst 128 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the DisplayServer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_DisplayServer:
  6. DisplayServer
  7. =============
  8. **Inherits:** :ref:`Object<class_Object>`
  9. Methods
  10. -------
  11. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | :ref:`String<class_String>` | :ref:`clipboard_get<class_DisplayServer_method_clipboard_get>` **(** **)** |const| |
  13. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
  15. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`clipboard_has<class_DisplayServer_method_clipboard_has>` **(** **)** |const| |
  17. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
  19. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
  21. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`create_sub_window<class_DisplayServer_method_create_sub_window>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` flags, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)** |
  23. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
  25. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`cursor_set_custom_image<class_DisplayServer_method_cursor_set_custom_image>` **(** :ref:`Resource<class_Resource>` cursor, :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape=0, :ref:`Vector2<class_Vector2>` hotspot=Vector2(0, 0) **)** |
  27. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
  29. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`delete_sub_window<class_DisplayServer_method_delete_sub_window>` **(** :ref:`int<class_int>` window_id **)** |
  31. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_input_text<class_DisplayServer_method_dialog_input_text>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`String<class_String>` existing_text, :ref:`Callable<class_Callable>` callback **)** |
  33. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_show<class_DisplayServer_method_dialog_show>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`PackedStringArray<class_PackedStringArray>` buttons, :ref:`Callable<class_Callable>` callback **)** |
  35. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
  37. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
  39. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
  41. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
  43. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
  45. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  47. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
  49. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`global_menu_add_check_item<class_DisplayServer_method_global_menu_add_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)** |
  51. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`global_menu_add_item<class_DisplayServer_method_global_menu_add_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)** |
  53. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root **)** |
  55. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu **)** |
  57. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
  59. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_callback<class_DisplayServer_method_global_menu_get_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  61. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`String<class_String>` | :ref:`global_menu_get_item_submenu<class_DisplayServer_method_global_menu_get_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  63. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Variant<class_Variant>` | :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  65. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`String<class_String>` | :ref:`global_menu_get_item_text<class_DisplayServer_method_global_menu_get_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  67. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checkable<class_DisplayServer_method_global_menu_is_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  69. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checked<class_DisplayServer_method_global_menu_is_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  71. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  73. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`global_menu_set_item_callback<class_DisplayServer_method_global_menu_set_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)** |
  75. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`global_menu_set_item_checkable<class_DisplayServer_method_global_menu_set_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
  77. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
  79. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`global_menu_set_item_submenu<class_DisplayServer_method_global_menu_set_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)** |
  81. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)** |
  83. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`global_menu_set_item_text<class_DisplayServer_method_global_menu_set_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  85. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  87. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  89. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  91. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  93. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`keyboard_get_keycode_from_physical<class_DisplayServer_method_keyboard_get_keycode_from_physical>` **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const| |
  95. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  97. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  99. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  101. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  103. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  105. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  107. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  109. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  111. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`mouse_warp_to_position<class_DisplayServer_method_mouse_warp_to_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  113. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  115. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  117. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  119. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  121. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  123. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  125. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  127. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  129. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  131. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  133. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`screen_is_touchscreen<class_DisplayServer_method_screen_is_touchscreen>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  135. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  137. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  139. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  141. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  143. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  145. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  147. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  149. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  151. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  153. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  155. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`virtual_keyboard_show<class_DisplayServer_method_virtual_keyboard_show>` **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`bool<class_bool>` multiline=false, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)** |
  157. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`window_attach_instance_id<class_DisplayServer_method_window_attach_instance_id>` **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)** |
  159. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  161. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  163. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`int<class_int>` | :ref:`window_get_attached_instance_id<class_DisplayServer_method_window_get_attached_instance_id>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  165. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  167. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`bool<class_bool>` | :ref:`window_get_flag<class_DisplayServer_method_window_get_flag>` **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const| |
  169. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  171. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  173. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  175. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`int<class_int>` | :ref:`window_get_native_handle<class_DisplayServer_method_window_get_native_handle>` **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const| |
  177. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  179. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  181. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_real_size<class_DisplayServer_method_window_get_real_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  183. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  185. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` | :ref:`window_get_vsync_mode<class_DisplayServer_method_window_get_vsync_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  187. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  189. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  191. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`window_set_current_screen<class_DisplayServer_method_window_set_current_screen>` **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)** |
  193. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`window_set_drop_files_callback<class_DisplayServer_method_window_set_drop_files_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
  195. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  197. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | void | :ref:`window_set_flag<class_DisplayServer_method_window_set_flag>` **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)** |
  199. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | void | :ref:`window_set_ime_active<class_DisplayServer_method_window_set_ime_active>` **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)** |
  201. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | void | :ref:`window_set_ime_position<class_DisplayServer_method_window_set_ime_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  203. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | void | :ref:`window_set_input_event_callback<class_DisplayServer_method_window_set_input_event_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
  205. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`window_set_input_text_callback<class_DisplayServer_method_window_set_input_text_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
  207. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | void | :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>` **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)** |
  209. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | void | :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>` **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)** |
  211. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  213. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`window_set_mouse_passthrough<class_DisplayServer_method_window_set_mouse_passthrough>` **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)** |
  215. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | void | :ref:`window_set_popup_safe_rect<class_DisplayServer_method_window_set_popup_safe_rect>` **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)** |
  217. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  219. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | void | :ref:`window_set_rect_changed_callback<class_DisplayServer_method_window_set_rect_changed_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
  221. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  223. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  225. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  227. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | void | :ref:`window_set_vsync_mode<class_DisplayServer_method_window_set_vsync_mode>` **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)** |
  229. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | void | :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
  231. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. Enumerations
  233. ------------
  234. .. _enum_DisplayServer_Feature:
  235. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  236. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  237. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  238. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  239. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  240. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  241. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  242. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  243. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  244. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  245. .. _class_DisplayServer_constant_FEATURE_IME:
  246. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  247. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  248. .. _class_DisplayServer_constant_FEATURE_ICON:
  249. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  250. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  251. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  252. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  253. enum **Feature**:
  254. - **FEATURE_GLOBAL_MENU** = **0**
  255. - **FEATURE_SUBWINDOWS** = **1**
  256. - **FEATURE_TOUCHSCREEN** = **2**
  257. - **FEATURE_MOUSE** = **3**
  258. - **FEATURE_MOUSE_WARP** = **4**
  259. - **FEATURE_CLIPBOARD** = **5**
  260. - **FEATURE_VIRTUAL_KEYBOARD** = **6**
  261. - **FEATURE_CURSOR_SHAPE** = **7**
  262. - **FEATURE_CUSTOM_CURSOR_SHAPE** = **8**
  263. - **FEATURE_NATIVE_DIALOG** = **9**
  264. - **FEATURE_IME** = **10**
  265. - **FEATURE_WINDOW_TRANSPARENCY** = **11**
  266. - **FEATURE_HIDPI** = **12**
  267. - **FEATURE_ICON** = **13**
  268. - **FEATURE_NATIVE_ICON** = **14**
  269. - **FEATURE_ORIENTATION** = **15**
  270. - **FEATURE_SWAP_BUFFERS** = **16**
  271. - **FEATURE_CLIPBOARD_PRIMARY** = **18**
  272. ----
  273. .. _enum_DisplayServer_MouseMode:
  274. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  275. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  276. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  277. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  278. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  279. enum **MouseMode**:
  280. - **MOUSE_MODE_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden.
  281. - **MOUSE_MODE_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible.
  282. - **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
  283. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  284. - **MOUSE_MODE_CONFINED** = **3** --- Confines the mouse cursor to the game window, and make it visible.
  285. - **MOUSE_MODE_CONFINED_HIDDEN** = **4** --- Confines the mouse cursor to the game window, and make it hidden.
  286. ----
  287. .. _enum_DisplayServer_ScreenOrientation:
  288. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  289. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  290. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  291. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  292. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  293. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  294. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  295. enum **ScreenOrientation**:
  296. - **SCREEN_LANDSCAPE** = **0**
  297. - **SCREEN_PORTRAIT** = **1**
  298. - **SCREEN_REVERSE_LANDSCAPE** = **2**
  299. - **SCREEN_REVERSE_PORTRAIT** = **3**
  300. - **SCREEN_SENSOR_LANDSCAPE** = **4**
  301. - **SCREEN_SENSOR_PORTRAIT** = **5**
  302. - **SCREEN_SENSOR** = **6**
  303. ----
  304. .. _enum_DisplayServer_CursorShape:
  305. .. _class_DisplayServer_constant_CURSOR_ARROW:
  306. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  307. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  308. .. _class_DisplayServer_constant_CURSOR_CROSS:
  309. .. _class_DisplayServer_constant_CURSOR_WAIT:
  310. .. _class_DisplayServer_constant_CURSOR_BUSY:
  311. .. _class_DisplayServer_constant_CURSOR_DRAG:
  312. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  313. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  314. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  315. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  316. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  317. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  318. .. _class_DisplayServer_constant_CURSOR_MOVE:
  319. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  320. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  321. .. _class_DisplayServer_constant_CURSOR_HELP:
  322. .. _class_DisplayServer_constant_CURSOR_MAX:
  323. enum **CursorShape**:
  324. - **CURSOR_ARROW** = **0**
  325. - **CURSOR_IBEAM** = **1**
  326. - **CURSOR_POINTING_HAND** = **2**
  327. - **CURSOR_CROSS** = **3**
  328. - **CURSOR_WAIT** = **4**
  329. - **CURSOR_BUSY** = **5**
  330. - **CURSOR_DRAG** = **6**
  331. - **CURSOR_CAN_DROP** = **7**
  332. - **CURSOR_FORBIDDEN** = **8**
  333. - **CURSOR_VSIZE** = **9**
  334. - **CURSOR_HSIZE** = **10**
  335. - **CURSOR_BDIAGSIZE** = **11**
  336. - **CURSOR_FDIAGSIZE** = **12**
  337. - **CURSOR_MOVE** = **13**
  338. - **CURSOR_VSPLIT** = **14**
  339. - **CURSOR_HSPLIT** = **15**
  340. - **CURSOR_HELP** = **16**
  341. - **CURSOR_MAX** = **17**
  342. ----
  343. .. _enum_DisplayServer_WindowMode:
  344. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  345. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  346. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  347. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  348. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  349. enum **WindowMode**:
  350. - **WINDOW_MODE_WINDOWED** = **0**
  351. - **WINDOW_MODE_MINIMIZED** = **1**
  352. - **WINDOW_MODE_MAXIMIZED** = **2**
  353. - **WINDOW_MODE_FULLSCREEN** = **3** --- Fullscreen window mode. Note that this is not *exclusive* fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
  354. Regardless of the platform, enabling fullscreen 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 fullscreen mode.
  355. - **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = **4** --- Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to :ref:`WINDOW_MODE_FULLSCREEN<class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN>`.
  356. Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence.
  357. Regardless of the platform, enabling fullscreen 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 fullscreen mode.
  358. ----
  359. .. _enum_DisplayServer_WindowFlags:
  360. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  361. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  362. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  363. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  364. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  365. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  366. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  367. enum **WindowFlags**:
  368. - **WINDOW_FLAG_RESIZE_DISABLED** = **0** --- Window can't be resizing by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size<class_DisplayServer_method_window_set_size>`. This flag is ignored for full screen windows.
  369. - **WINDOW_FLAG_BORDERLESS** = **1** --- Window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  370. - **WINDOW_FLAG_ALWAYS_ON_TOP** = **2** --- Window is floating above other regular windows. This flag is ignored for full-screen windows.
  371. - **WINDOW_FLAG_TRANSPARENT** = **3** --- Window is will be destroyed with its transient parent and displayed on top of non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
  372. - **WINDOW_FLAG_NO_FOCUS** = **4** --- Window can't be focused. No-focus window will ignore all input, except mouse clicks.
  373. - **WINDOW_FLAG_POPUP** = **5** --- Window is part of menu or :ref:`OptionButton<class_OptionButton>` dropdown. This flag can't be changed when window is visible. An active popup window will exclusivly 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 :ref:`WINDOW_FLAG_TRANSPARENT<class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT>` set.
  374. - **WINDOW_FLAG_MAX** = **6**
  375. ----
  376. .. _enum_DisplayServer_WindowEvent:
  377. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  378. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  379. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  380. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  381. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  382. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  383. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  384. enum **WindowEvent**:
  385. - **WINDOW_EVENT_MOUSE_ENTER** = **0**
  386. - **WINDOW_EVENT_MOUSE_EXIT** = **1**
  387. - **WINDOW_EVENT_FOCUS_IN** = **2**
  388. - **WINDOW_EVENT_FOCUS_OUT** = **3**
  389. - **WINDOW_EVENT_CLOSE_REQUEST** = **4**
  390. - **WINDOW_EVENT_GO_BACK_REQUEST** = **5**
  391. - **WINDOW_EVENT_DPI_CHANGE** = **6**
  392. ----
  393. .. _enum_DisplayServer_VSyncMode:
  394. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  395. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  396. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  397. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  398. enum **VSyncMode**:
  399. - **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
  400. - **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
  401. - **VSYNC_ADAPTIVE** = **2** --- Behaves like :ref:`VSYNC_DISABLED<class_DisplayServer_constant_VSYNC_DISABLED>` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible), otherwise vertical synchronization is enabled to avoid tearing.
  402. - **VSYNC_MAILBOX** = **3** --- Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible).
  403. Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag.
  404. ----
  405. .. _enum_DisplayServer_HandleType:
  406. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  407. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  408. .. _class_DisplayServer_constant_WINDOW_VIEW:
  409. enum **HandleType**:
  410. - **DISPLAY_HANDLE** = **0** --- Display handle:
  411. - Linux: ``X11::Display*`` for the display.
  412. - **WINDOW_HANDLE** = **1** --- Window handle:
  413. - Windows: ``HWND`` for the window.
  414. - Linux: ``X11::Window*`` for the window.
  415. - MacOS: ``NSWindow*`` for the window.
  416. - iOS: ``UIViewController*`` for the view controller.
  417. - Android: ``jObject`` for the activity.
  418. - **WINDOW_VIEW** = **2** --- Window view:
  419. - MacOS: ``NSView*`` for the window main view.
  420. - iOS: ``UIView*`` for the window main view.
  421. Constants
  422. ---------
  423. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  424. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  425. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  426. - **SCREEN_OF_MAIN_WINDOW** = **-1**
  427. - **MAIN_WINDOW_ID** = **0**
  428. - **INVALID_WINDOW_ID** = **-1**
  429. Method Descriptions
  430. -------------------
  431. .. _class_DisplayServer_method_clipboard_get:
  432. - :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  433. Returns the user's clipboard as a string if possible.
  434. ----
  435. .. _class_DisplayServer_method_clipboard_get_primary:
  436. - :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  437. Returns the user's primary clipboard as a string if possible.
  438. \ **Note:** This method is only implemented on Linux.
  439. ----
  440. .. _class_DisplayServer_method_clipboard_has:
  441. - :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  442. Returns ``true`` if there is content on the user's clipboard.
  443. ----
  444. .. _class_DisplayServer_method_clipboard_set:
  445. - void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  446. Sets the user's clipboard content to the given string.
  447. ----
  448. .. _class_DisplayServer_method_clipboard_set_primary:
  449. - void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  450. Sets the user's primary clipboard content to the given string.
  451. \ **Note:** This method is only implemented on Linux.
  452. ----
  453. .. _class_DisplayServer_method_create_sub_window:
  454. - :ref:`int<class_int>` **create_sub_window** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` flags, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)**
  455. ----
  456. .. _class_DisplayServer_method_cursor_get_shape:
  457. - :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  458. ----
  459. .. _class_DisplayServer_method_cursor_set_custom_image:
  460. - void **cursor_set_custom_image** **(** :ref:`Resource<class_Resource>` cursor, :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape=0, :ref:`Vector2<class_Vector2>` hotspot=Vector2(0, 0) **)**
  461. ----
  462. .. _class_DisplayServer_method_cursor_set_shape:
  463. - void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  464. ----
  465. .. _class_DisplayServer_method_delete_sub_window:
  466. - void **delete_sub_window** **(** :ref:`int<class_int>` window_id **)**
  467. ----
  468. .. _class_DisplayServer_method_dialog_input_text:
  469. - :ref:`Error<enum_@GlobalScope_Error>` **dialog_input_text** **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`String<class_String>` existing_text, :ref:`Callable<class_Callable>` callback **)**
  470. ----
  471. .. _class_DisplayServer_method_dialog_show:
  472. - :ref:`Error<enum_@GlobalScope_Error>` **dialog_show** **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`PackedStringArray<class_PackedStringArray>` buttons, :ref:`Callable<class_Callable>` callback **)**
  473. ----
  474. .. _class_DisplayServer_method_enable_for_stealing_focus:
  475. - void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  476. ----
  477. .. _class_DisplayServer_method_force_process_and_drop_events:
  478. - void **force_process_and_drop_events** **(** **)**
  479. ----
  480. .. _class_DisplayServer_method_get_name:
  481. - :ref:`String<class_String>` **get_name** **(** **)** |const|
  482. ----
  483. .. _class_DisplayServer_method_get_screen_count:
  484. - :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  485. ----
  486. .. _class_DisplayServer_method_get_swap_cancel_ok:
  487. - :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  488. ----
  489. .. _class_DisplayServer_method_get_window_at_screen_position:
  490. - :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  491. ----
  492. .. _class_DisplayServer_method_get_window_list:
  493. - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  494. ----
  495. .. _class_DisplayServer_method_global_menu_add_check_item:
  496. - void **global_menu_add_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)**
  497. ----
  498. .. _class_DisplayServer_method_global_menu_add_item:
  499. - void **global_menu_add_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)**
  500. ----
  501. .. _class_DisplayServer_method_global_menu_add_separator:
  502. - void **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root **)**
  503. ----
  504. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  505. - void **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu **)**
  506. ----
  507. .. _class_DisplayServer_method_global_menu_clear:
  508. - void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  509. ----
  510. .. _class_DisplayServer_method_global_menu_get_item_callback:
  511. - :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  512. ----
  513. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  514. - :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  515. ----
  516. .. _class_DisplayServer_method_global_menu_get_item_tag:
  517. - :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  518. ----
  519. .. _class_DisplayServer_method_global_menu_get_item_text:
  520. - :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  521. ----
  522. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  523. - :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  524. ----
  525. .. _class_DisplayServer_method_global_menu_is_item_checked:
  526. - :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  527. ----
  528. .. _class_DisplayServer_method_global_menu_remove_item:
  529. - void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  530. ----
  531. .. _class_DisplayServer_method_global_menu_set_item_callback:
  532. - void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  533. ----
  534. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  535. - void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  536. ----
  537. .. _class_DisplayServer_method_global_menu_set_item_checked:
  538. - void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  539. ----
  540. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  541. - void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  542. ----
  543. .. _class_DisplayServer_method_global_menu_set_item_tag:
  544. - void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  545. ----
  546. .. _class_DisplayServer_method_global_menu_set_item_text:
  547. - void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  548. ----
  549. .. _class_DisplayServer_method_has_feature:
  550. - :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  551. ----
  552. .. _class_DisplayServer_method_ime_get_selection:
  553. - :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  554. ----
  555. .. _class_DisplayServer_method_ime_get_text:
  556. - :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  557. ----
  558. .. _class_DisplayServer_method_keyboard_get_current_layout:
  559. - :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  560. Returns active keyboard layout index.
  561. \ **Note:** This method is implemented on Linux, macOS and Windows.
  562. ----
  563. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  564. - :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  565. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  566. \ **Note:** This method is implemented on Linux, macOS and Windows.
  567. ----
  568. .. _class_DisplayServer_method_keyboard_get_layout_count:
  569. - :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  570. Returns the number of keyboard layouts.
  571. \ **Note:** This method is implemented on Linux, macOS and Windows.
  572. ----
  573. .. _class_DisplayServer_method_keyboard_get_layout_language:
  574. - :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  575. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  576. \ **Note:** This method is implemented on Linux, macOS and Windows.
  577. ----
  578. .. _class_DisplayServer_method_keyboard_get_layout_name:
  579. - :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  580. Returns the localized name of the keyboard layout at position ``index``.
  581. \ **Note:** This method is implemented on Linux, macOS and Windows.
  582. ----
  583. .. _class_DisplayServer_method_keyboard_set_current_layout:
  584. - void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  585. Sets active keyboard layout.
  586. \ **Note:** This method is implemented on Linux, macOS and Windows.
  587. ----
  588. .. _class_DisplayServer_method_mouse_get_button_state:
  589. - :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **mouse_get_button_state** **(** **)** |const|
  590. ----
  591. .. _class_DisplayServer_method_mouse_get_mode:
  592. - :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  593. ----
  594. .. _class_DisplayServer_method_mouse_get_position:
  595. - :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  596. Returns the mouse cursor's current position.
  597. ----
  598. .. _class_DisplayServer_method_mouse_set_mode:
  599. - void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  600. ----
  601. .. _class_DisplayServer_method_mouse_warp_to_position:
  602. - void **mouse_warp_to_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  603. Sets the mouse cursor position to the given ``position``.
  604. ----
  605. .. _class_DisplayServer_method_process_events:
  606. - void **process_events** **(** **)**
  607. ----
  608. .. _class_DisplayServer_method_screen_get_dpi:
  609. - :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  610. Returns the dots per inch density of the specified screen. If ``screen`` is ``\ SCREEN_OF_MAIN_WINDOW`` (the default value), a screen with the main window will be used.
  611. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  612. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  613. ::
  614. ldpi - 120 dpi
  615. mdpi - 160 dpi
  616. hdpi - 240 dpi
  617. xhdpi - 320 dpi
  618. xxhdpi - 480 dpi
  619. xxxhdpi - 640 dpi
  620. \ **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
  621. ----
  622. .. _class_DisplayServer_method_screen_get_max_scale:
  623. - :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  624. Returns the greatest scale factor of all screens.
  625. \ **Note:** On macOS returned value is ``2.0`` if there is at least one hiDPI (Retina) screen in the system, and ``1.0`` in all other cases.
  626. \ **Note:** This method is implemented on macOS.
  627. ----
  628. .. _class_DisplayServer_method_screen_get_orientation:
  629. - :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  630. ----
  631. .. _class_DisplayServer_method_screen_get_position:
  632. - :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  633. ----
  634. .. _class_DisplayServer_method_screen_get_refresh_rate:
  635. - :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  636. Returns the current refresh rate of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW<class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW>` (the default value), a screen with the main window will be used.
  637. \ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On HTML5, :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform.
  638. To fallback to a default refresh rate if the method fails, try:
  639. ::
  640. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  641. if refresh_rate < 0:
  642. refresh_rate = 60.0
  643. ----
  644. .. _class_DisplayServer_method_screen_get_scale:
  645. - :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  646. Returns the scale factor of the specified screen by index.
  647. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  648. \ **Note:** This method is implemented on macOS.
  649. ----
  650. .. _class_DisplayServer_method_screen_get_size:
  651. - :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  652. ----
  653. .. _class_DisplayServer_method_screen_get_usable_rect:
  654. - :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  655. ----
  656. .. _class_DisplayServer_method_screen_is_kept_on:
  657. - :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  658. ----
  659. .. _class_DisplayServer_method_screen_is_touchscreen:
  660. - :ref:`bool<class_bool>` **screen_is_touchscreen** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  661. ----
  662. .. _class_DisplayServer_method_screen_set_keep_on:
  663. - void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  664. ----
  665. .. _class_DisplayServer_method_screen_set_orientation:
  666. - void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  667. ----
  668. .. _class_DisplayServer_method_set_icon:
  669. - void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  670. ----
  671. .. _class_DisplayServer_method_set_native_icon:
  672. - void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  673. ----
  674. .. _class_DisplayServer_method_tablet_get_current_driver:
  675. - :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  676. Returns current active tablet driver name.
  677. \ **Note:** This method is implemented on Windows.
  678. ----
  679. .. _class_DisplayServer_method_tablet_get_driver_count:
  680. - :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  681. Returns the total number of available tablet drivers.
  682. \ **Note:** This method is implemented on Windows.
  683. ----
  684. .. _class_DisplayServer_method_tablet_get_driver_name:
  685. - :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  686. Returns the tablet driver name for the given index.
  687. \ **Note:** This method is implemented on Windows.
  688. ----
  689. .. _class_DisplayServer_method_tablet_set_current_driver:
  690. - void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  691. Set active tablet driver name.
  692. \ **Note:** This method is implemented on Windows.
  693. ----
  694. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  695. - :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  696. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  697. ----
  698. .. _class_DisplayServer_method_virtual_keyboard_hide:
  699. - void **virtual_keyboard_hide** **(** **)**
  700. Hides the virtual keyboard if it is shown, does nothing otherwise.
  701. ----
  702. .. _class_DisplayServer_method_virtual_keyboard_show:
  703. - void **virtual_keyboard_show** **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`bool<class_bool>` multiline=false, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)**
  704. Shows the virtual keyboard if the platform has one.
  705. \ ``existing_text`` parameter is useful for implementing your own :ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
  706. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  707. \ ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
  708. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  709. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  710. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  711. \ **Note:** This method is implemented on Android, iOS and UWP.
  712. ----
  713. .. _class_DisplayServer_method_window_attach_instance_id:
  714. - void **window_attach_instance_id** **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)**
  715. ----
  716. .. _class_DisplayServer_method_window_can_draw:
  717. - :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  718. ----
  719. .. _class_DisplayServer_method_window_get_active_popup:
  720. - :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  721. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  722. ----
  723. .. _class_DisplayServer_method_window_get_attached_instance_id:
  724. - :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  725. ----
  726. .. _class_DisplayServer_method_window_get_current_screen:
  727. - :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  728. ----
  729. .. _class_DisplayServer_method_window_get_flag:
  730. - :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  731. Returns the current value of the given window's ``flag``.
  732. ----
  733. .. _class_DisplayServer_method_window_get_max_size:
  734. - :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  735. ----
  736. .. _class_DisplayServer_method_window_get_min_size:
  737. - :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  738. ----
  739. .. _class_DisplayServer_method_window_get_mode:
  740. - :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  741. Returns the mode of the given window.
  742. ----
  743. .. _class_DisplayServer_method_window_get_native_handle:
  744. - :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  745. Returns internal structure pointers for use in plugins.
  746. \ **Note:** This method is implemented on Android, Linux, macOS and Windows.
  747. ----
  748. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  749. - :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  750. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  751. ----
  752. .. _class_DisplayServer_method_window_get_position:
  753. - :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  754. Returns the position of the given window to on the screen.
  755. ----
  756. .. _class_DisplayServer_method_window_get_real_size:
  757. - :ref:`Vector2i<class_Vector2i>` **window_get_real_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  758. ----
  759. .. _class_DisplayServer_method_window_get_size:
  760. - :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  761. ----
  762. .. _class_DisplayServer_method_window_get_vsync_mode:
  763. - :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  764. Returns the VSync mode of the given window.
  765. ----
  766. .. _class_DisplayServer_method_window_move_to_foreground:
  767. - void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  768. ----
  769. .. _class_DisplayServer_method_window_request_attention:
  770. - void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  771. ----
  772. .. _class_DisplayServer_method_window_set_current_screen:
  773. - void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  774. ----
  775. .. _class_DisplayServer_method_window_set_drop_files_callback:
  776. - void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  777. ----
  778. .. _class_DisplayServer_method_window_set_exclusive:
  779. - void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  780. If set to ``true``, this window will always stay on top of its parent window, parent window will ignore input while this window is opened.
  781. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  782. \ **Note:** This method is implemented on macOS and Windows.
  783. ----
  784. .. _class_DisplayServer_method_window_set_flag:
  785. - void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  786. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  787. ----
  788. .. _class_DisplayServer_method_window_set_ime_active:
  789. - void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  790. ----
  791. .. _class_DisplayServer_method_window_set_ime_position:
  792. - void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  793. ----
  794. .. _class_DisplayServer_method_window_set_input_event_callback:
  795. - void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  796. ----
  797. .. _class_DisplayServer_method_window_set_input_text_callback:
  798. - void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  799. ----
  800. .. _class_DisplayServer_method_window_set_max_size:
  801. - void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  802. ----
  803. .. _class_DisplayServer_method_window_set_min_size:
  804. - void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  805. Sets the minimum size for the given window to ``min_size`` (in pixels).
  806. \ **Note:** By default, the main window has a minimum size of ``Vector2i(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size.
  807. ----
  808. .. _class_DisplayServer_method_window_set_mode:
  809. - void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  810. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  811. \ **Note:** Setting the window to fullscreen forcibly sets the borderless flag to ``true``, so make sure to set it back to ``false`` when not wanted.
  812. ----
  813. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  814. - void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  815. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  816. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  817. .. tabs::
  818. .. code-tab:: gdscript
  819. # Set region, using Path2D node.
  820. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  821. # Set region, using Polygon2D node.
  822. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  823. # Reset region to default.
  824. DisplayServer.window_set_mouse_passthrough([])
  825. .. code-tab:: csharp
  826. // Set region, using Path2D node.
  827. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  828. // Set region, using Polygon2D node.
  829. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  830. // Reset region to default.
  831. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  832. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
  833. \ **Note:** This method is implemented on Linux, macOS and Windows.
  834. ----
  835. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  836. - void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  837. Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup.
  838. ----
  839. .. _class_DisplayServer_method_window_set_position:
  840. - void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  841. Sets the position of the given window to ``position``.
  842. ----
  843. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  844. - void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  845. ----
  846. .. _class_DisplayServer_method_window_set_size:
  847. - void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  848. Sets the size of the given window to ``size``.
  849. ----
  850. .. _class_DisplayServer_method_window_set_title:
  851. - void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  852. Sets the title of the given window to ``title``.
  853. ----
  854. .. _class_DisplayServer_method_window_set_transient:
  855. - void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  856. ----
  857. .. _class_DisplayServer_method_window_set_vsync_mode:
  858. - void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  859. Sets the VSync mode of the given window.
  860. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  861. Depending on the platform and used renderer, the engine will fall back to :ref:`VSYNC_ENABLED<class_DisplayServer_constant_VSYNC_ENABLED>`, if the desired mode is not supported.
  862. ----
  863. .. _class_DisplayServer_method_window_set_window_event_callback:
  864. - void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  865. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  866. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  867. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  868. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  869. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  870. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`