class_displayserver.rst 283 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/DisplayServer.xml.
  6. .. _class_DisplayServer:
  7. DisplayServer
  8. =============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. A server interface for low-level window management.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **DisplayServer** handles everything related to window management. It is separated from :ref:`OS<class_OS>` as a single operating system may support multiple display servers.
  15. \ **Headless mode:** Starting the engine with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` disables all rendering and window management functions. Most functions from **DisplayServer** will return dummy values in this case.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`String<class_String>` | :ref:`clipboard_get<class_DisplayServer_method_clipboard_get>` **(** **)** |const| |
  23. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
  25. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`clipboard_has<class_DisplayServer_method_clipboard_has>` **(** **)** |const| |
  27. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
  29. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
  31. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
  33. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | 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) **)** |
  35. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
  37. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :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 **)** |
  39. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :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 **)** |
  41. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
  43. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
  45. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Color<class_Color>` | :ref:`get_accent_color<class_DisplayServer_method_get_accent_color>` **(** **)** |const| |
  47. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Rect2[]<class_Rect2>` | :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>` **(** **)** |const| |
  49. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Rect2i<class_Rect2i>` | :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>` **(** **)** |const| |
  51. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
  53. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`int<class_int>` | :ref:`get_primary_screen<class_DisplayServer_method_get_primary_screen>` **(** **)** |const| |
  55. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
  57. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_screen_from_rect<class_DisplayServer_method_get_screen_from_rect>` **(** :ref:`Rect2<class_Rect2>` rect **)** |const| |
  59. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
  61. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  63. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
  65. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :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:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  67. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_check_item<class_DisplayServer_method_global_menu_add_icon_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  69. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_item<class_DisplayServer_method_global_menu_add_icon_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  71. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_radio_check_item<class_DisplayServer_method_global_menu_add_icon_radio_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  73. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :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:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  75. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  77. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`global_menu_add_radio_check_item<class_DisplayServer_method_global_menu_add_radio_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  79. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)** |
  81. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :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, :ref:`int<class_int>` index=-1 **)** |
  83. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
  85. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`global_menu_get_item_accelerator<class_DisplayServer_method_global_menu_get_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  87. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :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 **)** |const| |
  89. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`int<class_int>` | :ref:`global_menu_get_item_count<class_DisplayServer_method_global_menu_get_item_count>` **(** :ref:`String<class_String>` menu_root **)** |const| |
  91. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`Texture2D<class_Texture2D>` | :ref:`global_menu_get_item_icon<class_DisplayServer_method_global_menu_get_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  93. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`int<class_int>` | :ref:`global_menu_get_item_indentation_level<class_DisplayServer_method_global_menu_get_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  95. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_tag<class_DisplayServer_method_global_menu_get_item_index_from_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const| |
  97. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_text<class_DisplayServer_method_global_menu_get_item_index_from_text>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const| |
  99. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_key_callback<class_DisplayServer_method_global_menu_get_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  101. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`int<class_int>` | :ref:`global_menu_get_item_max_states<class_DisplayServer_method_global_menu_get_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  103. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`global_menu_get_item_state<class_DisplayServer_method_global_menu_get_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  105. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :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 **)** |const| |
  107. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :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 **)** |const| |
  109. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :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 **)** |const| |
  111. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`String<class_String>` | :ref:`global_menu_get_item_tooltip<class_DisplayServer_method_global_menu_get_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  113. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :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| |
  115. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :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| |
  117. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_disabled<class_DisplayServer_method_global_menu_is_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  119. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_radio_checkable<class_DisplayServer_method_global_menu_is_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  121. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  123. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`global_menu_set_item_accelerator<class_DisplayServer_method_global_menu_set_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |
  125. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | 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 **)** |
  127. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | 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 **)** |
  129. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | 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 **)** |
  131. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  133. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`global_menu_set_item_icon<class_DisplayServer_method_global_menu_set_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
  135. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`global_menu_set_item_indentation_level<class_DisplayServer_method_global_menu_set_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)** |
  137. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`global_menu_set_item_key_callback<class_DisplayServer_method_global_menu_set_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)** |
  139. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`global_menu_set_item_max_states<class_DisplayServer_method_global_menu_set_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)** |
  141. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`global_menu_set_item_radio_checkable<class_DisplayServer_method_global_menu_set_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
  143. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`global_menu_set_item_state<class_DisplayServer_method_global_menu_set_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)** |
  145. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | 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 **)** |
  147. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | 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 **)** |
  149. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | 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 **)** |
  151. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`global_menu_set_item_tooltip<class_DisplayServer_method_global_menu_set_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  153. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  155. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  157. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  159. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
  161. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
  163. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_touchscreen_available<class_DisplayServer_method_is_touchscreen_available>` **(** **)** |const| |
  165. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  167. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :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| |
  169. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  171. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  173. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  175. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  177. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  179. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  181. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  183. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  185. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  187. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  189. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  191. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  193. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  195. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  197. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  199. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  201. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  203. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  205. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  207. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  209. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  211. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  213. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  215. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  217. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  219. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  221. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
  223. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  225. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
  227. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
  229. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
  231. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
  233. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
  235. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | void | :ref:`tts_speak<class_DisplayServer_method_tts_speak>` **(** :ref:`String<class_String>` text, :ref:`String<class_String>` voice, :ref:`int<class_int>` volume=50, :ref:`float<class_float>` pitch=1.0, :ref:`float<class_float>` rate=1.0, :ref:`int<class_int>` utterance_id=0, :ref:`bool<class_bool>` interrupt=false **)** |
  237. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
  239. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  241. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  243. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`virtual_keyboard_show<class_DisplayServer_method_virtual_keyboard_show>` **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` type=0, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)** |
  245. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  247. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  249. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  251. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :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| |
  253. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  255. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :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| |
  257. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  259. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  261. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  263. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`int<class_int>` | :ref:`window_get_native_handle<class_DisplayServer_method_window_get_native_handle>` **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const| |
  265. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  267. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  269. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position_with_decorations<class_DisplayServer_method_window_get_position_with_decorations>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  271. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`Vector3i<class_Vector3i>` | :ref:`window_get_safe_title_margins<class_DisplayServer_method_window_get_safe_title_margins>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  273. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  275. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size_with_decorations<class_DisplayServer_method_window_get_size_with_decorations>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  277. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :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| |
  279. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`bool<class_bool>` | :ref:`window_is_maximize_allowed<class_DisplayServer_method_window_is_maximize_allowed>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  281. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
  283. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
  285. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  287. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  289. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | 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 **)** |
  291. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | 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 **)** |
  293. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  295. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | 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 **)** |
  297. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | 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 **)** |
  299. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | 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 **)** |
  301. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | 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 **)** |
  303. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | 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 **)** |
  305. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | 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 **)** |
  307. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | 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 **)** |
  309. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  311. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | 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 **)** |
  313. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | void | :ref:`window_set_popup_safe_rect<class_DisplayServer_method_window_set_popup_safe_rect>` **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)** |
  315. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  317. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | 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 **)** |
  319. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  321. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  323. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  325. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | 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 **)** |
  327. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | void | :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)** |
  329. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | 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 **)** |
  331. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. .. rst-class:: classref-section-separator
  333. ----
  334. .. rst-class:: classref-descriptions-group
  335. Enumerations
  336. ------------
  337. .. _enum_DisplayServer_Feature:
  338. .. rst-class:: classref-enumeration
  339. enum **Feature**:
  340. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  341. .. rst-class:: classref-enumeration-constant
  342. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
  343. Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
  344. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SUBWINDOWS** = ``1``
  347. Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)**
  348. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TOUCHSCREEN** = ``2``
  351. Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web**
  352. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE** = ``3``
  355. Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web**
  356. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE_WARP** = ``4``
  359. Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. **Windows, macOS, Linux (X11)**
  360. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD** = ``5``
  363. Display server supports setting and getting clipboard data. See also :ref:`FEATURE_CLIPBOARD_PRIMARY<class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY>`. **Windows, macOS, Linux (X11), Android, iOS, Web**
  364. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_VIRTUAL_KEYBOARD** = ``6``
  367. Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web**
  368. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CURSOR_SHAPE** = ``7``
  371. Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web**
  372. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8``
  375. Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web**
  376. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_DIALOG** = ``9``
  379. Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS**
  380. .. _class_DisplayServer_constant_FEATURE_IME:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_IME** = ``10``
  383. Display server supports `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__, which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. **Windows, macOS, Linux (X11)**
  384. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_WINDOW_TRANSPARENCY** = ``11``
  387. Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)**
  388. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_HIDPI** = ``12``
  391. Display server supports querying the operating system's display scale factor. This allows for *reliable* automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). **Windows, macOS**
  392. .. _class_DisplayServer_constant_FEATURE_ICON:
  393. .. rst-class:: classref-enumeration-constant
  394. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ICON** = ``13``
  395. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)**
  396. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_ICON** = ``14``
  399. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS**
  400. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ORIENTATION** = ``15``
  403. Display server supports changing the screen orientation. **Android, iOS**
  404. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SWAP_BUFFERS** = ``16``
  407. Display server supports V-Sync status can be changed from the default (which is forced to be enabled platforms not supporting this feature). **Windows, macOS, Linux (X11)**
  408. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  409. .. rst-class:: classref-enumeration-constant
  410. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD_PRIMARY** = ``18``
  411. Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD<class_DisplayServer_constant_FEATURE_CLIPBOARD>`. **Linux (X11)**
  412. .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TEXT_TO_SPEECH** = ``19``
  415. Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web**
  416. .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
  417. .. rst-class:: classref-enumeration-constant
  418. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_EXTEND_TO_TITLE** = ``20``
  419. Display server supports expanding window content to the title. See :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>`. **macOS**
  420. .. rst-class:: classref-item-separator
  421. ----
  422. .. _enum_DisplayServer_MouseMode:
  423. .. rst-class:: classref-enumeration
  424. enum **MouseMode**:
  425. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  426. .. rst-class:: classref-enumeration-constant
  427. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_VISIBLE** = ``0``
  428. Makes the mouse cursor visible if it is hidden.
  429. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  430. .. rst-class:: classref-enumeration-constant
  431. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_HIDDEN** = ``1``
  432. Makes the mouse cursor hidden if it is visible.
  433. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  434. .. rst-class:: classref-enumeration-constant
  435. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CAPTURED** = ``2``
  436. Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
  437. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  438. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  439. .. rst-class:: classref-enumeration-constant
  440. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED** = ``3``
  441. Confines the mouse cursor to the game window, and make it visible.
  442. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  443. .. rst-class:: classref-enumeration-constant
  444. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED_HIDDEN** = ``4``
  445. Confines the mouse cursor to the game window, and make it hidden.
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _enum_DisplayServer_ScreenOrientation:
  449. .. rst-class:: classref-enumeration
  450. enum **ScreenOrientation**:
  451. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  452. .. rst-class:: classref-enumeration-constant
  453. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_LANDSCAPE** = ``0``
  454. Default landscape orientation.
  455. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  456. .. rst-class:: classref-enumeration-constant
  457. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_PORTRAIT** = ``1``
  458. Default portrait orientation.
  459. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  460. .. rst-class:: classref-enumeration-constant
  461. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_LANDSCAPE** = ``2``
  462. Reverse landscape orientation (upside down).
  463. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  464. .. rst-class:: classref-enumeration-constant
  465. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_PORTRAIT** = ``3``
  466. Reverse portrait orientation (upside down).
  467. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  468. .. rst-class:: classref-enumeration-constant
  469. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_LANDSCAPE** = ``4``
  470. Automatic landscape orientation (default or reverse depending on sensor).
  471. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  472. .. rst-class:: classref-enumeration-constant
  473. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_PORTRAIT** = ``5``
  474. Automatic portrait orientation (default or reverse depending on sensor).
  475. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  476. .. rst-class:: classref-enumeration-constant
  477. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR** = ``6``
  478. Automatic landscape or portrait orientation (default or reverse depending on sensor).
  479. .. rst-class:: classref-item-separator
  480. ----
  481. .. _enum_DisplayServer_VirtualKeyboardType:
  482. .. rst-class:: classref-enumeration
  483. enum **VirtualKeyboardType**:
  484. .. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
  485. .. rst-class:: classref-enumeration-constant
  486. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  487. Default text virtual keyboard.
  488. .. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
  489. .. rst-class:: classref-enumeration-constant
  490. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  491. Multiline virtual keyboard.
  492. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
  493. .. rst-class:: classref-enumeration-constant
  494. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  495. Virtual number keypad, useful for PIN entry.
  496. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  497. .. rst-class:: classref-enumeration-constant
  498. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  499. Virtual number keypad, useful for entering fractional numbers.
  500. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
  501. .. rst-class:: classref-enumeration-constant
  502. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  503. Virtual phone number keypad.
  504. .. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  505. .. rst-class:: classref-enumeration-constant
  506. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  507. Virtual keyboard with additional keys to assist with typing email addresses.
  508. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
  509. .. rst-class:: classref-enumeration-constant
  510. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  511. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  512. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
  513. .. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
  514. .. rst-class:: classref-enumeration-constant
  515. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  516. Virtual keyboard with additional keys to assist with typing URLs.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _enum_DisplayServer_CursorShape:
  520. .. rst-class:: classref-enumeration
  521. enum **CursorShape**:
  522. .. _class_DisplayServer_constant_CURSOR_ARROW:
  523. .. rst-class:: classref-enumeration-constant
  524. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_ARROW** = ``0``
  525. Arrow cursor shape. This is the default when not pointing anything that overrides the mouse cursor, such as a :ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`.
  526. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  527. .. rst-class:: classref-enumeration-constant
  528. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_IBEAM** = ``1``
  529. I-beam cursor shape. This is used by default when hovering a control that accepts text input, such as :ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`.
  530. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  531. .. rst-class:: classref-enumeration-constant
  532. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  533. Pointing hand cursor shape. This is used by default when hovering a :ref:`LinkButton<class_LinkButton>` or a URL tag in a :ref:`RichTextLabel<class_RichTextLabel>`.
  534. .. _class_DisplayServer_constant_CURSOR_CROSS:
  535. .. rst-class:: classref-enumeration-constant
  536. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CROSS** = ``3``
  537. Crosshair cursor. This is intended to be displayed when the user needs precise aim over an element, such as a rectangle selection tool or a color picker.
  538. .. _class_DisplayServer_constant_CURSOR_WAIT:
  539. .. rst-class:: classref-enumeration-constant
  540. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_WAIT** = ``4``
  541. Wait cursor. On most cursor themes, this displays a spinning icon *besides* the arrow. Intended to be used for non-blocking operations (when the user can do something else at the moment). See also :ref:`CURSOR_BUSY<class_DisplayServer_constant_CURSOR_BUSY>`.
  542. .. _class_DisplayServer_constant_CURSOR_BUSY:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BUSY** = ``5``
  545. Wait cursor. On most cursor themes, this *replaces* the arrow with a spinning icon. Intended to be used for blocking operations (when the user can't do anything else at the moment). See also :ref:`CURSOR_WAIT<class_DisplayServer_constant_CURSOR_WAIT>`.
  546. .. _class_DisplayServer_constant_CURSOR_DRAG:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_DRAG** = ``6``
  549. Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP<class_DisplayServer_constant_CURSOR_CAN_DROP>`.
  550. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  553. "Can drop" cursor. This is displayed during drag-and-drop operations if hovering over a :ref:`Control<class_Control>` that can accept the drag-and-drop event. On most cursor themes, this displays a dragging hand with an arrow symbol besides it. See also :ref:`CURSOR_DRAG<class_DisplayServer_constant_CURSOR_DRAG>`.
  554. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  557. Forbidden cursor. This is displayed during drag-and-drop operations if the hovered :ref:`Control<class_Control>` can't accept the drag-and-drop event.
  558. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSIZE** = ``9``
  561. Vertical resize cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be vertically resized using the mouse. See also :ref:`CURSOR_VSPLIT<class_DisplayServer_constant_CURSOR_VSPLIT>`.
  562. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSIZE** = ``10``
  565. Horizontal resize cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be horizontally resized using the mouse. See also :ref:`CURSOR_HSPLIT<class_DisplayServer_constant_CURSOR_HSPLIT>`.
  566. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  569. Secondary diagonal resize cursor (top-right/bottom-left). Intended to be displayed when the hovered :ref:`Control<class_Control>` can be resized on both axes at once using the mouse.
  570. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  573. Main diagonal resize cursor (top-left/bottom-right). Intended to be displayed when the hovered :ref:`Control<class_Control>` can be resized on both axes at once using the mouse.
  574. .. _class_DisplayServer_constant_CURSOR_MOVE:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MOVE** = ``13``
  577. Move cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be moved using the mouse.
  578. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSPLIT** = ``14``
  581. Vertical split cursor. This is displayed when hovering a :ref:`Control<class_Control>` with splits that can be vertically resized using the mouse, such as :ref:`VSplitContainer<class_VSplitContainer>`. On some cursor themes, this cursor may have the same appearance as :ref:`CURSOR_VSIZE<class_DisplayServer_constant_CURSOR_VSIZE>`.
  582. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSPLIT** = ``15``
  585. Horizontal split cursor. This is displayed when hovering a :ref:`Control<class_Control>` with splits that can be horizontally resized using the mouse, such as :ref:`HSplitContainer<class_HSplitContainer>`. On some cursor themes, this cursor may have the same appearance as :ref:`CURSOR_HSIZE<class_DisplayServer_constant_CURSOR_HSIZE>`.
  586. .. _class_DisplayServer_constant_CURSOR_HELP:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HELP** = ``16``
  589. Help cursor. On most cursor themes, this displays a question mark icon instead of the mouse cursor. Intended to be used when the user has requested help on the next element that will be clicked.
  590. .. _class_DisplayServer_constant_CURSOR_MAX:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MAX** = ``17``
  593. Represents the size of the :ref:`CursorShape<enum_DisplayServer_CursorShape>` enum.
  594. .. rst-class:: classref-item-separator
  595. ----
  596. .. _enum_DisplayServer_WindowMode:
  597. .. rst-class:: classref-enumeration
  598. enum **WindowMode**:
  599. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  600. .. rst-class:: classref-enumeration-constant
  601. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_WINDOWED** = ``0``
  602. Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
  603. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  604. .. rst-class:: classref-enumeration-constant
  605. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MINIMIZED** = ``1``
  606. Minimized window mode, i.e. :ref:`Window<class_Window>` is not visible and available on window manager's window list. Normally happens when the minimize button is pressed.
  607. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  608. .. rst-class:: classref-enumeration-constant
  609. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MAXIMIZED** = ``2``
  610. Maximized window mode, i.e. :ref:`Window<class_Window>` will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed.
  611. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  612. .. rst-class:: classref-enumeration-constant
  613. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_FULLSCREEN** = ``3``
  614. Full screen mode with full multi-window support.
  615. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  616. \ **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
  617. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  618. .. rst-class:: classref-enumeration-constant
  619. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  620. A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition).
  621. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  622. \ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
  623. \ **On macOS:** Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
  624. \ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
  625. \ **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
  626. .. rst-class:: classref-item-separator
  627. ----
  628. .. _enum_DisplayServer_WindowFlags:
  629. .. rst-class:: classref-enumeration
  630. enum **WindowFlags**:
  631. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  632. .. rst-class:: classref-enumeration-constant
  633. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_RESIZE_DISABLED** = ``0``
  634. The window can't be resized by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size<class_DisplayServer_method_window_set_size>`. This flag is ignored for full screen windows.
  635. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  636. .. rst-class:: classref-enumeration-constant
  637. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_BORDERLESS** = ``1``
  638. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  639. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  640. .. rst-class:: classref-enumeration-constant
  641. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_ALWAYS_ON_TOP** = ``2``
  642. The window is floating on top of all other windows. This flag is ignored for full-screen windows.
  643. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  644. .. rst-class:: classref-enumeration-constant
  645. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_TRANSPARENT** = ``3``
  646. The window background can be transparent.
  647. \ **Note:** This flag has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` is set to ``false``.
  648. \ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  649. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  650. .. rst-class:: classref-enumeration-constant
  651. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_NO_FOCUS** = ``4``
  652. The window can't be focused. No-focus window will ignore all input, except mouse clicks.
  653. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  654. .. rst-class:: classref-enumeration-constant
  655. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_POPUP** = ``5``
  656. Window is part of menu or :ref:`OptionButton<class_OptionButton>` dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>`).
  657. .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
  658. .. rst-class:: classref-enumeration-constant
  659. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_EXTEND_TO_TITLE** = ``6``
  660. Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons.
  661. Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
  662. Use :ref:`window_get_safe_title_margins<class_DisplayServer_method_window_get_safe_title_margins>` to determine area under the title bar that is not covered by decorations.
  663. \ **Note:** This flag is implemented on macOS.
  664. .. _class_DisplayServer_constant_WINDOW_FLAG_MOUSE_PASSTHROUGH:
  665. .. rst-class:: classref-enumeration-constant
  666. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MOUSE_PASSTHROUGH** = ``7``
  667. All mouse events are passed to the underlying window of the same application.
  668. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  669. .. rst-class:: classref-enumeration-constant
  670. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MAX** = ``8``
  671. Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
  672. .. rst-class:: classref-item-separator
  673. ----
  674. .. _enum_DisplayServer_WindowEvent:
  675. .. rst-class:: classref-enumeration
  676. enum **WindowEvent**:
  677. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  678. .. rst-class:: classref-enumeration-constant
  679. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_ENTER** = ``0``
  680. Sent when the mouse pointer enters the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  681. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  682. .. rst-class:: classref-enumeration-constant
  683. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_EXIT** = ``1``
  684. Sent when the mouse pointer exits the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  685. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  686. .. rst-class:: classref-enumeration-constant
  687. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_IN** = ``2``
  688. Sent when the window grabs focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  689. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  690. .. rst-class:: classref-enumeration-constant
  691. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_OUT** = ``3``
  692. Sent when the window loses focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  693. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  694. .. rst-class:: classref-enumeration-constant
  695. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_CLOSE_REQUEST** = ``4``
  696. Sent when the user has attempted to close the window (e.g. close button is pressed), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  697. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  698. .. rst-class:: classref-enumeration-constant
  699. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_GO_BACK_REQUEST** = ``5``
  700. Sent when the device "Back" button is pressed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  701. \ **Note:** This event is implemented on Android.
  702. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  703. .. rst-class:: classref-enumeration-constant
  704. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_DPI_CHANGE** = ``6``
  705. Sent when the window is moved to the display with different DPI, or display DPI is changed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  706. \ **Note:** This flag is implemented on macOS.
  707. .. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
  708. .. rst-class:: classref-enumeration-constant
  709. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_TITLEBAR_CHANGE** = ``7``
  710. Sent when the window title bar decoration is changed (e.g. :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` is set or window entered/exited full screen mode), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  711. \ **Note:** This flag is implemented on macOS.
  712. .. rst-class:: classref-item-separator
  713. ----
  714. .. _enum_DisplayServer_VSyncMode:
  715. .. rst-class:: classref-enumeration
  716. enum **VSyncMode**:
  717. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  718. .. rst-class:: classref-enumeration-constant
  719. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_DISABLED** = ``0``
  720. No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (nonwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  721. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  722. .. rst-class:: classref-enumeration-constant
  723. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ENABLED** = ``1``
  724. Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible). Framerate is limited by the monitor refresh rate (nonwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  725. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  726. .. rst-class:: classref-enumeration-constant
  727. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ADAPTIVE** = ``2``
  728. 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. Framerate is limited by the monitor refresh rate (nonwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`). Behaves like :ref:`VSYNC_ENABLED<class_DisplayServer_constant_VSYNC_ENABLED>` when using the Compatibility rendering method.
  729. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  730. .. rst-class:: classref-enumeration-constant
  731. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_MAILBOX** = ``3``
  732. Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible). Framerate is unlimited (nonwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  733. Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). :ref:`VSYNC_MAILBOX<class_DisplayServer_constant_VSYNC_MAILBOX>` works best when at least twice as many frames as the display refresh rate are rendered. Behaves like :ref:`VSYNC_ENABLED<class_DisplayServer_constant_VSYNC_ENABLED>` when using the Compatibility rendering method.
  734. .. rst-class:: classref-item-separator
  735. ----
  736. .. _enum_DisplayServer_HandleType:
  737. .. rst-class:: classref-enumeration
  738. enum **HandleType**:
  739. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  740. .. rst-class:: classref-enumeration-constant
  741. :ref:`HandleType<enum_DisplayServer_HandleType>` **DISPLAY_HANDLE** = ``0``
  742. Display handle:
  743. - Linux (X11): ``X11::Display*`` for the display.
  744. - Android: ``EGLDisplay`` for the display.
  745. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  746. .. rst-class:: classref-enumeration-constant
  747. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_HANDLE** = ``1``
  748. Window handle:
  749. - Windows: ``HWND`` for the window.
  750. - Linux (X11): ``X11::Window*`` for the window.
  751. - macOS: ``NSWindow*`` for the window.
  752. - iOS: ``UIViewController*`` for the view controller.
  753. - Android: ``jObject`` for the activity.
  754. .. _class_DisplayServer_constant_WINDOW_VIEW:
  755. .. rst-class:: classref-enumeration-constant
  756. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_VIEW** = ``2``
  757. Window view:
  758. - Windows: ``HDC`` for the window (only with the GL Compatibility renderer).
  759. - macOS: ``NSView*`` for the window main view.
  760. - iOS: ``UIView*`` for the window main view.
  761. .. _class_DisplayServer_constant_OPENGL_CONTEXT:
  762. .. rst-class:: classref-enumeration-constant
  763. :ref:`HandleType<enum_DisplayServer_HandleType>` **OPENGL_CONTEXT** = ``3``
  764. OpenGL context (only with the GL Compatibility renderer):
  765. - Windows: ``HGLRC`` for the window.
  766. - Linux: ``GLXContext*`` for the window.
  767. - MacOS: ``NSOpenGLContext*`` for the window.
  768. - Android: ``EGLContext`` for the window.
  769. .. rst-class:: classref-item-separator
  770. ----
  771. .. _enum_DisplayServer_TTSUtteranceEvent:
  772. .. rst-class:: classref-enumeration
  773. enum **TTSUtteranceEvent**:
  774. .. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
  775. .. rst-class:: classref-enumeration-constant
  776. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  777. Utterance has begun to be spoken.
  778. .. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
  779. .. rst-class:: classref-enumeration-constant
  780. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  781. Utterance was successfully finished.
  782. .. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
  783. .. rst-class:: classref-enumeration-constant
  784. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  785. Utterance was canceled, or TTS service was unable to process it.
  786. .. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
  787. .. rst-class:: classref-enumeration-constant
  788. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  789. Utterance reached a word or sentence boundary.
  790. .. rst-class:: classref-section-separator
  791. ----
  792. .. rst-class:: classref-descriptions-group
  793. Constants
  794. ---------
  795. .. _class_DisplayServer_constant_SCREEN_PRIMARY:
  796. .. rst-class:: classref-constant
  797. **SCREEN_PRIMARY** = ``-2``
  798. Represents the primary screen.
  799. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  800. .. rst-class:: classref-constant
  801. **SCREEN_OF_MAIN_WINDOW** = ``-1``
  802. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
  803. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  804. .. rst-class:: classref-constant
  805. **MAIN_WINDOW_ID** = ``0``
  806. The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``.
  807. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  808. .. rst-class:: classref-constant
  809. **INVALID_WINDOW_ID** = ``-1``
  810. The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result.
  811. .. rst-class:: classref-section-separator
  812. ----
  813. .. rst-class:: classref-descriptions-group
  814. Method Descriptions
  815. -------------------
  816. .. _class_DisplayServer_method_clipboard_get:
  817. .. rst-class:: classref-method
  818. :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  819. Returns the user's clipboard as a string if possible.
  820. .. rst-class:: classref-item-separator
  821. ----
  822. .. _class_DisplayServer_method_clipboard_get_primary:
  823. .. rst-class:: classref-method
  824. :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  825. Returns the user's `primary <https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer>`__ clipboard as a string if possible. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
  826. \ **Note:** This method is only implemented on Linux (X11).
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_DisplayServer_method_clipboard_has:
  830. .. rst-class:: classref-method
  831. :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  832. Returns ``true`` if there is content on the user's clipboard.
  833. .. rst-class:: classref-item-separator
  834. ----
  835. .. _class_DisplayServer_method_clipboard_set:
  836. .. rst-class:: classref-method
  837. void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  838. Sets the user's clipboard content to the given string.
  839. .. rst-class:: classref-item-separator
  840. ----
  841. .. _class_DisplayServer_method_clipboard_set_primary:
  842. .. rst-class:: classref-method
  843. void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  844. Sets the user's `primary <https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer>`__ clipboard content to the given string. This is the clipboard that is set when the user selects text in any application, rather than when pressing :kbd:`Ctrl + C`. The clipboard data can then be pasted by clicking the middle mouse button in any application that supports the primary clipboard mechanism.
  845. \ **Note:** This method is only implemented on Linux (X11).
  846. .. rst-class:: classref-item-separator
  847. ----
  848. .. _class_DisplayServer_method_cursor_get_shape:
  849. .. rst-class:: classref-method
  850. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  851. Returns the default mouse cursor shape set by :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  852. .. rst-class:: classref-item-separator
  853. ----
  854. .. _class_DisplayServer_method_cursor_set_custom_image:
  855. .. rst-class:: classref-method
  856. 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) **)**
  857. Sets a custom mouse cursor image for the defined ``shape``. This means the user's operating system and mouse cursor theme will no longer influence the mouse cursor's appearance. The image must be ``256x256`` or smaller for correct appearance. ``hotspot`` can optionally be set to define the area where the cursor will click. By default, ``hotspot`` is set to ``Vector2(0, 0)``, which is the top-left corner of the image. See also :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  858. .. rst-class:: classref-item-separator
  859. ----
  860. .. _class_DisplayServer_method_cursor_set_shape:
  861. .. rst-class:: classref-method
  862. void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  863. Sets the default mouse cursor shape. The cursor's appearance will vary depending on the user's operating system and mouse cursor theme. See also :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` and :ref:`cursor_set_custom_image<class_DisplayServer_method_cursor_set_custom_image>`.
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_DisplayServer_method_dialog_input_text:
  867. .. rst-class:: classref-method
  868. :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 **)**
  869. Shows a text input dialog which uses the operating system's native look-and-feel. ``callback`` will be called with a :ref:`String<class_String>` argument equal to the text field's contents when the dialog is closed for any reason.
  870. \ **Note:** This method is implemented on macOS.
  871. .. rst-class:: classref-item-separator
  872. ----
  873. .. _class_DisplayServer_method_dialog_show:
  874. .. rst-class:: classref-method
  875. :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 **)**
  876. Shows a text dialog which uses the operating system's native look-and-feel. ``callback`` will be called when the dialog is closed for any reason.
  877. \ **Note:** This method is implemented on macOS.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_DisplayServer_method_enable_for_stealing_focus:
  881. .. rst-class:: classref-method
  882. void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  883. Allows the ``process_id`` PID to steal focus from this window. In other words, this disables the operating system's focus stealing protection for the specified PID.
  884. \ **Note:** This method is implemented on Windows.
  885. .. rst-class:: classref-item-separator
  886. ----
  887. .. _class_DisplayServer_method_force_process_and_drop_events:
  888. .. rst-class:: classref-method
  889. void **force_process_and_drop_events** **(** **)**
  890. Forces window manager processing while ignoring all :ref:`InputEvent<class_InputEvent>`\ s. See also :ref:`process_events<class_DisplayServer_method_process_events>`.
  891. \ **Note:** This method is implemented on Windows and macOS.
  892. .. rst-class:: classref-item-separator
  893. ----
  894. .. _class_DisplayServer_method_get_accent_color:
  895. .. rst-class:: classref-method
  896. :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
  897. Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
  898. \ **Note:** This method is implemented on macOS and Windows.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_DisplayServer_method_get_display_cutouts:
  902. .. rst-class:: classref-method
  903. :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
  904. Returns an :ref:`Array<class_Array>` of :ref:`Rect2<class_Rect2>`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>`.
  905. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_DisplayServer_method_get_display_safe_area:
  909. .. rst-class:: classref-method
  910. :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
  911. Returns the unobscured area of the display where interactive controls should be rendered. See also :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>`.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_DisplayServer_method_get_name:
  915. .. rst-class:: classref-method
  916. :ref:`String<class_String>` **get_name** **(** **)** |const|
  917. Returns the name of the **DisplayServer** currently in use. Most operating systems only have a single **DisplayServer**, but Linux has access to more than one **DisplayServer** (although only X11 is currently implemented in Godot).
  918. The names of built-in display servers are ``Windows``, ``macOS``, ``X11`` (Linux), ``Android``, ``iOS``, ``web`` (HTML5) and ``headless`` (when started with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>`).
  919. .. rst-class:: classref-item-separator
  920. ----
  921. .. _class_DisplayServer_method_get_primary_screen:
  922. .. rst-class:: classref-method
  923. :ref:`int<class_int>` **get_primary_screen** **(** **)** |const|
  924. Returns index of the primary screen.
  925. .. rst-class:: classref-item-separator
  926. ----
  927. .. _class_DisplayServer_method_get_screen_count:
  928. .. rst-class:: classref-method
  929. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  930. Returns the number of displays available.
  931. .. rst-class:: classref-item-separator
  932. ----
  933. .. _class_DisplayServer_method_get_screen_from_rect:
  934. .. rst-class:: classref-method
  935. :ref:`int<class_int>` **get_screen_from_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |const|
  936. Returns index of the screen which contains specified rectangle.
  937. .. rst-class:: classref-item-separator
  938. ----
  939. .. _class_DisplayServer_method_get_swap_cancel_ok:
  940. .. rst-class:: classref-method
  941. :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  942. Returns ``true`` if positions of **OK** and **Cancel** buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing :ref:`ProjectSettings.gui/common/swap_cancel_ok<class_ProjectSettings_property_gui/common/swap_cancel_ok>`.
  943. \ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show<class_DisplayServer_method_dialog_show>`.
  944. .. rst-class:: classref-item-separator
  945. ----
  946. .. _class_DisplayServer_method_get_window_at_screen_position:
  947. .. rst-class:: classref-method
  948. :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  949. Returns the ID of the window at the specified screen ``position`` (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
  950. ::
  951. * (0, 0) +-------+
  952. | |
  953. +-------------+ | |
  954. | | | |
  955. | | | |
  956. +-------------+ +-------+
  957. .. rst-class:: classref-item-separator
  958. ----
  959. .. _class_DisplayServer_method_get_window_list:
  960. .. rst-class:: classref-method
  961. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  962. Returns the list of Godot window IDs belonging to this process.
  963. \ **Note:** Native dialogs are not included in this list.
  964. .. rst-class:: classref-item-separator
  965. ----
  966. .. _class_DisplayServer_method_global_menu_add_check_item:
  967. .. rst-class:: classref-method
  968. :ref:`int<class_int>` **global_menu_add_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  969. Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
  970. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  971. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  972. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  973. \ **Note:** This method is implemented on macOS.
  974. \ **Supported system menu IDs:**\
  975. ::
  976. "_main" - Main menu (macOS).
  977. "_dock" - Dock popup menu (macOS).
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_DisplayServer_method_global_menu_add_icon_check_item:
  981. .. rst-class:: classref-method
  982. :ref:`int<class_int>` **global_menu_add_icon_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  983. Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  984. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  985. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  986. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  987. \ **Note:** This method is implemented on macOS.
  988. \ **Supported system menu IDs:**\
  989. ::
  990. "_main" - Main menu (macOS).
  991. "_dock" - Dock popup menu (macOS).
  992. .. rst-class:: classref-item-separator
  993. ----
  994. .. _class_DisplayServer_method_global_menu_add_icon_item:
  995. .. rst-class:: classref-method
  996. :ref:`int<class_int>` **global_menu_add_icon_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  997. Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  998. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  999. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1000. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  1001. \ **Note:** This method is implemented on macOS.
  1002. \ **Supported system menu IDs:**\
  1003. ::
  1004. "_main" - Main menu (macOS).
  1005. "_dock" - Dock popup menu (macOS).
  1006. .. rst-class:: classref-item-separator
  1007. ----
  1008. .. _class_DisplayServer_method_global_menu_add_icon_radio_check_item:
  1009. .. rst-class:: classref-method
  1010. :ref:`int<class_int>` **global_menu_add_icon_radio_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1011. Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1012. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1013. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1014. \ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` for more info on how to control it.
  1015. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  1016. \ **Note:** This method is implemented on macOS.
  1017. \ **Supported system menu IDs:**\
  1018. ::
  1019. "_main" - Main menu (macOS).
  1020. "_dock" - Dock popup menu (macOS).
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_DisplayServer_method_global_menu_add_item:
  1024. .. rst-class:: classref-method
  1025. :ref:`int<class_int>` **global_menu_add_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1026. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1027. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1028. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1029. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  1030. \ **Note:** This method is implemented on macOS.
  1031. \ **Supported system menu IDs:**\
  1032. ::
  1033. "_main" - Main menu (macOS).
  1034. "_dock" - Dock popup menu (macOS).
  1035. .. rst-class:: classref-item-separator
  1036. ----
  1037. .. _class_DisplayServer_method_global_menu_add_multistate_item:
  1038. .. rst-class:: classref-method
  1039. :ref:`int<class_int>` **global_menu_add_multistate_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1040. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1041. Contrarily to normal binary items, multistate items can have more than two states, as defined by ``max_states``. Each press or activate of the item will increase the state by one. The default value is defined by ``default_state``.
  1042. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1043. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1044. \ **Note:** By default, there's no indication of the current item state, it should be changed manually.
  1045. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  1046. \ **Note:** This method is implemented on macOS.
  1047. \ **Supported system menu IDs:**\
  1048. ::
  1049. "_main" - Main menu (macOS).
  1050. "_dock" - Dock popup menu (macOS).
  1051. .. rst-class:: classref-item-separator
  1052. ----
  1053. .. _class_DisplayServer_method_global_menu_add_radio_check_item:
  1054. .. rst-class:: classref-method
  1055. :ref:`int<class_int>` **global_menu_add_radio_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1056. Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1057. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1058. An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1059. \ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` for more info on how to control it.
  1060. \ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
  1061. \ **Note:** This method is implemented on macOS.
  1062. \ **Supported system menu IDs:**\
  1063. ::
  1064. "_main" - Main menu (macOS).
  1065. "_dock" - Dock popup menu (macOS).
  1066. .. rst-class:: classref-item-separator
  1067. ----
  1068. .. _class_DisplayServer_method_global_menu_add_separator:
  1069. .. rst-class:: classref-method
  1070. :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
  1071. Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
  1072. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1073. \ **Note:** This method is implemented on macOS.
  1074. \ **Supported system menu IDs:**\
  1075. ::
  1076. "_main" - Main menu (macOS).
  1077. "_dock" - Dock popup menu (macOS).
  1078. .. rst-class:: classref-item-separator
  1079. ----
  1080. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  1081. .. rst-class:: classref-method
  1082. :ref:`int<class_int>` **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` index=-1 **)**
  1083. Adds an item that will act as a submenu of the global menu ``menu_root``. The ``submenu`` argument is the ID of the global menu root that will be shown when the item is clicked.
  1084. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1085. \ **Note:** This method is implemented on macOS.
  1086. \ **Supported system menu IDs:**\
  1087. ::
  1088. "_main" - Main menu (macOS).
  1089. "_dock" - Dock popup menu (macOS).
  1090. .. rst-class:: classref-item-separator
  1091. ----
  1092. .. _class_DisplayServer_method_global_menu_clear:
  1093. .. rst-class:: classref-method
  1094. void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  1095. Removes all items from the global menu with ID ``menu_root``.
  1096. \ **Note:** This method is implemented on macOS.
  1097. \ **Supported system menu IDs:**\
  1098. ::
  1099. "_main" - Main menu (macOS).
  1100. "_dock" - Dock popup menu (macOS).
  1101. .. rst-class:: classref-item-separator
  1102. ----
  1103. .. _class_DisplayServer_method_global_menu_get_item_accelerator:
  1104. .. rst-class:: classref-method
  1105. :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1106. Returns the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
  1107. \ **Note:** This method is implemented on macOS.
  1108. .. rst-class:: classref-item-separator
  1109. ----
  1110. .. _class_DisplayServer_method_global_menu_get_item_callback:
  1111. .. rst-class:: classref-method
  1112. :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1113. Returns the callback of the item at index ``idx``.
  1114. \ **Note:** This method is implemented on macOS.
  1115. .. rst-class:: classref-item-separator
  1116. ----
  1117. .. _class_DisplayServer_method_global_menu_get_item_count:
  1118. .. rst-class:: classref-method
  1119. :ref:`int<class_int>` **global_menu_get_item_count** **(** :ref:`String<class_String>` menu_root **)** |const|
  1120. Returns number of items in the global menu with ID ``menu_root``.
  1121. \ **Note:** This method is implemented on macOS.
  1122. .. rst-class:: classref-item-separator
  1123. ----
  1124. .. _class_DisplayServer_method_global_menu_get_item_icon:
  1125. .. rst-class:: classref-method
  1126. :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1127. Returns the icon of the item at index ``idx``.
  1128. \ **Note:** This method is implemented on macOS.
  1129. .. rst-class:: classref-item-separator
  1130. ----
  1131. .. _class_DisplayServer_method_global_menu_get_item_indentation_level:
  1132. .. rst-class:: classref-method
  1133. :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1134. Returns the horizontal offset of the item at the given ``idx``.
  1135. \ **Note:** This method is implemented on macOS.
  1136. .. rst-class:: classref-item-separator
  1137. ----
  1138. .. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
  1139. .. rst-class:: classref-method
  1140. :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
  1141. Returns the index of the item with the specified ``tag``. Index is automatically assigned to each item by the engine. Index can not be set manually.
  1142. \ **Note:** This method is implemented on macOS.
  1143. .. rst-class:: classref-item-separator
  1144. ----
  1145. .. _class_DisplayServer_method_global_menu_get_item_index_from_text:
  1146. .. rst-class:: classref-method
  1147. :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
  1148. Returns the index of the item with the specified ``text``. Index is automatically assigned to each item by the engine. Index can not be set manually.
  1149. \ **Note:** This method is implemented on macOS.
  1150. .. rst-class:: classref-item-separator
  1151. ----
  1152. .. _class_DisplayServer_method_global_menu_get_item_key_callback:
  1153. .. rst-class:: classref-method
  1154. :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1155. Returns the callback of the item accelerator at index ``idx``.
  1156. \ **Note:** This method is implemented on macOS.
  1157. .. rst-class:: classref-item-separator
  1158. ----
  1159. .. _class_DisplayServer_method_global_menu_get_item_max_states:
  1160. .. rst-class:: classref-method
  1161. :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1162. Returns number of states of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1163. \ **Note:** This method is implemented on macOS.
  1164. .. rst-class:: classref-item-separator
  1165. ----
  1166. .. _class_DisplayServer_method_global_menu_get_item_state:
  1167. .. rst-class:: classref-method
  1168. :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1169. Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1170. \ **Note:** This method is implemented on macOS.
  1171. .. rst-class:: classref-item-separator
  1172. ----
  1173. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  1174. .. rst-class:: classref-method
  1175. :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1176. Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` for more info on how to add a submenu.
  1177. \ **Note:** This method is implemented on macOS.
  1178. .. rst-class:: classref-item-separator
  1179. ----
  1180. .. _class_DisplayServer_method_global_menu_get_item_tag:
  1181. .. rst-class:: classref-method
  1182. :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1183. Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>`, which provides a simple way of assigning context data to items.
  1184. \ **Note:** This method is implemented on macOS.
  1185. .. rst-class:: classref-item-separator
  1186. ----
  1187. .. _class_DisplayServer_method_global_menu_get_item_text:
  1188. .. rst-class:: classref-method
  1189. :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1190. Returns the text of the item at index ``idx``.
  1191. \ **Note:** This method is implemented on macOS.
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_DisplayServer_method_global_menu_get_item_tooltip:
  1195. .. rst-class:: classref-method
  1196. :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1197. Returns the tooltip associated with the specified index ``idx``.
  1198. \ **Note:** This method is implemented on macOS.
  1199. .. rst-class:: classref-item-separator
  1200. ----
  1201. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  1202. .. rst-class:: classref-method
  1203. :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1204. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  1205. \ **Note:** This method is implemented on macOS.
  1206. .. rst-class:: classref-item-separator
  1207. ----
  1208. .. _class_DisplayServer_method_global_menu_is_item_checked:
  1209. .. rst-class:: classref-method
  1210. :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1211. Returns ``true`` if the item at index ``idx`` is checked.
  1212. \ **Note:** This method is implemented on macOS.
  1213. .. rst-class:: classref-item-separator
  1214. ----
  1215. .. _class_DisplayServer_method_global_menu_is_item_disabled:
  1216. .. rst-class:: classref-method
  1217. :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1218. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  1219. See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
  1220. \ **Note:** This method is implemented on macOS.
  1221. .. rst-class:: classref-item-separator
  1222. ----
  1223. .. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
  1224. .. rst-class:: classref-method
  1225. :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1226. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  1227. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1228. \ **Note:** This method is implemented on macOS.
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_DisplayServer_method_global_menu_remove_item:
  1232. .. rst-class:: classref-method
  1233. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  1234. Removes the item at index ``idx`` from the global menu ``menu_root``.
  1235. \ **Note:** The indices of items after the removed item will be shifted by one.
  1236. \ **Note:** This method is implemented on macOS.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_DisplayServer_method_global_menu_set_item_accelerator:
  1240. .. rst-class:: classref-method
  1241. void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
  1242. Sets the accelerator of the item at index ``idx``. ``keycode`` can be a single :ref:`Key<enum_@GlobalScope_Key>`, or a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
  1243. \ **Note:** This method is implemented on macOS.
  1244. .. rst-class:: classref-item-separator
  1245. ----
  1246. .. _class_DisplayServer_method_global_menu_set_item_callback:
  1247. .. rst-class:: classref-method
  1248. void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1249. Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
  1250. \ **Note:** The ``callback`` Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the ``tag`` parameter when the menu item was created.
  1251. \ **Note:** This method is implemented on macOS.
  1252. .. rst-class:: classref-item-separator
  1253. ----
  1254. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  1255. .. rst-class:: classref-method
  1256. void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1257. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  1258. \ **Note:** This method is implemented on macOS.
  1259. .. rst-class:: classref-item-separator
  1260. ----
  1261. .. _class_DisplayServer_method_global_menu_set_item_checked:
  1262. .. rst-class:: classref-method
  1263. void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  1264. Sets the checkstate status of the item at index ``idx``.
  1265. \ **Note:** This method is implemented on macOS.
  1266. .. rst-class:: classref-item-separator
  1267. ----
  1268. .. _class_DisplayServer_method_global_menu_set_item_disabled:
  1269. .. rst-class:: classref-method
  1270. void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  1271. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  1272. \ **Note:** This method is implemented on macOS.
  1273. .. rst-class:: classref-item-separator
  1274. ----
  1275. .. _class_DisplayServer_method_global_menu_set_item_icon:
  1276. .. rst-class:: classref-method
  1277. void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  1278. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  1279. \ **Note:** This method is implemented on macOS.
  1280. \ **Note:** This method is not supported by macOS "_dock" menu items.
  1281. .. rst-class:: classref-item-separator
  1282. ----
  1283. .. _class_DisplayServer_method_global_menu_set_item_indentation_level:
  1284. .. rst-class:: classref-method
  1285. void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
  1286. Sets the horizontal offset of the item at the given ``idx``.
  1287. \ **Note:** This method is implemented on macOS.
  1288. .. rst-class:: classref-item-separator
  1289. ----
  1290. .. _class_DisplayServer_method_global_menu_set_item_key_callback:
  1291. .. rst-class:: classref-method
  1292. void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
  1293. Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
  1294. \ **Note:** The ``key_callback`` Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the ``tag`` parameter when the menu item was created.
  1295. \ **Note:** This method is implemented on macOS.
  1296. .. rst-class:: classref-item-separator
  1297. ----
  1298. .. _class_DisplayServer_method_global_menu_set_item_max_states:
  1299. .. rst-class:: classref-method
  1300. void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
  1301. Sets number of state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1302. \ **Note:** This method is implemented on macOS.
  1303. .. rst-class:: classref-item-separator
  1304. ----
  1305. .. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
  1306. .. rst-class:: classref-method
  1307. void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1308. Sets the type of the item at the specified index ``idx`` to radio button. If ``false``, sets the type of the item to plain text.
  1309. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1310. \ **Note:** This method is implemented on macOS.
  1311. .. rst-class:: classref-item-separator
  1312. ----
  1313. .. _class_DisplayServer_method_global_menu_set_item_state:
  1314. .. rst-class:: classref-method
  1315. void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  1316. Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1317. \ **Note:** This method is implemented on macOS.
  1318. .. rst-class:: classref-item-separator
  1319. ----
  1320. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  1321. .. rst-class:: classref-method
  1322. void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  1323. Sets the submenu of the item at index ``idx``. The submenu is the ID of a global menu root that would be shown when the item is clicked.
  1324. \ **Note:** This method is implemented on macOS.
  1325. .. rst-class:: classref-item-separator
  1326. ----
  1327. .. _class_DisplayServer_method_global_menu_set_item_tag:
  1328. .. rst-class:: classref-method
  1329. void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  1330. Sets the metadata of an item, which may be of any type. You can later get it with :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>`, which provides a simple way of assigning context data to items.
  1331. \ **Note:** This method is implemented on macOS.
  1332. .. rst-class:: classref-item-separator
  1333. ----
  1334. .. _class_DisplayServer_method_global_menu_set_item_text:
  1335. .. rst-class:: classref-method
  1336. void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  1337. Sets the text of the item at index ``idx``.
  1338. \ **Note:** This method is implemented on macOS.
  1339. .. rst-class:: classref-item-separator
  1340. ----
  1341. .. _class_DisplayServer_method_global_menu_set_item_tooltip:
  1342. .. rst-class:: classref-method
  1343. void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  1344. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  1345. \ **Note:** This method is implemented on macOS.
  1346. .. rst-class:: classref-item-separator
  1347. ----
  1348. .. _class_DisplayServer_method_has_feature:
  1349. .. rst-class:: classref-method
  1350. :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  1351. Returns ``true`` if the specified ``feature`` is supported by the current **DisplayServer**, ``false`` otherwise.
  1352. .. rst-class:: classref-item-separator
  1353. ----
  1354. .. _class_DisplayServer_method_ime_get_selection:
  1355. .. rst-class:: classref-method
  1356. :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  1357. Returns the text selection in the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ composition string, with the :ref:`Vector2i<class_Vector2i>`'s ``x`` component being the caret position and ``y`` being the length of the selection.
  1358. \ **Note:** This method is implemented on macOS.
  1359. .. rst-class:: classref-item-separator
  1360. ----
  1361. .. _class_DisplayServer_method_ime_get_text:
  1362. .. rst-class:: classref-method
  1363. :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  1364. Returns the composition string contained within the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ window.
  1365. \ **Note:** This method is implemented on macOS.
  1366. .. rst-class:: classref-item-separator
  1367. ----
  1368. .. _class_DisplayServer_method_is_dark_mode:
  1369. .. rst-class:: classref-method
  1370. :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
  1371. Returns ``true`` if OS is using dark mode.
  1372. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1373. .. rst-class:: classref-item-separator
  1374. ----
  1375. .. _class_DisplayServer_method_is_dark_mode_supported:
  1376. .. rst-class:: classref-method
  1377. :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
  1378. Returns ``true`` if OS supports dark mode.
  1379. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1380. .. rst-class:: classref-item-separator
  1381. ----
  1382. .. _class_DisplayServer_method_is_touchscreen_available:
  1383. .. rst-class:: classref-method
  1384. :ref:`bool<class_bool>` **is_touchscreen_available** **(** **)** |const|
  1385. Returns ``true`` if touch events are available (Android or iOS), the capability is detected on the Webplatform or if :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is ``true``.
  1386. .. rst-class:: classref-item-separator
  1387. ----
  1388. .. _class_DisplayServer_method_keyboard_get_current_layout:
  1389. .. rst-class:: classref-method
  1390. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1391. Returns active keyboard layout index.
  1392. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1393. .. rst-class:: classref-item-separator
  1394. ----
  1395. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  1396. .. rst-class:: classref-method
  1397. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1398. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  1399. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1400. .. rst-class:: classref-item-separator
  1401. ----
  1402. .. _class_DisplayServer_method_keyboard_get_layout_count:
  1403. .. rst-class:: classref-method
  1404. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1405. Returns the number of keyboard layouts.
  1406. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1407. .. rst-class:: classref-item-separator
  1408. ----
  1409. .. _class_DisplayServer_method_keyboard_get_layout_language:
  1410. .. rst-class:: classref-method
  1411. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1412. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1413. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1414. .. rst-class:: classref-item-separator
  1415. ----
  1416. .. _class_DisplayServer_method_keyboard_get_layout_name:
  1417. .. rst-class:: classref-method
  1418. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1419. Returns the localized name of the keyboard layout at position ``index``.
  1420. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1421. .. rst-class:: classref-item-separator
  1422. ----
  1423. .. _class_DisplayServer_method_keyboard_set_current_layout:
  1424. .. rst-class:: classref-method
  1425. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1426. Sets the active keyboard layout.
  1427. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1428. .. rst-class:: classref-item-separator
  1429. ----
  1430. .. _class_DisplayServer_method_mouse_get_button_state:
  1431. .. rst-class:: classref-method
  1432. :ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **mouse_get_button_state** **(** **)** |const|
  1433. Returns the current state of mouse buttons (whether each button is pressed) as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to :ref:`Input.get_mouse_button_mask<class_Input_method_get_mouse_button_mask>`.
  1434. .. rst-class:: classref-item-separator
  1435. ----
  1436. .. _class_DisplayServer_method_mouse_get_mode:
  1437. .. rst-class:: classref-method
  1438. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  1439. Returns the current mouse mode. See also :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>`.
  1440. .. rst-class:: classref-item-separator
  1441. ----
  1442. .. _class_DisplayServer_method_mouse_get_position:
  1443. .. rst-class:: classref-method
  1444. :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  1445. Returns the mouse cursor's current position in screen coordinates.
  1446. .. rst-class:: classref-item-separator
  1447. ----
  1448. .. _class_DisplayServer_method_mouse_set_mode:
  1449. .. rst-class:: classref-method
  1450. void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  1451. Sets the current mouse mode. See also :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>`.
  1452. .. rst-class:: classref-item-separator
  1453. ----
  1454. .. _class_DisplayServer_method_process_events:
  1455. .. rst-class:: classref-method
  1456. void **process_events** **(** **)**
  1457. Perform window manager processing, including input flushing. See also :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>`, :ref:`Input.flush_buffered_events<class_Input_method_flush_buffered_events>` and :ref:`Input.use_accumulated_input<class_Input_property_use_accumulated_input>`.
  1458. .. rst-class:: classref-item-separator
  1459. ----
  1460. .. _class_DisplayServer_method_screen_get_dpi:
  1461. .. rst-class:: classref-method
  1462. :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1463. Returns the dots per inch density of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW<class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW>` (the default value), a screen with the main window will be used.
  1464. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1465. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1466. ::
  1467. ldpi - 120 dpi
  1468. mdpi - 160 dpi
  1469. hdpi - 240 dpi
  1470. xhdpi - 320 dpi
  1471. xxhdpi - 480 dpi
  1472. xxxhdpi - 640 dpi
  1473. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms.
  1474. .. rst-class:: classref-item-separator
  1475. ----
  1476. .. _class_DisplayServer_method_screen_get_max_scale:
  1477. .. rst-class:: classref-method
  1478. :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  1479. Returns the greatest scale factor of all screens.
  1480. \ **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.
  1481. \ **Note:** This method is implemented on macOS.
  1482. .. rst-class:: classref-item-separator
  1483. ----
  1484. .. _class_DisplayServer_method_screen_get_orientation:
  1485. .. rst-class:: classref-method
  1486. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1487. Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>`.
  1488. \ **Note:** This method is implemented on Android and iOS.
  1489. .. rst-class:: classref-item-separator
  1490. ----
  1491. .. _class_DisplayServer_method_screen_get_position:
  1492. .. rst-class:: classref-method
  1493. :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1494. Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
  1495. ::
  1496. * (0, 0) +-------+
  1497. | |
  1498. +-------------+ | |
  1499. | | | |
  1500. | | | |
  1501. +-------------+ +-------+
  1502. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1503. .. rst-class:: classref-item-separator
  1504. ----
  1505. .. _class_DisplayServer_method_screen_get_refresh_rate:
  1506. .. rst-class:: classref-method
  1507. :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1508. Returns the current refresh rate of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW<class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW>` (the default value), a screen with the main window will be used.
  1509. \ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On Web, :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform.
  1510. To fallback to a default refresh rate if the method fails, try:
  1511. ::
  1512. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  1513. if refresh_rate < 0:
  1514. refresh_rate = 60.0
  1515. .. rst-class:: classref-item-separator
  1516. ----
  1517. .. _class_DisplayServer_method_screen_get_scale:
  1518. .. rst-class:: classref-method
  1519. :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1520. Returns the scale factor of the specified screen by index.
  1521. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1522. \ **Note:** This method is implemented on macOS.
  1523. .. rst-class:: classref-item-separator
  1524. ----
  1525. .. _class_DisplayServer_method_screen_get_size:
  1526. .. rst-class:: classref-method
  1527. :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1528. Returns the screen's size in pixels. See also :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` and :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>`.
  1529. .. rst-class:: classref-item-separator
  1530. ----
  1531. .. _class_DisplayServer_method_screen_get_usable_rect:
  1532. .. rst-class:: classref-method
  1533. :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1534. Returns the portion of the screen that is not obstructed by a status bar in pixels. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1535. .. rst-class:: classref-item-separator
  1536. ----
  1537. .. _class_DisplayServer_method_screen_is_kept_on:
  1538. .. rst-class:: classref-method
  1539. :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  1540. Returns ``true`` if the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>`.
  1541. .. rst-class:: classref-item-separator
  1542. ----
  1543. .. _class_DisplayServer_method_screen_set_keep_on:
  1544. .. rst-class:: classref-method
  1545. void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  1546. Sets whether the screen should never be turned off by the operating system's power-saving measures. See also :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>`.
  1547. .. rst-class:: classref-item-separator
  1548. ----
  1549. .. _class_DisplayServer_method_screen_set_orientation:
  1550. .. rst-class:: classref-method
  1551. void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  1552. Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>`.
  1553. .. rst-class:: classref-item-separator
  1554. ----
  1555. .. _class_DisplayServer_method_set_icon:
  1556. .. rst-class:: classref-method
  1557. void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  1558. Sets the window icon (usually displayed in the top-left corner) with an :ref:`Image<class_Image>`. To use icons in the operating system's native format, use :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` instead.
  1559. .. rst-class:: classref-item-separator
  1560. ----
  1561. .. _class_DisplayServer_method_set_native_icon:
  1562. .. rst-class:: classref-method
  1563. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1564. Sets the window icon (usually displayed in the top-left corner) in the operating system's *native* format. The file at ``filename`` must be in ``.ico`` format on Windows or ``.icns`` on macOS. By using specially crafted ``.ico`` or ``.icns`` icons, :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` allows specifying different icons depending on the size the icon is displayed at. This size is determined by the operating system and user preferences (including the display scale factor). To use icons in other formats, use :ref:`set_icon<class_DisplayServer_method_set_icon>` instead.
  1565. .. rst-class:: classref-item-separator
  1566. ----
  1567. .. _class_DisplayServer_method_tablet_get_current_driver:
  1568. .. rst-class:: classref-method
  1569. :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  1570. Returns current active tablet driver name.
  1571. \ **Note:** This method is implemented on Windows.
  1572. .. rst-class:: classref-item-separator
  1573. ----
  1574. .. _class_DisplayServer_method_tablet_get_driver_count:
  1575. .. rst-class:: classref-method
  1576. :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  1577. Returns the total number of available tablet drivers.
  1578. \ **Note:** This method is implemented on Windows.
  1579. .. rst-class:: classref-item-separator
  1580. ----
  1581. .. _class_DisplayServer_method_tablet_get_driver_name:
  1582. .. rst-class:: classref-method
  1583. :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1584. Returns the tablet driver name for the given index.
  1585. \ **Note:** This method is implemented on Windows.
  1586. .. rst-class:: classref-item-separator
  1587. ----
  1588. .. _class_DisplayServer_method_tablet_set_current_driver:
  1589. .. rst-class:: classref-method
  1590. void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  1591. Set active tablet driver name.
  1592. \ **Note:** This method is implemented on Windows.
  1593. .. rst-class:: classref-item-separator
  1594. ----
  1595. .. _class_DisplayServer_method_tts_get_voices:
  1596. .. rst-class:: classref-method
  1597. :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
  1598. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1599. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1600. - ``name`` is voice name.
  1601. - ``id`` is voice identifier.
  1602. - ``language`` is language code in ``lang_Variant`` format. ``lang`` part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And ``Variant`` part is an engine dependent string describing country, region or/and dialect.
  1603. Note that Godot depends on system libraries for text-to-speech functionality. These libraries are installed by default on Windows and MacOS, but not on all Linux distributions. If they are not present, this method will return an empty list. This applies to both Godot users on Linux, as well as end-users on Linux running Godot games that use text-to-speech.
  1604. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1605. .. rst-class:: classref-item-separator
  1606. ----
  1607. .. _class_DisplayServer_method_tts_get_voices_for_language:
  1608. .. rst-class:: classref-method
  1609. :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1610. Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
  1611. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1612. .. rst-class:: classref-item-separator
  1613. ----
  1614. .. _class_DisplayServer_method_tts_is_paused:
  1615. .. rst-class:: classref-method
  1616. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1617. Returns ``true`` if the synthesizer is in a paused state.
  1618. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1619. .. rst-class:: classref-item-separator
  1620. ----
  1621. .. _class_DisplayServer_method_tts_is_speaking:
  1622. .. rst-class:: classref-method
  1623. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1624. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1625. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1626. .. rst-class:: classref-item-separator
  1627. ----
  1628. .. _class_DisplayServer_method_tts_pause:
  1629. .. rst-class:: classref-method
  1630. void **tts_pause** **(** **)**
  1631. Puts the synthesizer into a paused state.
  1632. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1633. .. rst-class:: classref-item-separator
  1634. ----
  1635. .. _class_DisplayServer_method_tts_resume:
  1636. .. rst-class:: classref-method
  1637. void **tts_resume** **(** **)**
  1638. Resumes the synthesizer if it was paused.
  1639. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1640. .. rst-class:: classref-item-separator
  1641. ----
  1642. .. _class_DisplayServer_method_tts_set_utterance_callback:
  1643. .. rst-class:: classref-method
  1644. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
  1645. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1646. - :ref:`TTS_UTTERANCE_STARTED<class_DisplayServer_constant_TTS_UTTERANCE_STARTED>`, :ref:`TTS_UTTERANCE_ENDED<class_DisplayServer_constant_TTS_UTTERANCE_ENDED>`, and :ref:`TTS_UTTERANCE_CANCELED<class_DisplayServer_constant_TTS_UTTERANCE_CANCELED>` callable's method should take one :ref:`int<class_int>` parameter, the utterance ID.
  1647. - :ref:`TTS_UTTERANCE_BOUNDARY<class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY>` callable's method should take two :ref:`int<class_int>` parameters, the index of the character and the utterance ID.
  1648. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1649. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1650. .. rst-class:: classref-item-separator
  1651. ----
  1652. .. _class_DisplayServer_method_tts_speak:
  1653. .. rst-class:: classref-method
  1654. void **tts_speak** **(** :ref:`String<class_String>` text, :ref:`String<class_String>` voice, :ref:`int<class_int>` volume=50, :ref:`float<class_float>` pitch=1.0, :ref:`float<class_float>` rate=1.0, :ref:`int<class_int>` utterance_id=0, :ref:`bool<class_bool>` interrupt=false **)**
  1655. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1656. - ``voice`` identifier is one of the ``"id"`` values returned by :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` or one of the values returned by :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>`.
  1657. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1658. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1659. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1660. - ``utterance_id`` is passed as a parameter to the callback functions.
  1661. \ **Note:** On Windows and Linux (X11), utterance ``text`` can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling :ref:`tts_speak<class_DisplayServer_method_tts_speak>`.
  1662. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1663. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1664. .. rst-class:: classref-item-separator
  1665. ----
  1666. .. _class_DisplayServer_method_tts_stop:
  1667. .. rst-class:: classref-method
  1668. void **tts_stop** **(** **)**
  1669. Stops synthesis in progress and removes all utterances from the queue.
  1670. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1671. .. rst-class:: classref-item-separator
  1672. ----
  1673. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  1674. .. rst-class:: classref-method
  1675. :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  1676. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1677. .. rst-class:: classref-item-separator
  1678. ----
  1679. .. _class_DisplayServer_method_virtual_keyboard_hide:
  1680. .. rst-class:: classref-method
  1681. void **virtual_keyboard_hide** **(** **)**
  1682. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1683. .. rst-class:: classref-item-separator
  1684. ----
  1685. .. _class_DisplayServer_method_virtual_keyboard_show:
  1686. .. rst-class:: classref-method
  1687. void **virtual_keyboard_show** **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` type=0, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)**
  1688. Shows the virtual keyboard if the platform has one.
  1689. \ ``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).
  1690. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  1691. \ ``type`` parameter allows configuring which type of virtual keyboard to show.
  1692. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  1693. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  1694. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  1695. \ **Note:** This method is implemented on Android, iOS and Web.
  1696. .. rst-class:: classref-item-separator
  1697. ----
  1698. .. _class_DisplayServer_method_warp_mouse:
  1699. .. rst-class:: classref-method
  1700. void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1701. Sets the mouse cursor position to the given ``position`` relative to an origin at the upper left corner of the currently focused game Window Manager window.
  1702. \ **Note:** :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
  1703. .. rst-class:: classref-item-separator
  1704. ----
  1705. .. _class_DisplayServer_method_window_can_draw:
  1706. .. rst-class:: classref-method
  1707. :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1708. Returns ``true`` if anything can be drawn in the window specified by ``window_id``, ``false`` otherwise. Using the ``--disable-render-loop`` command line argument or a headless build will return ``false``.
  1709. .. rst-class:: classref-item-separator
  1710. ----
  1711. .. _class_DisplayServer_method_window_get_active_popup:
  1712. .. rst-class:: classref-method
  1713. :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  1714. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  1715. .. rst-class:: classref-item-separator
  1716. ----
  1717. .. _class_DisplayServer_method_window_get_attached_instance_id:
  1718. .. rst-class:: classref-method
  1719. :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1720. Returns the :ref:`Object.get_instance_id<class_Object_method_get_instance_id>` of the :ref:`Window<class_Window>` the ``window_id`` is attached to. also :ref:`window_get_attached_instance_id<class_DisplayServer_method_window_get_attached_instance_id>`.
  1721. .. rst-class:: classref-item-separator
  1722. ----
  1723. .. _class_DisplayServer_method_window_get_current_screen:
  1724. .. rst-class:: classref-method
  1725. :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1726. Returns the screen the window specified by ``window_id`` is currently positioned on. If the screen overlaps multiple displays, the screen where the window's center is located is returned. See also :ref:`window_set_current_screen<class_DisplayServer_method_window_set_current_screen>`.
  1727. .. rst-class:: classref-item-separator
  1728. ----
  1729. .. _class_DisplayServer_method_window_get_flag:
  1730. .. rst-class:: classref-method
  1731. :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  1732. Returns the current value of the given window's ``flag``.
  1733. .. rst-class:: classref-item-separator
  1734. ----
  1735. .. _class_DisplayServer_method_window_get_max_size:
  1736. .. rst-class:: classref-method
  1737. :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1738. Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>`.
  1739. .. rst-class:: classref-item-separator
  1740. ----
  1741. .. _class_DisplayServer_method_window_get_min_size:
  1742. .. rst-class:: classref-method
  1743. :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1744. Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>`.
  1745. .. rst-class:: classref-item-separator
  1746. ----
  1747. .. _class_DisplayServer_method_window_get_mode:
  1748. .. rst-class:: classref-method
  1749. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1750. Returns the mode of the given window.
  1751. .. rst-class:: classref-item-separator
  1752. ----
  1753. .. _class_DisplayServer_method_window_get_native_handle:
  1754. .. rst-class:: classref-method
  1755. :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  1756. Returns internal structure pointers for use in plugins.
  1757. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows.
  1758. .. rst-class:: classref-item-separator
  1759. ----
  1760. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  1761. .. rst-class:: classref-method
  1762. :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  1763. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  1764. .. rst-class:: classref-item-separator
  1765. ----
  1766. .. _class_DisplayServer_method_window_get_position:
  1767. .. rst-class:: classref-method
  1768. :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1769. Returns the position of the client area of the given window on the screen.
  1770. .. rst-class:: classref-item-separator
  1771. ----
  1772. .. _class_DisplayServer_method_window_get_position_with_decorations:
  1773. .. rst-class:: classref-method
  1774. :ref:`Vector2i<class_Vector2i>` **window_get_position_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1775. Returns the position of the given window on the screen including the borders drawn by the operating system. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>`.
  1776. .. rst-class:: classref-item-separator
  1777. ----
  1778. .. _class_DisplayServer_method_window_get_safe_title_margins:
  1779. .. rst-class:: classref-method
  1780. :ref:`Vector3i<class_Vector3i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1781. Returns left margins (``x``), right margins (``y``) and height (``z``) of the title that are safe to use (contains no buttons or other elements) when :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` flag is set.
  1782. .. rst-class:: classref-item-separator
  1783. ----
  1784. .. _class_DisplayServer_method_window_get_size:
  1785. .. rst-class:: classref-method
  1786. :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1787. Returns the size of the window specified by ``window_id`` (in pixels), excluding the borders drawn by the operating system. This is also called the "client area". See also :ref:`window_get_size_with_decorations<class_DisplayServer_method_window_get_size_with_decorations>`, :ref:`window_set_size<class_DisplayServer_method_window_set_size>` and :ref:`window_get_position<class_DisplayServer_method_window_get_position>`.
  1788. .. rst-class:: classref-item-separator
  1789. ----
  1790. .. _class_DisplayServer_method_window_get_size_with_decorations:
  1791. .. rst-class:: classref-method
  1792. :ref:`Vector2i<class_Vector2i>` **window_get_size_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1793. Returns the size of the window specified by ``window_id`` (in pixels), including the borders drawn by the operating system. See also :ref:`window_get_size<class_DisplayServer_method_window_get_size>`.
  1794. .. rst-class:: classref-item-separator
  1795. ----
  1796. .. _class_DisplayServer_method_window_get_vsync_mode:
  1797. .. rst-class:: classref-method
  1798. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1799. Returns the V-Sync mode of the given window.
  1800. .. rst-class:: classref-item-separator
  1801. ----
  1802. .. _class_DisplayServer_method_window_is_maximize_allowed:
  1803. .. rst-class:: classref-method
  1804. :ref:`bool<class_bool>` **window_is_maximize_allowed** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1805. Returns ``true`` if the given window can be maximized (the maximize button is enabled).
  1806. .. rst-class:: classref-item-separator
  1807. ----
  1808. .. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
  1809. .. rst-class:: classref-method
  1810. :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
  1811. Returns ``true``, if double-click on a window title should maximize it.
  1812. \ **Note:** This method is implemented on macOS.
  1813. .. rst-class:: classref-item-separator
  1814. ----
  1815. .. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
  1816. .. rst-class:: classref-method
  1817. :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
  1818. Returns ``true``, if double-click on a window title should minimize it.
  1819. \ **Note:** This method is implemented on macOS.
  1820. .. rst-class:: classref-item-separator
  1821. ----
  1822. .. _class_DisplayServer_method_window_move_to_foreground:
  1823. .. rst-class:: classref-method
  1824. void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  1825. Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows.
  1826. .. rst-class:: classref-item-separator
  1827. ----
  1828. .. _class_DisplayServer_method_window_request_attention:
  1829. .. rst-class:: classref-method
  1830. void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  1831. Makes the window specified by ``window_id`` request attention, which is materialized by the window title and taskbar entry blinking until the window is focused. This usually has no visible effect if the window is currently focused. The exact behavior varies depending on the operating system.
  1832. .. rst-class:: classref-item-separator
  1833. ----
  1834. .. _class_DisplayServer_method_window_set_current_screen:
  1835. .. rst-class:: classref-method
  1836. void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  1837. Moves the window specified by ``window_id`` to the specified ``screen``. See also :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>`.
  1838. .. rst-class:: classref-item-separator
  1839. ----
  1840. .. _class_DisplayServer_method_window_set_drop_files_callback:
  1841. .. rst-class:: classref-method
  1842. void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1843. Sets the ``callback`` that should be called when files are dropped from the operating system's file manager to the window specified by ``window_id``.
  1844. \ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web.
  1845. .. rst-class:: classref-item-separator
  1846. ----
  1847. .. _class_DisplayServer_method_window_set_exclusive:
  1848. .. rst-class:: classref-method
  1849. void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  1850. If set to ``true``, this window will always stay on top of its parent window, parent window will ignore input while this window is opened.
  1851. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  1852. \ **Note:** This method is implemented on macOS and Windows.
  1853. .. rst-class:: classref-item-separator
  1854. ----
  1855. .. _class_DisplayServer_method_window_set_flag:
  1856. .. rst-class:: classref-method
  1857. void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  1858. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  1859. .. rst-class:: classref-item-separator
  1860. ----
  1861. .. _class_DisplayServer_method_window_set_ime_active:
  1862. .. rst-class:: classref-method
  1863. void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  1864. Sets whether `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ should be enabled for the window specified by ``window_id``. See also :ref:`window_set_ime_position<class_DisplayServer_method_window_set_ime_position>`.
  1865. .. rst-class:: classref-item-separator
  1866. ----
  1867. .. _class_DisplayServer_method_window_set_ime_position:
  1868. .. rst-class:: classref-method
  1869. void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1870. Sets the position of the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ popup for the specified ``window_id``. Only effective if :ref:`window_set_ime_active<class_DisplayServer_method_window_set_ime_active>` was set to ``true`` for the specified ``window_id``.
  1871. .. rst-class:: classref-item-separator
  1872. ----
  1873. .. _class_DisplayServer_method_window_set_input_event_callback:
  1874. .. rst-class:: classref-method
  1875. void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1876. Sets the ``callback`` that should be called when any :ref:`InputEvent<class_InputEvent>` is sent to the window specified by ``window_id``.
  1877. .. rst-class:: classref-item-separator
  1878. ----
  1879. .. _class_DisplayServer_method_window_set_input_text_callback:
  1880. .. rst-class:: classref-method
  1881. void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1882. Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``.
  1883. .. rst-class:: classref-item-separator
  1884. ----
  1885. .. _class_DisplayServer_method_window_set_max_size:
  1886. .. rst-class:: classref-method
  1887. void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  1888. Sets the maximum size of the window specified by ``window_id`` in pixels. Normally, the user will not be able to drag the window to make it smaller than the specified size. See also :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>`.
  1889. \ **Note:** It's recommended to change this value using :ref:`Window.max_size<class_Window_property_max_size>` instead.
  1890. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1891. .. rst-class:: classref-item-separator
  1892. ----
  1893. .. _class_DisplayServer_method_window_set_min_size:
  1894. .. rst-class:: classref-method
  1895. void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  1896. Sets the minimum size for the given window to ``min_size`` (in pixels). Normally, the user will not be able to drag the window to make it larger than the specified size. See also :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>`.
  1897. \ **Note:** It's recommended to change this value using :ref:`Window.min_size<class_Window_property_min_size>` instead.
  1898. \ **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.
  1899. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1900. .. rst-class:: classref-item-separator
  1901. ----
  1902. .. _class_DisplayServer_method_window_set_mode:
  1903. .. rst-class:: classref-method
  1904. void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  1905. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  1906. \ **Note:** Setting the window to full screen forcibly sets the borderless flag to ``true``, so make sure to set it back to ``false`` when not wanted.
  1907. .. rst-class:: classref-item-separator
  1908. ----
  1909. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  1910. .. rst-class:: classref-method
  1911. void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  1912. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  1913. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  1914. .. tabs::
  1915. .. code-tab:: gdscript
  1916. # Set region, using Path2D node.
  1917. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  1918. # Set region, using Polygon2D node.
  1919. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  1920. # Reset region to default.
  1921. DisplayServer.window_set_mouse_passthrough([])
  1922. .. code-tab:: csharp
  1923. // Set region, using Path2D node.
  1924. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  1925. // Set region, using Polygon2D node.
  1926. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  1927. // Reset region to default.
  1928. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  1929. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  1930. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1931. .. rst-class:: classref-item-separator
  1932. ----
  1933. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  1934. .. rst-class:: classref-method
  1935. void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  1936. Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup.
  1937. .. rst-class:: classref-item-separator
  1938. ----
  1939. .. _class_DisplayServer_method_window_set_position:
  1940. .. rst-class:: classref-method
  1941. void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1942. Sets the position of the given window to ``position``. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
  1943. ::
  1944. * (0, 0) +-------+
  1945. | |
  1946. +-------------+ | |
  1947. | | | |
  1948. | | | |
  1949. +-------------+ +-------+
  1950. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>` and :ref:`window_set_size<class_DisplayServer_method_window_set_size>`.
  1951. \ **Note:** It's recommended to change this value using :ref:`Window.position<class_Window_property_position>` instead.
  1952. .. rst-class:: classref-item-separator
  1953. ----
  1954. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  1955. .. rst-class:: classref-method
  1956. void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1957. Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized.
  1958. .. rst-class:: classref-item-separator
  1959. ----
  1960. .. _class_DisplayServer_method_window_set_size:
  1961. .. rst-class:: classref-method
  1962. void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  1963. Sets the size of the given window to ``size`` (in pixels). See also :ref:`window_get_size<class_DisplayServer_method_window_get_size>` and :ref:`window_get_position<class_DisplayServer_method_window_get_position>`.
  1964. \ **Note:** It's recommended to change this value using :ref:`Window.size<class_Window_property_size>` instead.
  1965. .. rst-class:: classref-item-separator
  1966. ----
  1967. .. _class_DisplayServer_method_window_set_title:
  1968. .. rst-class:: classref-method
  1969. void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  1970. Sets the title of the given window to ``title``.
  1971. \ **Note:** It's recommended to change this value using :ref:`Window.title<class_Window_property_title>` instead.
  1972. \ **Note:** Avoid changing the window title every frame, as this can cause performance issues on certain window managers. Try to change the window title only a few times per second at most.
  1973. .. rst-class:: classref-item-separator
  1974. ----
  1975. .. _class_DisplayServer_method_window_set_transient:
  1976. .. rst-class:: classref-method
  1977. void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  1978. Sets window transient parent. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
  1979. \ **Note:** It's recommended to change this value using :ref:`Window.transient<class_Window_property_transient>` instead.
  1980. \ **Note:** The behavior might be different depending on the platform.
  1981. .. rst-class:: classref-item-separator
  1982. ----
  1983. .. _class_DisplayServer_method_window_set_vsync_mode:
  1984. .. rst-class:: classref-method
  1985. void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  1986. Sets the V-Sync mode of the given window. See also :ref:`ProjectSettings.display/window/vsync/vsync_mode<class_ProjectSettings_property_display/window/vsync/vsync_mode>`.
  1987. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  1988. 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.
  1989. \ **Note:** V-Sync modes other than :ref:`VSYNC_ENABLED<class_DisplayServer_constant_VSYNC_ENABLED>` are only supported in the Forward+ and Mobile rendering methods, not Compatibility.
  1990. .. rst-class:: classref-item-separator
  1991. ----
  1992. .. _class_DisplayServer_method_window_set_window_buttons_offset:
  1993. .. rst-class:: classref-method
  1994. void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
  1995. When :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` flag is set, set offset to the center of the first titlebar button.
  1996. \ **Note:** This flag is implemented on macOS.
  1997. .. rst-class:: classref-item-separator
  1998. ----
  1999. .. _class_DisplayServer_method_window_set_window_event_callback:
  2000. .. rst-class:: classref-method
  2001. void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2002. Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``.
  2003. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2004. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2005. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2006. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2007. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2008. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`