class_displayserver.rst 289 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/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:`int<class_int>` | :ref:`get_keyboard_focus_screen<class_DisplayServer_method_get_keyboard_focus_screen>` **(** **)** |const| |
  53. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
  55. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_primary_screen<class_DisplayServer_method_get_primary_screen>` **(** **)** |const| |
  57. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
  59. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_screen_from_rect<class_DisplayServer_method_get_screen_from_rect>` **(** :ref:`Rect2<class_Rect2>` rect **)** |const| |
  61. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
  63. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  65. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
  67. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :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 **)** |
  69. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :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 **)** |
  71. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :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 **)** |
  73. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :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 **)** |
  75. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :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 **)** |
  77. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :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 **)** |
  79. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :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 **)** |
  81. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :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 **)** |
  83. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :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 **)** |
  85. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
  87. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :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| |
  89. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :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| |
  91. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :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| |
  93. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :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| |
  95. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :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| |
  97. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :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| |
  99. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :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| |
  101. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :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| |
  103. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :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| |
  105. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :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| |
  107. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :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| |
  109. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :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| |
  111. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :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| |
  113. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :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| |
  115. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :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| |
  117. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :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| |
  119. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :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| |
  121. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :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| |
  123. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  125. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | 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 **)** |
  127. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | 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 **)** |
  129. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | 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 **)** |
  131. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | 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 **)** |
  133. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | 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 **)** |
  135. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | 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 **)** |
  137. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | 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 **)** |
  139. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | 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 **)** |
  141. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | 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 **)** |
  143. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | 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 **)** |
  145. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | 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 **)** |
  147. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | 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 **)** |
  149. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | 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 **)** |
  151. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | 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 **)** |
  153. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | 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 **)** |
  155. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  157. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  159. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  161. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
  163. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
  165. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_touchscreen_available<class_DisplayServer_method_is_touchscreen_available>` **(** **)** |const| |
  167. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  169. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :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| |
  171. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  173. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  175. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  177. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  179. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  181. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  183. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  185. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  187. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  189. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  191. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Image<class_Image>` | :ref:`screen_get_image<class_DisplayServer_method_screen_get_image>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  193. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  195. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  197. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`Color<class_Color>` | :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  199. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  201. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  203. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  205. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  207. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  209. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  211. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  213. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  215. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  217. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  219. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  221. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  223. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  225. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  227. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
  229. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  231. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
  233. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
  235. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
  237. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
  239. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
  241. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | 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 **)** |
  243. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
  245. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  247. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  249. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | 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 **)** |
  251. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  253. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  255. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  257. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :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| |
  259. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  261. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :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| |
  263. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  265. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  267. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  269. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :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| |
  271. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  273. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  275. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :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| |
  277. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :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| |
  279. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  281. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :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| |
  283. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :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| |
  285. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :ref:`bool<class_bool>` | :ref:`window_is_maximize_allowed<class_DisplayServer_method_window_is_maximize_allowed>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  287. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
  289. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
  291. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  293. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  295. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | 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 **)** |
  297. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | 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 **)** |
  299. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  301. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | 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 **)** |
  303. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | 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 **)** |
  305. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | 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 **)** |
  307. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | 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 **)** |
  309. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | 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 **)** |
  311. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | 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 **)** |
  313. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | 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 **)** |
  315. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  317. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | 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 **)** |
  319. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | 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 **)** |
  321. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  323. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | 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 **)** |
  325. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  327. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  329. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  331. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | 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 **)** |
  333. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | 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 **)** |
  335. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | 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 **)** |
  337. +----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. .. rst-class:: classref-section-separator
  339. ----
  340. .. rst-class:: classref-descriptions-group
  341. Enumerations
  342. ------------
  343. .. _enum_DisplayServer_Feature:
  344. .. rst-class:: classref-enumeration
  345. enum **Feature**:
  346. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  347. .. rst-class:: classref-enumeration-constant
  348. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
  349. Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
  350. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  351. .. rst-class:: classref-enumeration-constant
  352. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SUBWINDOWS** = ``1``
  353. Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)**
  354. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  355. .. rst-class:: classref-enumeration-constant
  356. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TOUCHSCREEN** = ``2``
  357. Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web**
  358. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  359. .. rst-class:: classref-enumeration-constant
  360. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE** = ``3``
  361. Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web**
  362. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  363. .. rst-class:: classref-enumeration-constant
  364. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE_WARP** = ``4``
  365. 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)**
  366. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  367. .. rst-class:: classref-enumeration-constant
  368. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD** = ``5``
  369. 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**
  370. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  371. .. rst-class:: classref-enumeration-constant
  372. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_VIRTUAL_KEYBOARD** = ``6``
  373. Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web**
  374. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  375. .. rst-class:: classref-enumeration-constant
  376. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CURSOR_SHAPE** = ``7``
  377. Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web**
  378. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  379. .. rst-class:: classref-enumeration-constant
  380. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8``
  381. Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web**
  382. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  383. .. rst-class:: classref-enumeration-constant
  384. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_DIALOG** = ``9``
  385. Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS**
  386. .. _class_DisplayServer_constant_FEATURE_IME:
  387. .. rst-class:: classref-enumeration-constant
  388. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_IME** = ``10``
  389. 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)**
  390. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  391. .. rst-class:: classref-enumeration-constant
  392. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_WINDOW_TRANSPARENCY** = ``11``
  393. Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)**
  394. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  395. .. rst-class:: classref-enumeration-constant
  396. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_HIDPI** = ``12``
  397. 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**
  398. .. _class_DisplayServer_constant_FEATURE_ICON:
  399. .. rst-class:: classref-enumeration-constant
  400. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ICON** = ``13``
  401. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)**
  402. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  403. .. rst-class:: classref-enumeration-constant
  404. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_ICON** = ``14``
  405. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS**
  406. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  407. .. rst-class:: classref-enumeration-constant
  408. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ORIENTATION** = ``15``
  409. Display server supports changing the screen orientation. **Android, iOS**
  410. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  411. .. rst-class:: classref-enumeration-constant
  412. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SWAP_BUFFERS** = ``16``
  413. 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)**
  414. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  415. .. rst-class:: classref-enumeration-constant
  416. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD_PRIMARY** = ``18``
  417. Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD<class_DisplayServer_constant_FEATURE_CLIPBOARD>`. **Linux (X11)**
  418. .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
  419. .. rst-class:: classref-enumeration-constant
  420. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TEXT_TO_SPEECH** = ``19``
  421. Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web**
  422. .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
  423. .. rst-class:: classref-enumeration-constant
  424. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_EXTEND_TO_TITLE** = ``20``
  425. 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**
  426. .. _class_DisplayServer_constant_FEATURE_SCREEN_CAPTURE:
  427. .. rst-class:: classref-enumeration-constant
  428. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SCREEN_CAPTURE** = ``21``
  429. Display server supports reading screen pixels. See :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>`.
  430. .. rst-class:: classref-item-separator
  431. ----
  432. .. _enum_DisplayServer_MouseMode:
  433. .. rst-class:: classref-enumeration
  434. enum **MouseMode**:
  435. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  436. .. rst-class:: classref-enumeration-constant
  437. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_VISIBLE** = ``0``
  438. Makes the mouse cursor visible if it is hidden.
  439. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  440. .. rst-class:: classref-enumeration-constant
  441. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_HIDDEN** = ``1``
  442. Makes the mouse cursor hidden if it is visible.
  443. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  444. .. rst-class:: classref-enumeration-constant
  445. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CAPTURED** = ``2``
  446. Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
  447. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  448. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  449. .. rst-class:: classref-enumeration-constant
  450. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED** = ``3``
  451. Confines the mouse cursor to the game window, and make it visible.
  452. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  453. .. rst-class:: classref-enumeration-constant
  454. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED_HIDDEN** = ``4``
  455. Confines the mouse cursor to the game window, and make it hidden.
  456. .. rst-class:: classref-item-separator
  457. ----
  458. .. _enum_DisplayServer_ScreenOrientation:
  459. .. rst-class:: classref-enumeration
  460. enum **ScreenOrientation**:
  461. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  462. .. rst-class:: classref-enumeration-constant
  463. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_LANDSCAPE** = ``0``
  464. Default landscape orientation.
  465. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_PORTRAIT** = ``1``
  468. Default portrait orientation.
  469. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  470. .. rst-class:: classref-enumeration-constant
  471. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_LANDSCAPE** = ``2``
  472. Reverse landscape orientation (upside down).
  473. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  474. .. rst-class:: classref-enumeration-constant
  475. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_PORTRAIT** = ``3``
  476. Reverse portrait orientation (upside down).
  477. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  478. .. rst-class:: classref-enumeration-constant
  479. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_LANDSCAPE** = ``4``
  480. Automatic landscape orientation (default or reverse depending on sensor).
  481. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  482. .. rst-class:: classref-enumeration-constant
  483. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_PORTRAIT** = ``5``
  484. Automatic portrait orientation (default or reverse depending on sensor).
  485. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  486. .. rst-class:: classref-enumeration-constant
  487. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR** = ``6``
  488. Automatic landscape or portrait orientation (default or reverse depending on sensor).
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _enum_DisplayServer_VirtualKeyboardType:
  492. .. rst-class:: classref-enumeration
  493. enum **VirtualKeyboardType**:
  494. .. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
  495. .. rst-class:: classref-enumeration-constant
  496. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  497. Default text virtual keyboard.
  498. .. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
  499. .. rst-class:: classref-enumeration-constant
  500. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  501. Multiline virtual keyboard.
  502. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
  503. .. rst-class:: classref-enumeration-constant
  504. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  505. Virtual number keypad, useful for PIN entry.
  506. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  507. .. rst-class:: classref-enumeration-constant
  508. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  509. Virtual number keypad, useful for entering fractional numbers.
  510. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
  511. .. rst-class:: classref-enumeration-constant
  512. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  513. Virtual phone number keypad.
  514. .. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  515. .. rst-class:: classref-enumeration-constant
  516. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  517. Virtual keyboard with additional keys to assist with typing email addresses.
  518. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
  519. .. rst-class:: classref-enumeration-constant
  520. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  521. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  522. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
  523. .. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
  524. .. rst-class:: classref-enumeration-constant
  525. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  526. Virtual keyboard with additional keys to assist with typing URLs.
  527. .. rst-class:: classref-item-separator
  528. ----
  529. .. _enum_DisplayServer_CursorShape:
  530. .. rst-class:: classref-enumeration
  531. enum **CursorShape**:
  532. .. _class_DisplayServer_constant_CURSOR_ARROW:
  533. .. rst-class:: classref-enumeration-constant
  534. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_ARROW** = ``0``
  535. 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>`.
  536. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  537. .. rst-class:: classref-enumeration-constant
  538. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_IBEAM** = ``1``
  539. 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>`.
  540. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  541. .. rst-class:: classref-enumeration-constant
  542. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  543. 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>`.
  544. .. _class_DisplayServer_constant_CURSOR_CROSS:
  545. .. rst-class:: classref-enumeration-constant
  546. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CROSS** = ``3``
  547. 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.
  548. .. _class_DisplayServer_constant_CURSOR_WAIT:
  549. .. rst-class:: classref-enumeration-constant
  550. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_WAIT** = ``4``
  551. 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>`.
  552. .. _class_DisplayServer_constant_CURSOR_BUSY:
  553. .. rst-class:: classref-enumeration-constant
  554. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BUSY** = ``5``
  555. 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>`.
  556. .. _class_DisplayServer_constant_CURSOR_DRAG:
  557. .. rst-class:: classref-enumeration-constant
  558. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_DRAG** = ``6``
  559. Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP<class_DisplayServer_constant_CURSOR_CAN_DROP>`.
  560. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  561. .. rst-class:: classref-enumeration-constant
  562. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  563. "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>`.
  564. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  565. .. rst-class:: classref-enumeration-constant
  566. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  567. 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.
  568. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  569. .. rst-class:: classref-enumeration-constant
  570. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSIZE** = ``9``
  571. 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>`.
  572. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  573. .. rst-class:: classref-enumeration-constant
  574. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSIZE** = ``10``
  575. 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>`.
  576. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  577. .. rst-class:: classref-enumeration-constant
  578. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  579. 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.
  580. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  581. .. rst-class:: classref-enumeration-constant
  582. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  583. 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.
  584. .. _class_DisplayServer_constant_CURSOR_MOVE:
  585. .. rst-class:: classref-enumeration-constant
  586. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MOVE** = ``13``
  587. Move cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be moved using the mouse.
  588. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  589. .. rst-class:: classref-enumeration-constant
  590. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSPLIT** = ``14``
  591. 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>`.
  592. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  593. .. rst-class:: classref-enumeration-constant
  594. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSPLIT** = ``15``
  595. 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>`.
  596. .. _class_DisplayServer_constant_CURSOR_HELP:
  597. .. rst-class:: classref-enumeration-constant
  598. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HELP** = ``16``
  599. 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.
  600. .. _class_DisplayServer_constant_CURSOR_MAX:
  601. .. rst-class:: classref-enumeration-constant
  602. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MAX** = ``17``
  603. Represents the size of the :ref:`CursorShape<enum_DisplayServer_CursorShape>` enum.
  604. .. rst-class:: classref-item-separator
  605. ----
  606. .. _enum_DisplayServer_WindowMode:
  607. .. rst-class:: classref-enumeration
  608. enum **WindowMode**:
  609. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  610. .. rst-class:: classref-enumeration-constant
  611. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_WINDOWED** = ``0``
  612. Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
  613. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  614. .. rst-class:: classref-enumeration-constant
  615. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MINIMIZED** = ``1``
  616. 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.
  617. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  618. .. rst-class:: classref-enumeration-constant
  619. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MAXIMIZED** = ``2``
  620. 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.
  621. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  622. .. rst-class:: classref-enumeration-constant
  623. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_FULLSCREEN** = ``3``
  624. Full screen mode with full multi-window support.
  625. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  626. \ **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.
  627. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  628. .. rst-class:: classref-enumeration-constant
  629. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  630. 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).
  631. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  632. \ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
  633. \ **On macOS:** Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
  634. \ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
  635. \ **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.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _enum_DisplayServer_WindowFlags:
  639. .. rst-class:: classref-enumeration
  640. enum **WindowFlags**:
  641. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  642. .. rst-class:: classref-enumeration-constant
  643. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_RESIZE_DISABLED** = ``0``
  644. 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.
  645. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  646. .. rst-class:: classref-enumeration-constant
  647. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_BORDERLESS** = ``1``
  648. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  649. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  650. .. rst-class:: classref-enumeration-constant
  651. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_ALWAYS_ON_TOP** = ``2``
  652. The window is floating on top of all other windows. This flag is ignored for full-screen windows.
  653. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  654. .. rst-class:: classref-enumeration-constant
  655. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_TRANSPARENT** = ``3``
  656. The window background can be transparent.
  657. \ **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``.
  658. \ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  659. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  660. .. rst-class:: classref-enumeration-constant
  661. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_NO_FOCUS** = ``4``
  662. The window can't be focused. No-focus window will ignore all input, except mouse clicks.
  663. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  664. .. rst-class:: classref-enumeration-constant
  665. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_POPUP** = ``5``
  666. 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>`).
  667. .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
  668. .. rst-class:: classref-enumeration-constant
  669. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_EXTEND_TO_TITLE** = ``6``
  670. 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.
  671. Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
  672. 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.
  673. \ **Note:** This flag is implemented only on macOS.
  674. .. _class_DisplayServer_constant_WINDOW_FLAG_MOUSE_PASSTHROUGH:
  675. .. rst-class:: classref-enumeration-constant
  676. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MOUSE_PASSTHROUGH** = ``7``
  677. All mouse events are passed to the underlying window of the same application.
  678. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  679. .. rst-class:: classref-enumeration-constant
  680. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MAX** = ``8``
  681. Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
  682. .. rst-class:: classref-item-separator
  683. ----
  684. .. _enum_DisplayServer_WindowEvent:
  685. .. rst-class:: classref-enumeration
  686. enum **WindowEvent**:
  687. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  688. .. rst-class:: classref-enumeration-constant
  689. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_ENTER** = ``0``
  690. Sent when the mouse pointer enters the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  691. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  692. .. rst-class:: classref-enumeration-constant
  693. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_EXIT** = ``1``
  694. Sent when the mouse pointer exits the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  695. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  696. .. rst-class:: classref-enumeration-constant
  697. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_IN** = ``2``
  698. Sent when the window grabs focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  699. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  700. .. rst-class:: classref-enumeration-constant
  701. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_OUT** = ``3``
  702. Sent when the window loses focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  703. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  704. .. rst-class:: classref-enumeration-constant
  705. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_CLOSE_REQUEST** = ``4``
  706. 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>`.
  707. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  708. .. rst-class:: classref-enumeration-constant
  709. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_GO_BACK_REQUEST** = ``5``
  710. Sent when the device "Back" button is pressed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  711. \ **Note:** This event is implemented only on Android.
  712. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  713. .. rst-class:: classref-enumeration-constant
  714. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_DPI_CHANGE** = ``6``
  715. 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>`.
  716. \ **Note:** This flag is implemented only on macOS.
  717. .. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
  718. .. rst-class:: classref-enumeration-constant
  719. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_TITLEBAR_CHANGE** = ``7``
  720. 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>`.
  721. \ **Note:** This flag is implemented only on macOS.
  722. .. rst-class:: classref-item-separator
  723. ----
  724. .. _enum_DisplayServer_VSyncMode:
  725. .. rst-class:: classref-enumeration
  726. enum **VSyncMode**:
  727. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  728. .. rst-class:: classref-enumeration-constant
  729. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_DISABLED** = ``0``
  730. 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>`).
  731. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  732. .. rst-class:: classref-enumeration-constant
  733. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ENABLED** = ``1``
  734. 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>`).
  735. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  736. .. rst-class:: classref-enumeration-constant
  737. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ADAPTIVE** = ``2``
  738. 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.
  739. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  740. .. rst-class:: classref-enumeration-constant
  741. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_MAILBOX** = ``3``
  742. 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>`).
  743. 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.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _enum_DisplayServer_HandleType:
  747. .. rst-class:: classref-enumeration
  748. enum **HandleType**:
  749. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  750. .. rst-class:: classref-enumeration-constant
  751. :ref:`HandleType<enum_DisplayServer_HandleType>` **DISPLAY_HANDLE** = ``0``
  752. Display handle:
  753. - Linux (X11): ``X11::Display*`` for the display.
  754. - Android: ``EGLDisplay`` for the display.
  755. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  756. .. rst-class:: classref-enumeration-constant
  757. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_HANDLE** = ``1``
  758. Window handle:
  759. - Windows: ``HWND`` for the window.
  760. - Linux (X11): ``X11::Window*`` for the window.
  761. - macOS: ``NSWindow*`` for the window.
  762. - iOS: ``UIViewController*`` for the view controller.
  763. - Android: ``jObject`` for the activity.
  764. .. _class_DisplayServer_constant_WINDOW_VIEW:
  765. .. rst-class:: classref-enumeration-constant
  766. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_VIEW** = ``2``
  767. Window view:
  768. - Windows: ``HDC`` for the window (only with the GL Compatibility renderer).
  769. - macOS: ``NSView*`` for the window main view.
  770. - iOS: ``UIView*`` for the window main view.
  771. .. _class_DisplayServer_constant_OPENGL_CONTEXT:
  772. .. rst-class:: classref-enumeration-constant
  773. :ref:`HandleType<enum_DisplayServer_HandleType>` **OPENGL_CONTEXT** = ``3``
  774. OpenGL context (only with the GL Compatibility renderer):
  775. - Windows: ``HGLRC`` for the window.
  776. - Linux: ``GLXContext*`` for the window.
  777. - macOS: ``NSOpenGLContext*`` for the window.
  778. - Android: ``EGLContext`` for the window.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _enum_DisplayServer_TTSUtteranceEvent:
  782. .. rst-class:: classref-enumeration
  783. enum **TTSUtteranceEvent**:
  784. .. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
  785. .. rst-class:: classref-enumeration-constant
  786. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  787. Utterance has begun to be spoken.
  788. .. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
  789. .. rst-class:: classref-enumeration-constant
  790. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  791. Utterance was successfully finished.
  792. .. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
  793. .. rst-class:: classref-enumeration-constant
  794. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  795. Utterance was canceled, or TTS service was unable to process it.
  796. .. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
  797. .. rst-class:: classref-enumeration-constant
  798. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  799. Utterance reached a word or sentence boundary.
  800. .. rst-class:: classref-section-separator
  801. ----
  802. .. rst-class:: classref-descriptions-group
  803. Constants
  804. ---------
  805. .. _class_DisplayServer_constant_SCREEN_WITH_MOUSE_FOCUS:
  806. .. rst-class:: classref-constant
  807. **SCREEN_WITH_MOUSE_FOCUS** = ``-4``
  808. Represents the screen containing the mouse pointer.
  809. .. _class_DisplayServer_constant_SCREEN_WITH_KEYBOARD_FOCUS:
  810. .. rst-class:: classref-constant
  811. **SCREEN_WITH_KEYBOARD_FOCUS** = ``-3``
  812. Represents the screen containing the window with the keyboard focus.
  813. .. _class_DisplayServer_constant_SCREEN_PRIMARY:
  814. .. rst-class:: classref-constant
  815. **SCREEN_PRIMARY** = ``-2``
  816. Represents the primary screen.
  817. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  818. .. rst-class:: classref-constant
  819. **SCREEN_OF_MAIN_WINDOW** = ``-1``
  820. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
  821. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  822. .. rst-class:: classref-constant
  823. **MAIN_WINDOW_ID** = ``0``
  824. The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``.
  825. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  826. .. rst-class:: classref-constant
  827. **INVALID_WINDOW_ID** = ``-1``
  828. The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result.
  829. .. rst-class:: classref-section-separator
  830. ----
  831. .. rst-class:: classref-descriptions-group
  832. Method Descriptions
  833. -------------------
  834. .. _class_DisplayServer_method_clipboard_get:
  835. .. rst-class:: classref-method
  836. :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  837. Returns the user's clipboard as a string if possible.
  838. .. rst-class:: classref-item-separator
  839. ----
  840. .. _class_DisplayServer_method_clipboard_get_primary:
  841. .. rst-class:: classref-method
  842. :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  843. 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.
  844. \ **Note:** This method is only implemented on Linux (X11).
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_DisplayServer_method_clipboard_has:
  848. .. rst-class:: classref-method
  849. :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  850. Returns ``true`` if there is content on the user's clipboard.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_DisplayServer_method_clipboard_set:
  854. .. rst-class:: classref-method
  855. void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  856. Sets the user's clipboard content to the given string.
  857. .. rst-class:: classref-item-separator
  858. ----
  859. .. _class_DisplayServer_method_clipboard_set_primary:
  860. .. rst-class:: classref-method
  861. void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  862. 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.
  863. \ **Note:** This method is only implemented on Linux (X11).
  864. .. rst-class:: classref-item-separator
  865. ----
  866. .. _class_DisplayServer_method_cursor_get_shape:
  867. .. rst-class:: classref-method
  868. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  869. Returns the default mouse cursor shape set by :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  870. .. rst-class:: classref-item-separator
  871. ----
  872. .. _class_DisplayServer_method_cursor_set_custom_image:
  873. .. rst-class:: classref-method
  874. 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) **)**
  875. 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>`.
  876. .. rst-class:: classref-item-separator
  877. ----
  878. .. _class_DisplayServer_method_cursor_set_shape:
  879. .. rst-class:: classref-method
  880. void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  881. 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>`.
  882. .. rst-class:: classref-item-separator
  883. ----
  884. .. _class_DisplayServer_method_dialog_input_text:
  885. .. rst-class:: classref-method
  886. :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 **)**
  887. 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.
  888. \ **Note:** This method is implemented only on macOS.
  889. .. rst-class:: classref-item-separator
  890. ----
  891. .. _class_DisplayServer_method_dialog_show:
  892. .. rst-class:: classref-method
  893. :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 **)**
  894. 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.
  895. \ **Note:** This method is implemented only on macOS.
  896. .. rst-class:: classref-item-separator
  897. ----
  898. .. _class_DisplayServer_method_enable_for_stealing_focus:
  899. .. rst-class:: classref-method
  900. void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  901. 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.
  902. \ **Note:** This method is implemented only on Windows.
  903. .. rst-class:: classref-item-separator
  904. ----
  905. .. _class_DisplayServer_method_force_process_and_drop_events:
  906. .. rst-class:: classref-method
  907. void **force_process_and_drop_events** **(** **)**
  908. Forces window manager processing while ignoring all :ref:`InputEvent<class_InputEvent>`\ s. See also :ref:`process_events<class_DisplayServer_method_process_events>`.
  909. \ **Note:** This method is implemented on Windows and macOS.
  910. .. rst-class:: classref-item-separator
  911. ----
  912. .. _class_DisplayServer_method_get_accent_color:
  913. .. rst-class:: classref-method
  914. :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
  915. Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
  916. \ **Note:** This method is implemented on macOS and Windows.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_DisplayServer_method_get_display_cutouts:
  920. .. rst-class:: classref-method
  921. :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
  922. 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>`.
  923. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  924. .. rst-class:: classref-item-separator
  925. ----
  926. .. _class_DisplayServer_method_get_display_safe_area:
  927. .. rst-class:: classref-method
  928. :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
  929. 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>`.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_DisplayServer_method_get_keyboard_focus_screen:
  933. .. rst-class:: classref-method
  934. :ref:`int<class_int>` **get_keyboard_focus_screen** **(** **)** |const|
  935. Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_DisplayServer_method_get_name:
  939. .. rst-class:: classref-method
  940. :ref:`String<class_String>` **get_name** **(** **)** |const|
  941. 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).
  942. 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>`).
  943. .. rst-class:: classref-item-separator
  944. ----
  945. .. _class_DisplayServer_method_get_primary_screen:
  946. .. rst-class:: classref-method
  947. :ref:`int<class_int>` **get_primary_screen** **(** **)** |const|
  948. Returns index of the primary screen.
  949. .. rst-class:: classref-item-separator
  950. ----
  951. .. _class_DisplayServer_method_get_screen_count:
  952. .. rst-class:: classref-method
  953. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  954. Returns the number of displays available.
  955. .. rst-class:: classref-item-separator
  956. ----
  957. .. _class_DisplayServer_method_get_screen_from_rect:
  958. .. rst-class:: classref-method
  959. :ref:`int<class_int>` **get_screen_from_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |const|
  960. Returns index of the screen which contains specified rectangle.
  961. .. rst-class:: classref-item-separator
  962. ----
  963. .. _class_DisplayServer_method_get_swap_cancel_ok:
  964. .. rst-class:: classref-method
  965. :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  966. 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>`.
  967. \ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show<class_DisplayServer_method_dialog_show>`.
  968. .. rst-class:: classref-item-separator
  969. ----
  970. .. _class_DisplayServer_method_get_window_at_screen_position:
  971. .. rst-class:: classref-method
  972. :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  973. 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:
  974. ::
  975. * (0, 0) +-------+
  976. | |
  977. +-------------+ | |
  978. | | | |
  979. | | | |
  980. +-------------+ +-------+
  981. .. rst-class:: classref-item-separator
  982. ----
  983. .. _class_DisplayServer_method_get_window_list:
  984. .. rst-class:: classref-method
  985. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  986. Returns the list of Godot window IDs belonging to this process.
  987. \ **Note:** Native dialogs are not included in this list.
  988. .. rst-class:: classref-item-separator
  989. ----
  990. .. _class_DisplayServer_method_global_menu_add_check_item:
  991. .. rst-class:: classref-method
  992. :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 **)**
  993. Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
  994. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  995. 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`).
  996. \ **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``.
  997. \ **Note:** This method is implemented only on macOS.
  998. \ **Supported system menu IDs:**\
  999. ::
  1000. "_main" - Main menu (macOS).
  1001. "_dock" - Dock popup menu (macOS).
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_DisplayServer_method_global_menu_add_icon_check_item:
  1005. .. rst-class:: classref-method
  1006. :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 **)**
  1007. Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1008. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1009. 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`).
  1010. \ **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``.
  1011. \ **Note:** This method is implemented only on macOS.
  1012. \ **Supported system menu IDs:**\
  1013. ::
  1014. "_main" - Main menu (macOS).
  1015. "_dock" - Dock popup menu (macOS).
  1016. .. rst-class:: classref-item-separator
  1017. ----
  1018. .. _class_DisplayServer_method_global_menu_add_icon_item:
  1019. .. rst-class:: classref-method
  1020. :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 **)**
  1021. Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1022. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1023. 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`).
  1024. \ **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``.
  1025. \ **Note:** This method is implemented only on macOS.
  1026. \ **Supported system menu IDs:**\
  1027. ::
  1028. "_main" - Main menu (macOS).
  1029. "_dock" - Dock popup menu (macOS).
  1030. .. rst-class:: classref-item-separator
  1031. ----
  1032. .. _class_DisplayServer_method_global_menu_add_icon_radio_check_item:
  1033. .. rst-class:: classref-method
  1034. :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 **)**
  1035. Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1036. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1037. 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`).
  1038. \ **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.
  1039. \ **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``.
  1040. \ **Note:** This method is implemented only on macOS.
  1041. \ **Supported system menu IDs:**\
  1042. ::
  1043. "_main" - Main menu (macOS).
  1044. "_dock" - Dock popup menu (macOS).
  1045. .. rst-class:: classref-item-separator
  1046. ----
  1047. .. _class_DisplayServer_method_global_menu_add_item:
  1048. .. rst-class:: classref-method
  1049. :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 **)**
  1050. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1051. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1052. 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`).
  1053. \ **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``.
  1054. \ **Note:** This method is implemented only on macOS.
  1055. \ **Supported system menu IDs:**\
  1056. ::
  1057. "_main" - Main menu (macOS).
  1058. "_dock" - Dock popup menu (macOS).
  1059. .. rst-class:: classref-item-separator
  1060. ----
  1061. .. _class_DisplayServer_method_global_menu_add_multistate_item:
  1062. .. rst-class:: classref-method
  1063. :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 **)**
  1064. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1065. 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``.
  1066. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1067. 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`).
  1068. \ **Note:** By default, there's no indication of the current item state, it should be changed manually.
  1069. \ **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``.
  1070. \ **Note:** This method is implemented only on macOS.
  1071. \ **Supported system menu IDs:**\
  1072. ::
  1073. "_main" - Main menu (macOS).
  1074. "_dock" - Dock popup menu (macOS).
  1075. .. rst-class:: classref-item-separator
  1076. ----
  1077. .. _class_DisplayServer_method_global_menu_add_radio_check_item:
  1078. .. rst-class:: classref-method
  1079. :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 **)**
  1080. Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1081. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1082. 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`).
  1083. \ **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.
  1084. \ **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``.
  1085. \ **Note:** This method is implemented only 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_add_separator:
  1093. .. rst-class:: classref-method
  1094. :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
  1095. Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
  1096. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1097. \ **Note:** This method is implemented only on macOS.
  1098. \ **Supported system menu IDs:**\
  1099. ::
  1100. "_main" - Main menu (macOS).
  1101. "_dock" - Dock popup menu (macOS).
  1102. .. rst-class:: classref-item-separator
  1103. ----
  1104. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  1105. .. rst-class:: classref-method
  1106. :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 **)**
  1107. 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.
  1108. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1109. \ **Note:** This method is implemented only on macOS.
  1110. \ **Supported system menu IDs:**\
  1111. ::
  1112. "_main" - Main menu (macOS).
  1113. "_dock" - Dock popup menu (macOS).
  1114. .. rst-class:: classref-item-separator
  1115. ----
  1116. .. _class_DisplayServer_method_global_menu_clear:
  1117. .. rst-class:: classref-method
  1118. void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  1119. Removes all items from the global menu with ID ``menu_root``.
  1120. \ **Note:** This method is implemented only on macOS.
  1121. \ **Supported system menu IDs:**\
  1122. ::
  1123. "_main" - Main menu (macOS).
  1124. "_dock" - Dock popup menu (macOS).
  1125. .. rst-class:: classref-item-separator
  1126. ----
  1127. .. _class_DisplayServer_method_global_menu_get_item_accelerator:
  1128. .. rst-class:: classref-method
  1129. :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1130. 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.
  1131. \ **Note:** This method is implemented only on macOS.
  1132. .. rst-class:: classref-item-separator
  1133. ----
  1134. .. _class_DisplayServer_method_global_menu_get_item_callback:
  1135. .. rst-class:: classref-method
  1136. :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1137. Returns the callback of the item at index ``idx``.
  1138. \ **Note:** This method is implemented only on macOS.
  1139. .. rst-class:: classref-item-separator
  1140. ----
  1141. .. _class_DisplayServer_method_global_menu_get_item_count:
  1142. .. rst-class:: classref-method
  1143. :ref:`int<class_int>` **global_menu_get_item_count** **(** :ref:`String<class_String>` menu_root **)** |const|
  1144. Returns number of items in the global menu with ID ``menu_root``.
  1145. \ **Note:** This method is implemented only on macOS.
  1146. .. rst-class:: classref-item-separator
  1147. ----
  1148. .. _class_DisplayServer_method_global_menu_get_item_icon:
  1149. .. rst-class:: classref-method
  1150. :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1151. Returns the icon of the item at index ``idx``.
  1152. \ **Note:** This method is implemented only on macOS.
  1153. .. rst-class:: classref-item-separator
  1154. ----
  1155. .. _class_DisplayServer_method_global_menu_get_item_indentation_level:
  1156. .. rst-class:: classref-method
  1157. :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1158. Returns the horizontal offset of the item at the given ``idx``.
  1159. \ **Note:** This method is implemented only on macOS.
  1160. .. rst-class:: classref-item-separator
  1161. ----
  1162. .. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
  1163. .. rst-class:: classref-method
  1164. :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
  1165. 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.
  1166. \ **Note:** This method is implemented only on macOS.
  1167. .. rst-class:: classref-item-separator
  1168. ----
  1169. .. _class_DisplayServer_method_global_menu_get_item_index_from_text:
  1170. .. rst-class:: classref-method
  1171. :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
  1172. 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.
  1173. \ **Note:** This method is implemented only on macOS.
  1174. .. rst-class:: classref-item-separator
  1175. ----
  1176. .. _class_DisplayServer_method_global_menu_get_item_key_callback:
  1177. .. rst-class:: classref-method
  1178. :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1179. Returns the callback of the item accelerator at index ``idx``.
  1180. \ **Note:** This method is implemented only on macOS.
  1181. .. rst-class:: classref-item-separator
  1182. ----
  1183. .. _class_DisplayServer_method_global_menu_get_item_max_states:
  1184. .. rst-class:: classref-method
  1185. :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1186. 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.
  1187. \ **Note:** This method is implemented only on macOS.
  1188. .. rst-class:: classref-item-separator
  1189. ----
  1190. .. _class_DisplayServer_method_global_menu_get_item_state:
  1191. .. rst-class:: classref-method
  1192. :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1193. Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1194. \ **Note:** This method is implemented only on macOS.
  1195. .. rst-class:: classref-item-separator
  1196. ----
  1197. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  1198. .. rst-class:: classref-method
  1199. :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1200. 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.
  1201. \ **Note:** This method is implemented only on macOS.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_DisplayServer_method_global_menu_get_item_tag:
  1205. .. rst-class:: classref-method
  1206. :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1207. 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.
  1208. \ **Note:** This method is implemented only on macOS.
  1209. .. rst-class:: classref-item-separator
  1210. ----
  1211. .. _class_DisplayServer_method_global_menu_get_item_text:
  1212. .. rst-class:: classref-method
  1213. :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1214. Returns the text of the item at index ``idx``.
  1215. \ **Note:** This method is implemented only on macOS.
  1216. .. rst-class:: classref-item-separator
  1217. ----
  1218. .. _class_DisplayServer_method_global_menu_get_item_tooltip:
  1219. .. rst-class:: classref-method
  1220. :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1221. Returns the tooltip associated with the specified index ``idx``.
  1222. \ **Note:** This method is implemented only on macOS.
  1223. .. rst-class:: classref-item-separator
  1224. ----
  1225. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  1226. .. rst-class:: classref-method
  1227. :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1228. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  1229. \ **Note:** This method is implemented only on macOS.
  1230. .. rst-class:: classref-item-separator
  1231. ----
  1232. .. _class_DisplayServer_method_global_menu_is_item_checked:
  1233. .. rst-class:: classref-method
  1234. :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1235. Returns ``true`` if the item at index ``idx`` is checked.
  1236. \ **Note:** This method is implemented only on macOS.
  1237. .. rst-class:: classref-item-separator
  1238. ----
  1239. .. _class_DisplayServer_method_global_menu_is_item_disabled:
  1240. .. rst-class:: classref-method
  1241. :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1242. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  1243. See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
  1244. \ **Note:** This method is implemented only on macOS.
  1245. .. rst-class:: classref-item-separator
  1246. ----
  1247. .. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
  1248. .. rst-class:: classref-method
  1249. :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1250. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  1251. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1252. \ **Note:** This method is implemented only on macOS.
  1253. .. rst-class:: classref-item-separator
  1254. ----
  1255. .. _class_DisplayServer_method_global_menu_remove_item:
  1256. .. rst-class:: classref-method
  1257. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  1258. Removes the item at index ``idx`` from the global menu ``menu_root``.
  1259. \ **Note:** The indices of items after the removed item will be shifted by one.
  1260. \ **Note:** This method is implemented only on macOS.
  1261. .. rst-class:: classref-item-separator
  1262. ----
  1263. .. _class_DisplayServer_method_global_menu_set_item_accelerator:
  1264. .. rst-class:: classref-method
  1265. void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
  1266. 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`).
  1267. \ **Note:** This method is implemented only on macOS.
  1268. .. rst-class:: classref-item-separator
  1269. ----
  1270. .. _class_DisplayServer_method_global_menu_set_item_callback:
  1271. .. rst-class:: classref-method
  1272. void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1273. Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
  1274. \ **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.
  1275. \ **Note:** This method is implemented only on macOS.
  1276. .. rst-class:: classref-item-separator
  1277. ----
  1278. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  1279. .. rst-class:: classref-method
  1280. void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1281. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  1282. \ **Note:** This method is implemented only on macOS.
  1283. .. rst-class:: classref-item-separator
  1284. ----
  1285. .. _class_DisplayServer_method_global_menu_set_item_checked:
  1286. .. rst-class:: classref-method
  1287. void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  1288. Sets the checkstate status of the item at index ``idx``.
  1289. \ **Note:** This method is implemented only on macOS.
  1290. .. rst-class:: classref-item-separator
  1291. ----
  1292. .. _class_DisplayServer_method_global_menu_set_item_disabled:
  1293. .. rst-class:: classref-method
  1294. void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  1295. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  1296. \ **Note:** This method is implemented only on macOS.
  1297. .. rst-class:: classref-item-separator
  1298. ----
  1299. .. _class_DisplayServer_method_global_menu_set_item_icon:
  1300. .. rst-class:: classref-method
  1301. void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  1302. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  1303. \ **Note:** This method is implemented only on macOS.
  1304. \ **Note:** This method is not supported by macOS "_dock" menu items.
  1305. .. rst-class:: classref-item-separator
  1306. ----
  1307. .. _class_DisplayServer_method_global_menu_set_item_indentation_level:
  1308. .. rst-class:: classref-method
  1309. void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
  1310. Sets the horizontal offset of the item at the given ``idx``.
  1311. \ **Note:** This method is implemented only on macOS.
  1312. .. rst-class:: classref-item-separator
  1313. ----
  1314. .. _class_DisplayServer_method_global_menu_set_item_key_callback:
  1315. .. rst-class:: classref-method
  1316. void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
  1317. Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
  1318. \ **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.
  1319. \ **Note:** This method is implemented only on macOS.
  1320. .. rst-class:: classref-item-separator
  1321. ----
  1322. .. _class_DisplayServer_method_global_menu_set_item_max_states:
  1323. .. rst-class:: classref-method
  1324. void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
  1325. 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.
  1326. \ **Note:** This method is implemented only on macOS.
  1327. .. rst-class:: classref-item-separator
  1328. ----
  1329. .. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
  1330. .. rst-class:: classref-method
  1331. void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1332. 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.
  1333. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1334. \ **Note:** This method is implemented only on macOS.
  1335. .. rst-class:: classref-item-separator
  1336. ----
  1337. .. _class_DisplayServer_method_global_menu_set_item_state:
  1338. .. rst-class:: classref-method
  1339. void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  1340. Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1341. \ **Note:** This method is implemented only on macOS.
  1342. .. rst-class:: classref-item-separator
  1343. ----
  1344. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  1345. .. rst-class:: classref-method
  1346. void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  1347. 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.
  1348. \ **Note:** This method is implemented only on macOS.
  1349. .. rst-class:: classref-item-separator
  1350. ----
  1351. .. _class_DisplayServer_method_global_menu_set_item_tag:
  1352. .. rst-class:: classref-method
  1353. void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  1354. 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.
  1355. \ **Note:** This method is implemented only on macOS.
  1356. .. rst-class:: classref-item-separator
  1357. ----
  1358. .. _class_DisplayServer_method_global_menu_set_item_text:
  1359. .. rst-class:: classref-method
  1360. void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  1361. Sets the text of the item at index ``idx``.
  1362. \ **Note:** This method is implemented only on macOS.
  1363. .. rst-class:: classref-item-separator
  1364. ----
  1365. .. _class_DisplayServer_method_global_menu_set_item_tooltip:
  1366. .. rst-class:: classref-method
  1367. void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  1368. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  1369. \ **Note:** This method is implemented only on macOS.
  1370. .. rst-class:: classref-item-separator
  1371. ----
  1372. .. _class_DisplayServer_method_has_feature:
  1373. .. rst-class:: classref-method
  1374. :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  1375. Returns ``true`` if the specified ``feature`` is supported by the current **DisplayServer**, ``false`` otherwise.
  1376. .. rst-class:: classref-item-separator
  1377. ----
  1378. .. _class_DisplayServer_method_ime_get_selection:
  1379. .. rst-class:: classref-method
  1380. :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  1381. 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.
  1382. \ **Note:** This method is implemented only on macOS.
  1383. .. rst-class:: classref-item-separator
  1384. ----
  1385. .. _class_DisplayServer_method_ime_get_text:
  1386. .. rst-class:: classref-method
  1387. :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  1388. Returns the composition string contained within the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ window.
  1389. \ **Note:** This method is implemented only on macOS.
  1390. .. rst-class:: classref-item-separator
  1391. ----
  1392. .. _class_DisplayServer_method_is_dark_mode:
  1393. .. rst-class:: classref-method
  1394. :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
  1395. Returns ``true`` if OS is using dark mode.
  1396. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1397. .. rst-class:: classref-item-separator
  1398. ----
  1399. .. _class_DisplayServer_method_is_dark_mode_supported:
  1400. .. rst-class:: classref-method
  1401. :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
  1402. Returns ``true`` if OS supports dark mode.
  1403. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1404. .. rst-class:: classref-item-separator
  1405. ----
  1406. .. _class_DisplayServer_method_is_touchscreen_available:
  1407. .. rst-class:: classref-method
  1408. :ref:`bool<class_bool>` **is_touchscreen_available** **(** **)** |const|
  1409. 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``.
  1410. .. rst-class:: classref-item-separator
  1411. ----
  1412. .. _class_DisplayServer_method_keyboard_get_current_layout:
  1413. .. rst-class:: classref-method
  1414. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1415. Returns active keyboard layout index.
  1416. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1417. .. rst-class:: classref-item-separator
  1418. ----
  1419. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  1420. .. rst-class:: classref-method
  1421. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1422. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  1423. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1424. .. rst-class:: classref-item-separator
  1425. ----
  1426. .. _class_DisplayServer_method_keyboard_get_layout_count:
  1427. .. rst-class:: classref-method
  1428. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1429. Returns the number of keyboard layouts.
  1430. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1431. .. rst-class:: classref-item-separator
  1432. ----
  1433. .. _class_DisplayServer_method_keyboard_get_layout_language:
  1434. .. rst-class:: classref-method
  1435. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1436. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1437. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1438. .. rst-class:: classref-item-separator
  1439. ----
  1440. .. _class_DisplayServer_method_keyboard_get_layout_name:
  1441. .. rst-class:: classref-method
  1442. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1443. Returns the localized name of the keyboard layout at position ``index``.
  1444. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1445. .. rst-class:: classref-item-separator
  1446. ----
  1447. .. _class_DisplayServer_method_keyboard_set_current_layout:
  1448. .. rst-class:: classref-method
  1449. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1450. Sets the active keyboard layout.
  1451. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1452. .. rst-class:: classref-item-separator
  1453. ----
  1454. .. _class_DisplayServer_method_mouse_get_button_state:
  1455. .. rst-class:: classref-method
  1456. :ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>` **mouse_get_button_state** **(** **)** |const|
  1457. 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>`.
  1458. .. rst-class:: classref-item-separator
  1459. ----
  1460. .. _class_DisplayServer_method_mouse_get_mode:
  1461. .. rst-class:: classref-method
  1462. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  1463. Returns the current mouse mode. See also :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>`.
  1464. .. rst-class:: classref-item-separator
  1465. ----
  1466. .. _class_DisplayServer_method_mouse_get_position:
  1467. .. rst-class:: classref-method
  1468. :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  1469. Returns the mouse cursor's current position in screen coordinates.
  1470. .. rst-class:: classref-item-separator
  1471. ----
  1472. .. _class_DisplayServer_method_mouse_set_mode:
  1473. .. rst-class:: classref-method
  1474. void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  1475. Sets the current mouse mode. See also :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>`.
  1476. .. rst-class:: classref-item-separator
  1477. ----
  1478. .. _class_DisplayServer_method_process_events:
  1479. .. rst-class:: classref-method
  1480. void **process_events** **(** **)**
  1481. 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>`.
  1482. .. rst-class:: classref-item-separator
  1483. ----
  1484. .. _class_DisplayServer_method_screen_get_dpi:
  1485. .. rst-class:: classref-method
  1486. :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1487. 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.
  1488. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1489. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1490. ::
  1491. ldpi - 120 dpi
  1492. mdpi - 160 dpi
  1493. hdpi - 240 dpi
  1494. xhdpi - 320 dpi
  1495. xxhdpi - 480 dpi
  1496. xxxhdpi - 640 dpi
  1497. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms.
  1498. .. rst-class:: classref-item-separator
  1499. ----
  1500. .. _class_DisplayServer_method_screen_get_image:
  1501. .. rst-class:: classref-method
  1502. :ref:`Image<class_Image>` **screen_get_image** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1503. Returns screenshot of the ``screen``.
  1504. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1505. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1506. .. rst-class:: classref-item-separator
  1507. ----
  1508. .. _class_DisplayServer_method_screen_get_max_scale:
  1509. .. rst-class:: classref-method
  1510. :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  1511. Returns the greatest scale factor of all screens.
  1512. \ **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.
  1513. \ **Note:** This method is implemented only on macOS.
  1514. .. rst-class:: classref-item-separator
  1515. ----
  1516. .. _class_DisplayServer_method_screen_get_orientation:
  1517. .. rst-class:: classref-method
  1518. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1519. Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>`.
  1520. \ **Note:** This method is implemented on Android and iOS.
  1521. .. rst-class:: classref-item-separator
  1522. ----
  1523. .. _class_DisplayServer_method_screen_get_pixel:
  1524. .. rst-class:: classref-method
  1525. :ref:`Color<class_Color>` **screen_get_pixel** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1526. Returns color of the display pixel at the ``position``.
  1527. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1528. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1529. .. rst-class:: classref-item-separator
  1530. ----
  1531. .. _class_DisplayServer_method_screen_get_position:
  1532. .. rst-class:: classref-method
  1533. :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1534. 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:
  1535. ::
  1536. * (0, 0) +-------+
  1537. | |
  1538. +-------------+ | |
  1539. | | | |
  1540. | | | |
  1541. +-------------+ +-------+
  1542. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1543. .. rst-class:: classref-item-separator
  1544. ----
  1545. .. _class_DisplayServer_method_screen_get_refresh_rate:
  1546. .. rst-class:: classref-method
  1547. :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1548. 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.
  1549. \ **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.
  1550. To fallback to a default refresh rate if the method fails, try:
  1551. ::
  1552. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  1553. if refresh_rate < 0:
  1554. refresh_rate = 60.0
  1555. .. rst-class:: classref-item-separator
  1556. ----
  1557. .. _class_DisplayServer_method_screen_get_scale:
  1558. .. rst-class:: classref-method
  1559. :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1560. Returns the scale factor of the specified screen by index.
  1561. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1562. \ **Note:** This method is implemented only on macOS.
  1563. .. rst-class:: classref-item-separator
  1564. ----
  1565. .. _class_DisplayServer_method_screen_get_size:
  1566. .. rst-class:: classref-method
  1567. :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1568. 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>`.
  1569. .. rst-class:: classref-item-separator
  1570. ----
  1571. .. _class_DisplayServer_method_screen_get_usable_rect:
  1572. .. rst-class:: classref-method
  1573. :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1574. 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>`.
  1575. .. rst-class:: classref-item-separator
  1576. ----
  1577. .. _class_DisplayServer_method_screen_is_kept_on:
  1578. .. rst-class:: classref-method
  1579. :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  1580. 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>`.
  1581. .. rst-class:: classref-item-separator
  1582. ----
  1583. .. _class_DisplayServer_method_screen_set_keep_on:
  1584. .. rst-class:: classref-method
  1585. void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  1586. 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>`.
  1587. .. rst-class:: classref-item-separator
  1588. ----
  1589. .. _class_DisplayServer_method_screen_set_orientation:
  1590. .. rst-class:: classref-method
  1591. void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  1592. Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>`.
  1593. .. rst-class:: classref-item-separator
  1594. ----
  1595. .. _class_DisplayServer_method_set_icon:
  1596. .. rst-class:: classref-method
  1597. void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  1598. 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.
  1599. .. rst-class:: classref-item-separator
  1600. ----
  1601. .. _class_DisplayServer_method_set_native_icon:
  1602. .. rst-class:: classref-method
  1603. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1604. 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.
  1605. .. rst-class:: classref-item-separator
  1606. ----
  1607. .. _class_DisplayServer_method_tablet_get_current_driver:
  1608. .. rst-class:: classref-method
  1609. :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  1610. Returns current active tablet driver name.
  1611. \ **Note:** This method is implemented only on Windows.
  1612. .. rst-class:: classref-item-separator
  1613. ----
  1614. .. _class_DisplayServer_method_tablet_get_driver_count:
  1615. .. rst-class:: classref-method
  1616. :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  1617. Returns the total number of available tablet drivers.
  1618. \ **Note:** This method is implemented only on Windows.
  1619. .. rst-class:: classref-item-separator
  1620. ----
  1621. .. _class_DisplayServer_method_tablet_get_driver_name:
  1622. .. rst-class:: classref-method
  1623. :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1624. Returns the tablet driver name for the given index.
  1625. \ **Note:** This method is implemented only on Windows.
  1626. .. rst-class:: classref-item-separator
  1627. ----
  1628. .. _class_DisplayServer_method_tablet_set_current_driver:
  1629. .. rst-class:: classref-method
  1630. void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  1631. Set active tablet driver name.
  1632. \ **Note:** This method is implemented only on Windows.
  1633. .. rst-class:: classref-item-separator
  1634. ----
  1635. .. _class_DisplayServer_method_tts_get_voices:
  1636. .. rst-class:: classref-method
  1637. :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
  1638. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1639. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1640. - ``name`` is voice name.
  1641. - ``id`` is voice identifier.
  1642. - ``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.
  1643. 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.
  1644. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1645. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1646. .. rst-class:: classref-item-separator
  1647. ----
  1648. .. _class_DisplayServer_method_tts_get_voices_for_language:
  1649. .. rst-class:: classref-method
  1650. :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1651. Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
  1652. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1653. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1654. .. rst-class:: classref-item-separator
  1655. ----
  1656. .. _class_DisplayServer_method_tts_is_paused:
  1657. .. rst-class:: classref-method
  1658. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1659. Returns ``true`` if the synthesizer is in a paused state.
  1660. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1661. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1662. .. rst-class:: classref-item-separator
  1663. ----
  1664. .. _class_DisplayServer_method_tts_is_speaking:
  1665. .. rst-class:: classref-method
  1666. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1667. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1668. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1669. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1670. .. rst-class:: classref-item-separator
  1671. ----
  1672. .. _class_DisplayServer_method_tts_pause:
  1673. .. rst-class:: classref-method
  1674. void **tts_pause** **(** **)**
  1675. Puts the synthesizer into a paused state.
  1676. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1677. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1678. .. rst-class:: classref-item-separator
  1679. ----
  1680. .. _class_DisplayServer_method_tts_resume:
  1681. .. rst-class:: classref-method
  1682. void **tts_resume** **(** **)**
  1683. Resumes the synthesizer if it was paused.
  1684. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1685. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1686. .. rst-class:: classref-item-separator
  1687. ----
  1688. .. _class_DisplayServer_method_tts_set_utterance_callback:
  1689. .. rst-class:: classref-method
  1690. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
  1691. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1692. - :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.
  1693. - :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.
  1694. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1695. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1696. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1697. .. rst-class:: classref-item-separator
  1698. ----
  1699. .. _class_DisplayServer_method_tts_speak:
  1700. .. rst-class:: classref-method
  1701. 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 **)**
  1702. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1703. - ``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>`.
  1704. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1705. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1706. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1707. - ``utterance_id`` is passed as a parameter to the callback functions.
  1708. \ **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>`.
  1709. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1710. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1711. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1712. .. rst-class:: classref-item-separator
  1713. ----
  1714. .. _class_DisplayServer_method_tts_stop:
  1715. .. rst-class:: classref-method
  1716. void **tts_stop** **(** **)**
  1717. Stops synthesis in progress and removes all utterances from the queue.
  1718. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1719. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1720. .. rst-class:: classref-item-separator
  1721. ----
  1722. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  1723. .. rst-class:: classref-method
  1724. :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  1725. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1726. .. rst-class:: classref-item-separator
  1727. ----
  1728. .. _class_DisplayServer_method_virtual_keyboard_hide:
  1729. .. rst-class:: classref-method
  1730. void **virtual_keyboard_hide** **(** **)**
  1731. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1732. .. rst-class:: classref-item-separator
  1733. ----
  1734. .. _class_DisplayServer_method_virtual_keyboard_show:
  1735. .. rst-class:: classref-method
  1736. 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 **)**
  1737. Shows the virtual keyboard if the platform has one.
  1738. \ ``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).
  1739. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  1740. \ ``type`` parameter allows configuring which type of virtual keyboard to show.
  1741. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  1742. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  1743. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  1744. \ **Note:** This method is implemented on Android, iOS and Web.
  1745. .. rst-class:: classref-item-separator
  1746. ----
  1747. .. _class_DisplayServer_method_warp_mouse:
  1748. .. rst-class:: classref-method
  1749. void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1750. 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.
  1751. \ **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.
  1752. .. rst-class:: classref-item-separator
  1753. ----
  1754. .. _class_DisplayServer_method_window_can_draw:
  1755. .. rst-class:: classref-method
  1756. :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1757. 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``.
  1758. .. rst-class:: classref-item-separator
  1759. ----
  1760. .. _class_DisplayServer_method_window_get_active_popup:
  1761. .. rst-class:: classref-method
  1762. :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  1763. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  1764. .. rst-class:: classref-item-separator
  1765. ----
  1766. .. _class_DisplayServer_method_window_get_attached_instance_id:
  1767. .. rst-class:: classref-method
  1768. :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1769. 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.
  1770. .. rst-class:: classref-item-separator
  1771. ----
  1772. .. _class_DisplayServer_method_window_get_current_screen:
  1773. .. rst-class:: classref-method
  1774. :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1775. 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>`.
  1776. .. rst-class:: classref-item-separator
  1777. ----
  1778. .. _class_DisplayServer_method_window_get_flag:
  1779. .. rst-class:: classref-method
  1780. :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  1781. Returns the current value of the given window's ``flag``.
  1782. .. rst-class:: classref-item-separator
  1783. ----
  1784. .. _class_DisplayServer_method_window_get_max_size:
  1785. .. rst-class:: classref-method
  1786. :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1787. Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>`.
  1788. .. rst-class:: classref-item-separator
  1789. ----
  1790. .. _class_DisplayServer_method_window_get_min_size:
  1791. .. rst-class:: classref-method
  1792. :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1793. Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>`.
  1794. .. rst-class:: classref-item-separator
  1795. ----
  1796. .. _class_DisplayServer_method_window_get_mode:
  1797. .. rst-class:: classref-method
  1798. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1799. Returns the mode of the given window.
  1800. .. rst-class:: classref-item-separator
  1801. ----
  1802. .. _class_DisplayServer_method_window_get_native_handle:
  1803. .. rst-class:: classref-method
  1804. :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  1805. Returns internal structure pointers for use in plugins.
  1806. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows.
  1807. .. rst-class:: classref-item-separator
  1808. ----
  1809. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  1810. .. rst-class:: classref-method
  1811. :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  1812. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  1813. .. rst-class:: classref-item-separator
  1814. ----
  1815. .. _class_DisplayServer_method_window_get_position:
  1816. .. rst-class:: classref-method
  1817. :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1818. Returns the position of the client area of the given window on the screen.
  1819. .. rst-class:: classref-item-separator
  1820. ----
  1821. .. _class_DisplayServer_method_window_get_position_with_decorations:
  1822. .. rst-class:: classref-method
  1823. :ref:`Vector2i<class_Vector2i>` **window_get_position_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1824. 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>`.
  1825. .. rst-class:: classref-item-separator
  1826. ----
  1827. .. _class_DisplayServer_method_window_get_safe_title_margins:
  1828. .. rst-class:: classref-method
  1829. :ref:`Vector3i<class_Vector3i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1830. 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.
  1831. .. rst-class:: classref-item-separator
  1832. ----
  1833. .. _class_DisplayServer_method_window_get_size:
  1834. .. rst-class:: classref-method
  1835. :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1836. 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>`.
  1837. .. rst-class:: classref-item-separator
  1838. ----
  1839. .. _class_DisplayServer_method_window_get_size_with_decorations:
  1840. .. rst-class:: classref-method
  1841. :ref:`Vector2i<class_Vector2i>` **window_get_size_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1842. 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>`.
  1843. .. rst-class:: classref-item-separator
  1844. ----
  1845. .. _class_DisplayServer_method_window_get_vsync_mode:
  1846. .. rst-class:: classref-method
  1847. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1848. Returns the V-Sync mode of the given window.
  1849. .. rst-class:: classref-item-separator
  1850. ----
  1851. .. _class_DisplayServer_method_window_is_maximize_allowed:
  1852. .. rst-class:: classref-method
  1853. :ref:`bool<class_bool>` **window_is_maximize_allowed** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1854. Returns ``true`` if the given window can be maximized (the maximize button is enabled).
  1855. .. rst-class:: classref-item-separator
  1856. ----
  1857. .. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
  1858. .. rst-class:: classref-method
  1859. :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
  1860. Returns ``true``, if double-click on a window title should maximize it.
  1861. \ **Note:** This method is implemented only on macOS.
  1862. .. rst-class:: classref-item-separator
  1863. ----
  1864. .. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
  1865. .. rst-class:: classref-method
  1866. :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
  1867. Returns ``true``, if double-click on a window title should minimize it.
  1868. \ **Note:** This method is implemented only on macOS.
  1869. .. rst-class:: classref-item-separator
  1870. ----
  1871. .. _class_DisplayServer_method_window_move_to_foreground:
  1872. .. rst-class:: classref-method
  1873. void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  1874. Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows.
  1875. .. rst-class:: classref-item-separator
  1876. ----
  1877. .. _class_DisplayServer_method_window_request_attention:
  1878. .. rst-class:: classref-method
  1879. void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  1880. 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.
  1881. .. rst-class:: classref-item-separator
  1882. ----
  1883. .. _class_DisplayServer_method_window_set_current_screen:
  1884. .. rst-class:: classref-method
  1885. void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  1886. 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>`.
  1887. .. rst-class:: classref-item-separator
  1888. ----
  1889. .. _class_DisplayServer_method_window_set_drop_files_callback:
  1890. .. rst-class:: classref-method
  1891. void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1892. 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``.
  1893. \ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web.
  1894. .. rst-class:: classref-item-separator
  1895. ----
  1896. .. _class_DisplayServer_method_window_set_exclusive:
  1897. .. rst-class:: classref-method
  1898. void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  1899. 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.
  1900. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  1901. \ **Note:** This method is implemented on macOS and Windows.
  1902. .. rst-class:: classref-item-separator
  1903. ----
  1904. .. _class_DisplayServer_method_window_set_flag:
  1905. .. rst-class:: classref-method
  1906. void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  1907. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  1908. .. rst-class:: classref-item-separator
  1909. ----
  1910. .. _class_DisplayServer_method_window_set_ime_active:
  1911. .. rst-class:: classref-method
  1912. void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  1913. 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>`.
  1914. .. rst-class:: classref-item-separator
  1915. ----
  1916. .. _class_DisplayServer_method_window_set_ime_position:
  1917. .. rst-class:: classref-method
  1918. void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1919. 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``.
  1920. .. rst-class:: classref-item-separator
  1921. ----
  1922. .. _class_DisplayServer_method_window_set_input_event_callback:
  1923. .. rst-class:: classref-method
  1924. void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1925. Sets the ``callback`` that should be called when any :ref:`InputEvent<class_InputEvent>` is sent to the window specified by ``window_id``.
  1926. .. rst-class:: classref-item-separator
  1927. ----
  1928. .. _class_DisplayServer_method_window_set_input_text_callback:
  1929. .. rst-class:: classref-method
  1930. void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1931. Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``.
  1932. .. rst-class:: classref-item-separator
  1933. ----
  1934. .. _class_DisplayServer_method_window_set_max_size:
  1935. .. rst-class:: classref-method
  1936. void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  1937. 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>`.
  1938. \ **Note:** It's recommended to change this value using :ref:`Window.max_size<class_Window_property_max_size>` instead.
  1939. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1940. .. rst-class:: classref-item-separator
  1941. ----
  1942. .. _class_DisplayServer_method_window_set_min_size:
  1943. .. rst-class:: classref-method
  1944. void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  1945. 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>`.
  1946. \ **Note:** It's recommended to change this value using :ref:`Window.min_size<class_Window_property_min_size>` instead.
  1947. \ **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.
  1948. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1949. .. rst-class:: classref-item-separator
  1950. ----
  1951. .. _class_DisplayServer_method_window_set_mode:
  1952. .. rst-class:: classref-method
  1953. void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  1954. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  1955. \ **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.
  1956. .. rst-class:: classref-item-separator
  1957. ----
  1958. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  1959. .. rst-class:: classref-method
  1960. void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  1961. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  1962. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  1963. .. tabs::
  1964. .. code-tab:: gdscript
  1965. # Set region, using Path2D node.
  1966. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  1967. # Set region, using Polygon2D node.
  1968. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  1969. # Reset region to default.
  1970. DisplayServer.window_set_mouse_passthrough([])
  1971. .. code-tab:: csharp
  1972. // Set region, using Path2D node.
  1973. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  1974. // Set region, using Polygon2D node.
  1975. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  1976. // Reset region to default.
  1977. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  1978. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  1979. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1980. .. rst-class:: classref-item-separator
  1981. ----
  1982. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  1983. .. rst-class:: classref-method
  1984. void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  1985. 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.
  1986. .. rst-class:: classref-item-separator
  1987. ----
  1988. .. _class_DisplayServer_method_window_set_position:
  1989. .. rst-class:: classref-method
  1990. void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1991. 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:
  1992. ::
  1993. * (0, 0) +-------+
  1994. | |
  1995. +-------------+ | |
  1996. | | | |
  1997. | | | |
  1998. +-------------+ +-------+
  1999. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>` and :ref:`window_set_size<class_DisplayServer_method_window_set_size>`.
  2000. \ **Note:** It's recommended to change this value using :ref:`Window.position<class_Window_property_position>` instead.
  2001. .. rst-class:: classref-item-separator
  2002. ----
  2003. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  2004. .. rst-class:: classref-method
  2005. void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2006. Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized.
  2007. .. rst-class:: classref-item-separator
  2008. ----
  2009. .. _class_DisplayServer_method_window_set_size:
  2010. .. rst-class:: classref-method
  2011. void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  2012. 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>`.
  2013. \ **Note:** It's recommended to change this value using :ref:`Window.size<class_Window_property_size>` instead.
  2014. .. rst-class:: classref-item-separator
  2015. ----
  2016. .. _class_DisplayServer_method_window_set_title:
  2017. .. rst-class:: classref-method
  2018. void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  2019. Sets the title of the given window to ``title``.
  2020. \ **Note:** It's recommended to change this value using :ref:`Window.title<class_Window_property_title>` instead.
  2021. \ **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.
  2022. .. rst-class:: classref-item-separator
  2023. ----
  2024. .. _class_DisplayServer_method_window_set_transient:
  2025. .. rst-class:: classref-method
  2026. void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  2027. 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.
  2028. \ **Note:** It's recommended to change this value using :ref:`Window.transient<class_Window_property_transient>` instead.
  2029. \ **Note:** The behavior might be different depending on the platform.
  2030. .. rst-class:: classref-item-separator
  2031. ----
  2032. .. _class_DisplayServer_method_window_set_vsync_mode:
  2033. .. rst-class:: classref-method
  2034. void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  2035. 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>`.
  2036. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  2037. 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.
  2038. \ **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.
  2039. .. rst-class:: classref-item-separator
  2040. ----
  2041. .. _class_DisplayServer_method_window_set_window_buttons_offset:
  2042. .. rst-class:: classref-method
  2043. void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
  2044. 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.
  2045. \ **Note:** This flag is implemented only on macOS.
  2046. .. rst-class:: classref-item-separator
  2047. ----
  2048. .. _class_DisplayServer_method_window_set_window_event_callback:
  2049. .. rst-class:: classref-method
  2050. void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2051. Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``.
  2052. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2053. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2054. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2055. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2056. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2057. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`