class_displayserver.rst 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395
  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. | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
  17. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
  19. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`console_set_visible<class_DisplayServer_method_console_set_visible>` **(** :ref:`bool<class_bool>` console_visible **)** |
  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:`bool<class_bool>` | :ref:`is_console_visible<class_DisplayServer_method_is_console_visible>` **(** **)** |const| |
  93. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  95. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :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| |
  97. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  99. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  101. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  103. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  105. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_absolute_position<class_DisplayServer_method_mouse_get_absolute_position>` **(** **)** |const| |
  107. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  109. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  111. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  113. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  115. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`mouse_warp_to_position<class_DisplayServer_method_mouse_warp_to_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  117. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  119. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  121. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  123. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  125. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  127. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  129. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  131. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  133. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  135. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | :ref:`bool<class_bool>` | :ref:`screen_is_touchscreen<class_DisplayServer_method_screen_is_touchscreen>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  137. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  139. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  141. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  143. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  145. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  147. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  149. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  151. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  153. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  155. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  157. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`virtual_keyboard_show<class_DisplayServer_method_virtual_keyboard_show>` **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2i(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 **)** |
  159. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | 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 **)** |
  161. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |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:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  177. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_real_size<class_DisplayServer_method_window_get_real_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  179. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  181. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :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| |
  183. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  185. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  187. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | 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 **)** |
  189. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | 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 **)** |
  191. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | 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 **)** |
  193. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | 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 **)** |
  195. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | 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 **)** |
  197. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | 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 **)** |
  199. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | 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 **)** |
  201. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | 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 **)** |
  203. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | 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 **)** |
  205. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  207. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | 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 **)** |
  209. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  211. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | 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 **)** |
  213. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  215. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  217. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  219. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | 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 **)** |
  221. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | 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 **)** |
  223. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. Enumerations
  225. ------------
  226. .. _enum_DisplayServer_Feature:
  227. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  228. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  229. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  230. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  231. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  232. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  233. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  234. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  235. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  236. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  237. .. _class_DisplayServer_constant_FEATURE_CONSOLE_WINDOW:
  238. .. _class_DisplayServer_constant_FEATURE_IME:
  239. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  240. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  241. .. _class_DisplayServer_constant_FEATURE_ICON:
  242. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  243. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  244. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  245. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  246. enum **Feature**:
  247. - **FEATURE_GLOBAL_MENU** = **0**
  248. - **FEATURE_SUBWINDOWS** = **1**
  249. - **FEATURE_TOUCHSCREEN** = **2**
  250. - **FEATURE_MOUSE** = **3**
  251. - **FEATURE_MOUSE_WARP** = **4**
  252. - **FEATURE_CLIPBOARD** = **5**
  253. - **FEATURE_VIRTUAL_KEYBOARD** = **6**
  254. - **FEATURE_CURSOR_SHAPE** = **7**
  255. - **FEATURE_CUSTOM_CURSOR_SHAPE** = **8**
  256. - **FEATURE_NATIVE_DIALOG** = **9**
  257. - **FEATURE_CONSOLE_WINDOW** = **10**
  258. - **FEATURE_IME** = **11**
  259. - **FEATURE_WINDOW_TRANSPARENCY** = **12**
  260. - **FEATURE_HIDPI** = **13**
  261. - **FEATURE_ICON** = **14**
  262. - **FEATURE_NATIVE_ICON** = **15**
  263. - **FEATURE_ORIENTATION** = **16**
  264. - **FEATURE_SWAP_BUFFERS** = **17**
  265. - **FEATURE_CLIPBOARD_PRIMARY** = **19**
  266. ----
  267. .. _enum_DisplayServer_MouseMode:
  268. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  269. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  270. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  271. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  272. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  273. enum **MouseMode**:
  274. - **MOUSE_MODE_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden.
  275. - **MOUSE_MODE_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible.
  276. - **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
  277. **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  278. - **MOUSE_MODE_CONFINED** = **3** --- Confines the mouse cursor to the game window, and make it visible.
  279. - **MOUSE_MODE_CONFINED_HIDDEN** = **4** --- Confines the mouse cursor to the game window, and make it hidden.
  280. ----
  281. .. _enum_DisplayServer_ScreenOrientation:
  282. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  283. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  284. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  285. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  286. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  287. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  288. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  289. enum **ScreenOrientation**:
  290. - **SCREEN_LANDSCAPE** = **0**
  291. - **SCREEN_PORTRAIT** = **1**
  292. - **SCREEN_REVERSE_LANDSCAPE** = **2**
  293. - **SCREEN_REVERSE_PORTRAIT** = **3**
  294. - **SCREEN_SENSOR_LANDSCAPE** = **4**
  295. - **SCREEN_SENSOR_PORTRAIT** = **5**
  296. - **SCREEN_SENSOR** = **6**
  297. ----
  298. .. _enum_DisplayServer_CursorShape:
  299. .. _class_DisplayServer_constant_CURSOR_ARROW:
  300. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  301. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  302. .. _class_DisplayServer_constant_CURSOR_CROSS:
  303. .. _class_DisplayServer_constant_CURSOR_WAIT:
  304. .. _class_DisplayServer_constant_CURSOR_BUSY:
  305. .. _class_DisplayServer_constant_CURSOR_DRAG:
  306. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  307. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  308. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  309. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  310. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  311. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  312. .. _class_DisplayServer_constant_CURSOR_MOVE:
  313. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  314. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  315. .. _class_DisplayServer_constant_CURSOR_HELP:
  316. .. _class_DisplayServer_constant_CURSOR_MAX:
  317. enum **CursorShape**:
  318. - **CURSOR_ARROW** = **0**
  319. - **CURSOR_IBEAM** = **1**
  320. - **CURSOR_POINTING_HAND** = **2**
  321. - **CURSOR_CROSS** = **3**
  322. - **CURSOR_WAIT** = **4**
  323. - **CURSOR_BUSY** = **5**
  324. - **CURSOR_DRAG** = **6**
  325. - **CURSOR_CAN_DROP** = **7**
  326. - **CURSOR_FORBIDDEN** = **8**
  327. - **CURSOR_VSIZE** = **9**
  328. - **CURSOR_HSIZE** = **10**
  329. - **CURSOR_BDIAGSIZE** = **11**
  330. - **CURSOR_FDIAGSIZE** = **12**
  331. - **CURSOR_MOVE** = **13**
  332. - **CURSOR_VSPLIT** = **14**
  333. - **CURSOR_HSPLIT** = **15**
  334. - **CURSOR_HELP** = **16**
  335. - **CURSOR_MAX** = **17**
  336. ----
  337. .. _enum_DisplayServer_WindowMode:
  338. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  339. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  340. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  341. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  342. enum **WindowMode**:
  343. - **WINDOW_MODE_WINDOWED** = **0**
  344. - **WINDOW_MODE_MINIMIZED** = **1**
  345. - **WINDOW_MODE_MAXIMIZED** = **2**
  346. - **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.
  347. 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.
  348. ----
  349. .. _enum_DisplayServer_WindowFlags:
  350. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  351. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  352. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  353. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  354. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  355. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  356. enum **WindowFlags**:
  357. - **WINDOW_FLAG_RESIZE_DISABLED** = **0**
  358. - **WINDOW_FLAG_BORDERLESS** = **1**
  359. - **WINDOW_FLAG_ALWAYS_ON_TOP** = **2**
  360. - **WINDOW_FLAG_TRANSPARENT** = **3**
  361. - **WINDOW_FLAG_NO_FOCUS** = **4**
  362. - **WINDOW_FLAG_MAX** = **5**
  363. ----
  364. .. _enum_DisplayServer_WindowEvent:
  365. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  366. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  367. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  368. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  369. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  370. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  371. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  372. enum **WindowEvent**:
  373. - **WINDOW_EVENT_MOUSE_ENTER** = **0**
  374. - **WINDOW_EVENT_MOUSE_EXIT** = **1**
  375. - **WINDOW_EVENT_FOCUS_IN** = **2**
  376. - **WINDOW_EVENT_FOCUS_OUT** = **3**
  377. - **WINDOW_EVENT_CLOSE_REQUEST** = **4**
  378. - **WINDOW_EVENT_GO_BACK_REQUEST** = **5**
  379. - **WINDOW_EVENT_DPI_CHANGE** = **6**
  380. ----
  381. .. _enum_DisplayServer_VSyncMode:
  382. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  383. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  384. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  385. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  386. enum **VSyncMode**:
  387. - **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
  388. - **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
  389. - **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.
  390. - **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).
  391. Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag.
  392. Constants
  393. ---------
  394. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  395. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  396. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  397. - **SCREEN_OF_MAIN_WINDOW** = **-1**
  398. - **MAIN_WINDOW_ID** = **0**
  399. - **INVALID_WINDOW_ID** = **-1**
  400. Method Descriptions
  401. -------------------
  402. .. _class_DisplayServer_method_clipboard_get:
  403. - :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  404. Returns the user's clipboard as a string if possible.
  405. ----
  406. .. _class_DisplayServer_method_clipboard_get_primary:
  407. - :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  408. Returns the user's primary clipboard as a string if possible.
  409. **Note:** This method is only implemented on Linux.
  410. ----
  411. .. _class_DisplayServer_method_clipboard_set:
  412. - void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  413. Sets the user's clipboard content to the given string.
  414. ----
  415. .. _class_DisplayServer_method_clipboard_set_primary:
  416. - void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  417. Sets the user's primary clipboard content to the given string.
  418. **Note:** This method is only implemented on Linux.
  419. ----
  420. .. _class_DisplayServer_method_console_set_visible:
  421. - void **console_set_visible** **(** :ref:`bool<class_bool>` console_visible **)**
  422. ----
  423. .. _class_DisplayServer_method_create_sub_window:
  424. - :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) **)**
  425. ----
  426. .. _class_DisplayServer_method_cursor_get_shape:
  427. - :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  428. ----
  429. .. _class_DisplayServer_method_cursor_set_custom_image:
  430. - 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) **)**
  431. ----
  432. .. _class_DisplayServer_method_cursor_set_shape:
  433. - void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  434. ----
  435. .. _class_DisplayServer_method_delete_sub_window:
  436. - void **delete_sub_window** **(** :ref:`int<class_int>` window_id **)**
  437. ----
  438. .. _class_DisplayServer_method_dialog_input_text:
  439. - :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 **)**
  440. ----
  441. .. _class_DisplayServer_method_dialog_show:
  442. - :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 **)**
  443. ----
  444. .. _class_DisplayServer_method_enable_for_stealing_focus:
  445. - void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  446. ----
  447. .. _class_DisplayServer_method_force_process_and_drop_events:
  448. - void **force_process_and_drop_events** **(** **)**
  449. ----
  450. .. _class_DisplayServer_method_get_name:
  451. - :ref:`String<class_String>` **get_name** **(** **)** |const|
  452. ----
  453. .. _class_DisplayServer_method_get_screen_count:
  454. - :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  455. ----
  456. .. _class_DisplayServer_method_get_swap_cancel_ok:
  457. - :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  458. ----
  459. .. _class_DisplayServer_method_get_window_at_screen_position:
  460. - :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  461. ----
  462. .. _class_DisplayServer_method_get_window_list:
  463. - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  464. ----
  465. .. _class_DisplayServer_method_global_menu_add_check_item:
  466. - 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 **)**
  467. ----
  468. .. _class_DisplayServer_method_global_menu_add_item:
  469. - 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 **)**
  470. ----
  471. .. _class_DisplayServer_method_global_menu_add_separator:
  472. - void **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root **)**
  473. ----
  474. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  475. - void **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu **)**
  476. ----
  477. .. _class_DisplayServer_method_global_menu_clear:
  478. - void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  479. ----
  480. .. _class_DisplayServer_method_global_menu_get_item_callback:
  481. - :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  482. ----
  483. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  484. - :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  485. ----
  486. .. _class_DisplayServer_method_global_menu_get_item_tag:
  487. - :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  488. ----
  489. .. _class_DisplayServer_method_global_menu_get_item_text:
  490. - :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  491. ----
  492. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  493. - :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  494. ----
  495. .. _class_DisplayServer_method_global_menu_is_item_checked:
  496. - :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  497. ----
  498. .. _class_DisplayServer_method_global_menu_remove_item:
  499. - void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  500. ----
  501. .. _class_DisplayServer_method_global_menu_set_item_callback:
  502. - void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  503. ----
  504. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  505. - void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  506. ----
  507. .. _class_DisplayServer_method_global_menu_set_item_checked:
  508. - void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  509. ----
  510. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  511. - void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  512. ----
  513. .. _class_DisplayServer_method_global_menu_set_item_tag:
  514. - void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  515. ----
  516. .. _class_DisplayServer_method_global_menu_set_item_text:
  517. - void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  518. ----
  519. .. _class_DisplayServer_method_has_feature:
  520. - :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  521. ----
  522. .. _class_DisplayServer_method_ime_get_selection:
  523. - :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  524. ----
  525. .. _class_DisplayServer_method_ime_get_text:
  526. - :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  527. ----
  528. .. _class_DisplayServer_method_is_console_visible:
  529. - :ref:`bool<class_bool>` **is_console_visible** **(** **)** |const|
  530. ----
  531. .. _class_DisplayServer_method_keyboard_get_current_layout:
  532. - :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  533. Returns active keyboard layout index.
  534. **Note:** This method is implemented on Linux, macOS and Windows.
  535. ----
  536. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  537. - :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  538. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  539. **Note:** This method is implemented on Linux, macOS and Windows.
  540. ----
  541. .. _class_DisplayServer_method_keyboard_get_layout_count:
  542. - :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  543. Returns the number of keyboard layouts.
  544. **Note:** This method is implemented on Linux, macOS and Windows.
  545. ----
  546. .. _class_DisplayServer_method_keyboard_get_layout_language:
  547. - :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  548. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  549. **Note:** This method is implemented on Linux, macOS and Windows.
  550. ----
  551. .. _class_DisplayServer_method_keyboard_get_layout_name:
  552. - :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  553. Returns the localized name of the keyboard layout at position ``index``.
  554. **Note:** This method is implemented on Linux, macOS and Windows.
  555. ----
  556. .. _class_DisplayServer_method_keyboard_set_current_layout:
  557. - void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  558. Sets active keyboard layout.
  559. **Note:** This method is implemented on Linux, macOS and Windows.
  560. ----
  561. .. _class_DisplayServer_method_mouse_get_absolute_position:
  562. - :ref:`Vector2i<class_Vector2i>` **mouse_get_absolute_position** **(** **)** |const|
  563. ----
  564. .. _class_DisplayServer_method_mouse_get_button_state:
  565. - :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **mouse_get_button_state** **(** **)** |const|
  566. ----
  567. .. _class_DisplayServer_method_mouse_get_mode:
  568. - :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  569. ----
  570. .. _class_DisplayServer_method_mouse_get_position:
  571. - :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  572. Returns the mouse cursor's current position.
  573. ----
  574. .. _class_DisplayServer_method_mouse_set_mode:
  575. - void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  576. ----
  577. .. _class_DisplayServer_method_mouse_warp_to_position:
  578. - void **mouse_warp_to_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  579. Sets the mouse cursor position to the given ``position``.
  580. ----
  581. .. _class_DisplayServer_method_process_events:
  582. - void **process_events** **(** **)**
  583. ----
  584. .. _class_DisplayServer_method_screen_get_dpi:
  585. - :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  586. 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.
  587. **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  588. **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  589. ::
  590. ldpi - 120 dpi
  591. mdpi - 160 dpi
  592. hdpi - 240 dpi
  593. xhdpi - 320 dpi
  594. xxhdpi - 480 dpi
  595. xxxhdpi - 640 dpi
  596. **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
  597. ----
  598. .. _class_DisplayServer_method_screen_get_max_scale:
  599. - :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  600. Return the greatest scale factor of all screens.
  601. **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.
  602. **Note:** This method is implemented on macOS.
  603. ----
  604. .. _class_DisplayServer_method_screen_get_orientation:
  605. - :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  606. ----
  607. .. _class_DisplayServer_method_screen_get_position:
  608. - :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  609. ----
  610. .. _class_DisplayServer_method_screen_get_scale:
  611. - :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  612. Return the scale factor of the specified screen by index.
  613. **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  614. **Note:** This method is implemented on macOS.
  615. ----
  616. .. _class_DisplayServer_method_screen_get_size:
  617. - :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  618. ----
  619. .. _class_DisplayServer_method_screen_get_usable_rect:
  620. - :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  621. ----
  622. .. _class_DisplayServer_method_screen_is_kept_on:
  623. - :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  624. ----
  625. .. _class_DisplayServer_method_screen_is_touchscreen:
  626. - :ref:`bool<class_bool>` **screen_is_touchscreen** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  627. ----
  628. .. _class_DisplayServer_method_screen_set_keep_on:
  629. - void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  630. ----
  631. .. _class_DisplayServer_method_screen_set_orientation:
  632. - void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  633. ----
  634. .. _class_DisplayServer_method_set_icon:
  635. - void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  636. ----
  637. .. _class_DisplayServer_method_set_native_icon:
  638. - void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  639. ----
  640. .. _class_DisplayServer_method_tablet_get_current_driver:
  641. - :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  642. Returns current active tablet driver name.
  643. **Note:** This method is implemented on Windows.
  644. ----
  645. .. _class_DisplayServer_method_tablet_get_driver_count:
  646. - :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  647. Returns the total number of available tablet drivers.
  648. **Note:** This method is implemented on Windows.
  649. ----
  650. .. _class_DisplayServer_method_tablet_get_driver_name:
  651. - :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  652. Returns the tablet driver name for the given index.
  653. **Note:** This method is implemented on Windows.
  654. ----
  655. .. _class_DisplayServer_method_tablet_set_current_driver:
  656. - void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  657. Set active tablet driver name.
  658. **Note:** This method is implemented on Windows.
  659. ----
  660. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  661. - :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  662. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  663. ----
  664. .. _class_DisplayServer_method_virtual_keyboard_hide:
  665. - void **virtual_keyboard_hide** **(** **)**
  666. Hides the virtual keyboard if it is shown, does nothing otherwise.
  667. ----
  668. .. _class_DisplayServer_method_virtual_keyboard_show:
  669. - void **virtual_keyboard_show** **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2i(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 **)**
  670. Shows the virtual keyboard if the platform has one.
  671. ``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).
  672. ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  673. ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
  674. ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  675. ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  676. ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  677. **Note:** This method is implemented on Android, iOS and UWP.
  678. ----
  679. .. _class_DisplayServer_method_window_attach_instance_id:
  680. - void **window_attach_instance_id** **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)**
  681. ----
  682. .. _class_DisplayServer_method_window_can_draw:
  683. - :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  684. ----
  685. .. _class_DisplayServer_method_window_get_attached_instance_id:
  686. - :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  687. ----
  688. .. _class_DisplayServer_method_window_get_current_screen:
  689. - :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  690. ----
  691. .. _class_DisplayServer_method_window_get_flag:
  692. - :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  693. Returns the current value of the given window's ``flag``.
  694. ----
  695. .. _class_DisplayServer_method_window_get_max_size:
  696. - :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  697. ----
  698. .. _class_DisplayServer_method_window_get_min_size:
  699. - :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  700. ----
  701. .. _class_DisplayServer_method_window_get_mode:
  702. - :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  703. Returns the mode of the given window.
  704. ----
  705. .. _class_DisplayServer_method_window_get_position:
  706. - :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  707. Returns the position of the given window to on the screen.
  708. ----
  709. .. _class_DisplayServer_method_window_get_real_size:
  710. - :ref:`Vector2i<class_Vector2i>` **window_get_real_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  711. ----
  712. .. _class_DisplayServer_method_window_get_size:
  713. - :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  714. ----
  715. .. _class_DisplayServer_method_window_get_vsync_mode:
  716. - :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  717. Returns the VSync mode of the given window.
  718. ----
  719. .. _class_DisplayServer_method_window_move_to_foreground:
  720. - void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  721. ----
  722. .. _class_DisplayServer_method_window_request_attention:
  723. - void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  724. ----
  725. .. _class_DisplayServer_method_window_set_current_screen:
  726. - void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  727. ----
  728. .. _class_DisplayServer_method_window_set_drop_files_callback:
  729. - void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  730. ----
  731. .. _class_DisplayServer_method_window_set_flag:
  732. - void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  733. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  734. ----
  735. .. _class_DisplayServer_method_window_set_ime_active:
  736. - void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  737. ----
  738. .. _class_DisplayServer_method_window_set_ime_position:
  739. - void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  740. ----
  741. .. _class_DisplayServer_method_window_set_input_event_callback:
  742. - void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  743. ----
  744. .. _class_DisplayServer_method_window_set_input_text_callback:
  745. - void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  746. ----
  747. .. _class_DisplayServer_method_window_set_max_size:
  748. - void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  749. ----
  750. .. _class_DisplayServer_method_window_set_min_size:
  751. - void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  752. Sets the minimum size for the given window to ``min_size`` (in pixels).
  753. **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.
  754. ----
  755. .. _class_DisplayServer_method_window_set_mode:
  756. - void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  757. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  758. **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.
  759. ----
  760. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  761. - void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  762. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  763. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  764. .. tabs::
  765. .. code-tab:: gdscript
  766. # Set region, using Path2D node.
  767. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  768. # Set region, using Polygon2D node.
  769. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  770. # Reset region to default.
  771. DisplayServer.window_set_mouse_passthrough([])
  772. .. code-tab:: csharp
  773. // Set region, using Path2D node.
  774. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  775. // Set region, using Polygon2D node.
  776. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  777. // Reset region to default.
  778. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  779. **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
  780. **Note:** This method is implemented on Linux, macOS and Windows.
  781. ----
  782. .. _class_DisplayServer_method_window_set_position:
  783. - void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  784. Sets the position of the given window to ``position``.
  785. ----
  786. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  787. - void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  788. ----
  789. .. _class_DisplayServer_method_window_set_size:
  790. - void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  791. Sets the size of the given window to ``size``.
  792. ----
  793. .. _class_DisplayServer_method_window_set_title:
  794. - void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  795. Sets the title of the given window to ``title``.
  796. ----
  797. .. _class_DisplayServer_method_window_set_transient:
  798. - void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  799. ----
  800. .. _class_DisplayServer_method_window_set_vsync_mode:
  801. - void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  802. Sets the VSync mode of the given window.
  803. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  804. 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.
  805. ----
  806. .. _class_DisplayServer_method_window_set_window_event_callback:
  807. - void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  808. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  809. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  810. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  811. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  812. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  813. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`