123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the DisplayServer.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_DisplayServer:
- DisplayServer
- =============
- **Inherits:** :ref:`Object<class_Object>`
- Methods
- -------
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`clipboard_get<class_DisplayServer_method_clipboard_get>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`console_set_visible<class_DisplayServer_method_console_set_visible>` **(** :ref:`bool<class_bool>` console_visible **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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) **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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) **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`delete_sub_window<class_DisplayServer_method_delete_sub_window>` **(** :ref:`int<class_int>` window_id **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_console_visible<class_DisplayServer_method_is_console_visible>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_absolute_position<class_DisplayServer_method_mouse_get_absolute_position>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`mouse_warp_to_position<class_DisplayServer_method_mouse_warp_to_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`screen_is_touchscreen<class_DisplayServer_method_screen_is_touchscreen>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_real_size<class_DisplayServer_method_window_get_real_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | 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 **)** |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Enumerations
- ------------
- .. _enum_DisplayServer_Feature:
- .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
- .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
- .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
- .. _class_DisplayServer_constant_FEATURE_MOUSE:
- .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
- .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
- .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
- .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
- .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
- .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
- .. _class_DisplayServer_constant_FEATURE_CONSOLE_WINDOW:
- .. _class_DisplayServer_constant_FEATURE_IME:
- .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
- .. _class_DisplayServer_constant_FEATURE_HIDPI:
- .. _class_DisplayServer_constant_FEATURE_ICON:
- .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
- .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
- .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
- .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
- enum **Feature**:
- - **FEATURE_GLOBAL_MENU** = **0**
- - **FEATURE_SUBWINDOWS** = **1**
- - **FEATURE_TOUCHSCREEN** = **2**
- - **FEATURE_MOUSE** = **3**
- - **FEATURE_MOUSE_WARP** = **4**
- - **FEATURE_CLIPBOARD** = **5**
- - **FEATURE_VIRTUAL_KEYBOARD** = **6**
- - **FEATURE_CURSOR_SHAPE** = **7**
- - **FEATURE_CUSTOM_CURSOR_SHAPE** = **8**
- - **FEATURE_NATIVE_DIALOG** = **9**
- - **FEATURE_CONSOLE_WINDOW** = **10**
- - **FEATURE_IME** = **11**
- - **FEATURE_WINDOW_TRANSPARENCY** = **12**
- - **FEATURE_HIDPI** = **13**
- - **FEATURE_ICON** = **14**
- - **FEATURE_NATIVE_ICON** = **15**
- - **FEATURE_ORIENTATION** = **16**
- - **FEATURE_SWAP_BUFFERS** = **17**
- - **FEATURE_CLIPBOARD_PRIMARY** = **19**
- ----
- .. _enum_DisplayServer_MouseMode:
- .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
- .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
- .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
- .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
- .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
- enum **MouseMode**:
- - **MOUSE_MODE_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden.
- - **MOUSE_MODE_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible.
- - **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
- **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
- - **MOUSE_MODE_CONFINED** = **3** --- Confines the mouse cursor to the game window, and make it visible.
- - **MOUSE_MODE_CONFINED_HIDDEN** = **4** --- Confines the mouse cursor to the game window, and make it hidden.
- ----
- .. _enum_DisplayServer_ScreenOrientation:
- .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
- .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
- .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
- .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
- .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
- .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
- .. _class_DisplayServer_constant_SCREEN_SENSOR:
- enum **ScreenOrientation**:
- - **SCREEN_LANDSCAPE** = **0**
- - **SCREEN_PORTRAIT** = **1**
- - **SCREEN_REVERSE_LANDSCAPE** = **2**
- - **SCREEN_REVERSE_PORTRAIT** = **3**
- - **SCREEN_SENSOR_LANDSCAPE** = **4**
- - **SCREEN_SENSOR_PORTRAIT** = **5**
- - **SCREEN_SENSOR** = **6**
- ----
- .. _enum_DisplayServer_CursorShape:
- .. _class_DisplayServer_constant_CURSOR_ARROW:
- .. _class_DisplayServer_constant_CURSOR_IBEAM:
- .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
- .. _class_DisplayServer_constant_CURSOR_CROSS:
- .. _class_DisplayServer_constant_CURSOR_WAIT:
- .. _class_DisplayServer_constant_CURSOR_BUSY:
- .. _class_DisplayServer_constant_CURSOR_DRAG:
- .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
- .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
- .. _class_DisplayServer_constant_CURSOR_VSIZE:
- .. _class_DisplayServer_constant_CURSOR_HSIZE:
- .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
- .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
- .. _class_DisplayServer_constant_CURSOR_MOVE:
- .. _class_DisplayServer_constant_CURSOR_VSPLIT:
- .. _class_DisplayServer_constant_CURSOR_HSPLIT:
- .. _class_DisplayServer_constant_CURSOR_HELP:
- .. _class_DisplayServer_constant_CURSOR_MAX:
- enum **CursorShape**:
- - **CURSOR_ARROW** = **0**
- - **CURSOR_IBEAM** = **1**
- - **CURSOR_POINTING_HAND** = **2**
- - **CURSOR_CROSS** = **3**
- - **CURSOR_WAIT** = **4**
- - **CURSOR_BUSY** = **5**
- - **CURSOR_DRAG** = **6**
- - **CURSOR_CAN_DROP** = **7**
- - **CURSOR_FORBIDDEN** = **8**
- - **CURSOR_VSIZE** = **9**
- - **CURSOR_HSIZE** = **10**
- - **CURSOR_BDIAGSIZE** = **11**
- - **CURSOR_FDIAGSIZE** = **12**
- - **CURSOR_MOVE** = **13**
- - **CURSOR_VSPLIT** = **14**
- - **CURSOR_HSPLIT** = **15**
- - **CURSOR_HELP** = **16**
- - **CURSOR_MAX** = **17**
- ----
- .. _enum_DisplayServer_WindowMode:
- .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
- .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
- .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
- .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
- enum **WindowMode**:
- - **WINDOW_MODE_WINDOWED** = **0**
- - **WINDOW_MODE_MINIMIZED** = **1**
- - **WINDOW_MODE_MAXIMIZED** = **2**
- - **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.
- 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.
- ----
- .. _enum_DisplayServer_WindowFlags:
- .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
- .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
- .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
- .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
- .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
- .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
- enum **WindowFlags**:
- - **WINDOW_FLAG_RESIZE_DISABLED** = **0**
- - **WINDOW_FLAG_BORDERLESS** = **1**
- - **WINDOW_FLAG_ALWAYS_ON_TOP** = **2**
- - **WINDOW_FLAG_TRANSPARENT** = **3**
- - **WINDOW_FLAG_NO_FOCUS** = **4**
- - **WINDOW_FLAG_MAX** = **5**
- ----
- .. _enum_DisplayServer_WindowEvent:
- .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
- .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
- .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
- .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
- .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
- .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
- .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
- enum **WindowEvent**:
- - **WINDOW_EVENT_MOUSE_ENTER** = **0**
- - **WINDOW_EVENT_MOUSE_EXIT** = **1**
- - **WINDOW_EVENT_FOCUS_IN** = **2**
- - **WINDOW_EVENT_FOCUS_OUT** = **3**
- - **WINDOW_EVENT_CLOSE_REQUEST** = **4**
- - **WINDOW_EVENT_GO_BACK_REQUEST** = **5**
- - **WINDOW_EVENT_DPI_CHANGE** = **6**
- ----
- .. _enum_DisplayServer_VSyncMode:
- .. _class_DisplayServer_constant_VSYNC_DISABLED:
- .. _class_DisplayServer_constant_VSYNC_ENABLED:
- .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
- .. _class_DisplayServer_constant_VSYNC_MAILBOX:
- enum **VSyncMode**:
- - **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
- - **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
- - **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.
- - **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).
- Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag.
- Constants
- ---------
- .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
- .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
- .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
- - **SCREEN_OF_MAIN_WINDOW** = **-1**
- - **MAIN_WINDOW_ID** = **0**
- - **INVALID_WINDOW_ID** = **-1**
- Method Descriptions
- -------------------
- .. _class_DisplayServer_method_clipboard_get:
- - :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
- Returns the user's clipboard as a string if possible.
- ----
- .. _class_DisplayServer_method_clipboard_get_primary:
- - :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
- Returns the user's primary clipboard as a string if possible.
- **Note:** This method is only implemented on Linux.
- ----
- .. _class_DisplayServer_method_clipboard_set:
- - void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
- Sets the user's clipboard content to the given string.
- ----
- .. _class_DisplayServer_method_clipboard_set_primary:
- - void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
- Sets the user's primary clipboard content to the given string.
- **Note:** This method is only implemented on Linux.
- ----
- .. _class_DisplayServer_method_console_set_visible:
- - void **console_set_visible** **(** :ref:`bool<class_bool>` console_visible **)**
- ----
- .. _class_DisplayServer_method_create_sub_window:
- - :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) **)**
- ----
- .. _class_DisplayServer_method_cursor_get_shape:
- - :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_cursor_set_custom_image:
- - 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) **)**
- ----
- .. _class_DisplayServer_method_cursor_set_shape:
- - void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
- ----
- .. _class_DisplayServer_method_delete_sub_window:
- - void **delete_sub_window** **(** :ref:`int<class_int>` window_id **)**
- ----
- .. _class_DisplayServer_method_dialog_input_text:
- - :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 **)**
- ----
- .. _class_DisplayServer_method_dialog_show:
- - :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 **)**
- ----
- .. _class_DisplayServer_method_enable_for_stealing_focus:
- - void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
- ----
- .. _class_DisplayServer_method_force_process_and_drop_events:
- - void **force_process_and_drop_events** **(** **)**
- ----
- .. _class_DisplayServer_method_get_name:
- - :ref:`String<class_String>` **get_name** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_get_screen_count:
- - :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_get_swap_cancel_ok:
- - :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
- ----
- .. _class_DisplayServer_method_get_window_at_screen_position:
- - :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
- ----
- .. _class_DisplayServer_method_get_window_list:
- - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_global_menu_add_check_item:
- - 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 **)**
- ----
- .. _class_DisplayServer_method_global_menu_add_item:
- - 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 **)**
- ----
- .. _class_DisplayServer_method_global_menu_add_separator:
- - void **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root **)**
- ----
- .. _class_DisplayServer_method_global_menu_add_submenu_item:
- - void **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu **)**
- ----
- .. _class_DisplayServer_method_global_menu_clear:
- - void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
- ----
- .. _class_DisplayServer_method_global_menu_get_item_callback:
- - :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
- ----
- .. _class_DisplayServer_method_global_menu_get_item_submenu:
- - :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
- ----
- .. _class_DisplayServer_method_global_menu_get_item_tag:
- - :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
- ----
- .. _class_DisplayServer_method_global_menu_get_item_text:
- - :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
- ----
- .. _class_DisplayServer_method_global_menu_is_item_checkable:
- - :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
- ----
- .. _class_DisplayServer_method_global_menu_is_item_checked:
- - :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
- ----
- .. _class_DisplayServer_method_global_menu_remove_item:
- - void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_callback:
- - void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_checkable:
- - void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_checked:
- - void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_submenu:
- - void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_tag:
- - void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
- ----
- .. _class_DisplayServer_method_global_menu_set_item_text:
- - void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
- ----
- .. _class_DisplayServer_method_has_feature:
- - :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
- ----
- .. _class_DisplayServer_method_ime_get_selection:
- - :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_ime_get_text:
- - :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_is_console_visible:
- - :ref:`bool<class_bool>` **is_console_visible** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_keyboard_get_current_layout:
- - :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
- Returns active keyboard layout index.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
- - :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
- Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_keyboard_get_layout_count:
- - :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
- Returns the number of keyboard layouts.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_keyboard_get_layout_language:
- - :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
- Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_keyboard_get_layout_name:
- - :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
- Returns the localized name of the keyboard layout at position ``index``.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_keyboard_set_current_layout:
- - void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
- Sets active keyboard layout.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_mouse_get_absolute_position:
- - :ref:`Vector2i<class_Vector2i>` **mouse_get_absolute_position** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_mouse_get_button_state:
- - :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **mouse_get_button_state** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_mouse_get_mode:
- - :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_mouse_get_position:
- - :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
- Returns the mouse cursor's current position.
- ----
- .. _class_DisplayServer_method_mouse_set_mode:
- - void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
- ----
- .. _class_DisplayServer_method_mouse_warp_to_position:
- - void **mouse_warp_to_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
- Sets the mouse cursor position to the given ``position``.
- ----
- .. _class_DisplayServer_method_process_events:
- - void **process_events** **(** **)**
- ----
- .. _class_DisplayServer_method_screen_get_dpi:
- - :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- 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.
- **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
- **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
- ::
- ldpi - 120 dpi
- mdpi - 160 dpi
- hdpi - 240 dpi
- xhdpi - 320 dpi
- xxhdpi - 480 dpi
- xxxhdpi - 640 dpi
- **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
- ----
- .. _class_DisplayServer_method_screen_get_max_scale:
- - :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
- Return the greatest scale factor of all screens.
- **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.
- **Note:** This method is implemented on macOS.
- ----
- .. _class_DisplayServer_method_screen_get_orientation:
- - :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- ----
- .. _class_DisplayServer_method_screen_get_position:
- - :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- ----
- .. _class_DisplayServer_method_screen_get_scale:
- - :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- Return the scale factor of the specified screen by index.
- **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
- **Note:** This method is implemented on macOS.
- ----
- .. _class_DisplayServer_method_screen_get_size:
- - :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- ----
- .. _class_DisplayServer_method_screen_get_usable_rect:
- - :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- ----
- .. _class_DisplayServer_method_screen_is_kept_on:
- - :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
- ----
- .. _class_DisplayServer_method_screen_is_touchscreen:
- - :ref:`bool<class_bool>` **screen_is_touchscreen** **(** :ref:`int<class_int>` screen=-1 **)** |const|
- ----
- .. _class_DisplayServer_method_screen_set_keep_on:
- - void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
- ----
- .. _class_DisplayServer_method_screen_set_orientation:
- - void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
- ----
- .. _class_DisplayServer_method_set_icon:
- - void **set_icon** **(** :ref:`Image<class_Image>` image **)**
- ----
- .. _class_DisplayServer_method_set_native_icon:
- - void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
- ----
- .. _class_DisplayServer_method_tablet_get_current_driver:
- - :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
- Returns current active tablet driver name.
- **Note:** This method is implemented on Windows.
- ----
- .. _class_DisplayServer_method_tablet_get_driver_count:
- - :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
- Returns the total number of available tablet drivers.
- **Note:** This method is implemented on Windows.
- ----
- .. _class_DisplayServer_method_tablet_get_driver_name:
- - :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
- Returns the tablet driver name for the given index.
- **Note:** This method is implemented on Windows.
- ----
- .. _class_DisplayServer_method_tablet_set_current_driver:
- - void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
- Set active tablet driver name.
- **Note:** This method is implemented on Windows.
- ----
- .. _class_DisplayServer_method_virtual_keyboard_get_height:
- - :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
- Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
- ----
- .. _class_DisplayServer_method_virtual_keyboard_hide:
- - void **virtual_keyboard_hide** **(** **)**
- Hides the virtual keyboard if it is shown, does nothing otherwise.
- ----
- .. _class_DisplayServer_method_virtual_keyboard_show:
- - 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 **)**
- Shows the virtual keyboard if the platform has one.
- ``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).
- ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
- ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
- ``max_length`` limits the number of characters that can be entered if different from ``-1``.
- ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
- ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
- **Note:** This method is implemented on Android, iOS and UWP.
- ----
- .. _class_DisplayServer_method_window_attach_instance_id:
- - void **window_attach_instance_id** **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_can_draw:
- - :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_attached_instance_id:
- - :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_current_screen:
- - :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_flag:
- - :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
- Returns the current value of the given window's ``flag``.
- ----
- .. _class_DisplayServer_method_window_get_max_size:
- - :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_min_size:
- - :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_mode:
- - :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- Returns the mode of the given window.
- ----
- .. _class_DisplayServer_method_window_get_position:
- - :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- Returns the position of the given window to on the screen.
- ----
- .. _class_DisplayServer_method_window_get_real_size:
- - :ref:`Vector2i<class_Vector2i>` **window_get_real_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_size:
- - :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- ----
- .. _class_DisplayServer_method_window_get_vsync_mode:
- - :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
- Returns the VSync mode of the given window.
- ----
- .. _class_DisplayServer_method_window_move_to_foreground:
- - void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_request_attention:
- - void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_current_screen:
- - void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_drop_files_callback:
- - void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_flag:
- - void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
- Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
- ----
- .. _class_DisplayServer_method_window_set_ime_active:
- - void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_ime_position:
- - void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_input_event_callback:
- - void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_input_text_callback:
- - void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_max_size:
- - void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_min_size:
- - void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
- Sets the minimum size for the given window to ``min_size`` (in pixels).
- **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.
- ----
- .. _class_DisplayServer_method_window_set_mode:
- - void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
- Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
- **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.
- ----
- .. _class_DisplayServer_method_window_set_mouse_passthrough:
- - void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
- Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
- Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
- .. tabs::
- .. code-tab:: gdscript
- # Set region, using Path2D node.
- DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
-
- # Set region, using Polygon2D node.
- DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
-
- # Reset region to default.
- DisplayServer.window_set_mouse_passthrough([])
- .. code-tab:: csharp
- // Set region, using Path2D node.
- DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
-
- // Set region, using Polygon2D node.
- DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
-
- // Reset region to default.
- DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
- **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
- **Note:** This method is implemented on Linux, macOS and Windows.
- ----
- .. _class_DisplayServer_method_window_set_position:
- - void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
- Sets the position of the given window to ``position``.
- ----
- .. _class_DisplayServer_method_window_set_rect_changed_callback:
- - void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
- ----
- .. _class_DisplayServer_method_window_set_size:
- - void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
- Sets the size of the given window to ``size``.
- ----
- .. _class_DisplayServer_method_window_set_title:
- - void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
- Sets the title of the given window to ``title``.
- ----
- .. _class_DisplayServer_method_window_set_transient:
- - void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
- ----
- .. _class_DisplayServer_method_window_set_vsync_mode:
- - void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
- Sets the VSync mode of the given window.
- See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
- 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.
- ----
- .. _class_DisplayServer_method_window_set_window_event_callback:
- - void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|