class_displayserver.rst 309 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886
  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:`Image<class_Image>` | :ref:`clipboard_get_image<class_DisplayServer_method_clipboard_get_image>` **(** **)** |const| |
  25. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
  27. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`clipboard_has<class_DisplayServer_method_clipboard_has>` **(** **)** |const| |
  29. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`clipboard_has_image<class_DisplayServer_method_clipboard_has_image>` **(** **)** |const| |
  31. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
  33. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
  35. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
  37. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | 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) **)** |
  39. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
  41. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :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 **)** |
  43. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :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 **)** |
  45. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
  47. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`file_dialog_show<class_DisplayServer_method_file_dialog_show>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` current_directory, :ref:`String<class_String>` filename, :ref:`bool<class_bool>` show_hidden, :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` mode, :ref:`PackedStringArray<class_PackedStringArray>` filters, :ref:`Callable<class_Callable>` callback **)** |
  49. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
  51. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Color<class_Color>` | :ref:`get_accent_color<class_DisplayServer_method_get_accent_color>` **(** **)** |const| |
  53. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Rect2[]<class_Rect2>` | :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>` **(** **)** |const| |
  55. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Rect2i<class_Rect2i>` | :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>` **(** **)** |const| |
  57. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_keyboard_focus_screen<class_DisplayServer_method_get_keyboard_focus_screen>` **(** **)** |const| |
  59. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
  61. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_primary_screen<class_DisplayServer_method_get_primary_screen>` **(** **)** |const| |
  63. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
  65. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_screen_from_rect<class_DisplayServer_method_get_screen_from_rect>` **(** :ref:`Rect2<class_Rect2>` rect **)** |const| |
  67. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
  69. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  71. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
  73. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :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_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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :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_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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :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_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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :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_item<class_DisplayServer_method_global_menu_add_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  83. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  85. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
  87. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :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 **)** |
  89. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :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 **)** |
  91. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
  93. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :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| |
  95. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :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| |
  97. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :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| |
  99. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :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| |
  101. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :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| |
  103. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :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| |
  105. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :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| |
  107. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :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| |
  109. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :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| |
  111. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :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| |
  113. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :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| |
  115. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :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| |
  117. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :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| |
  119. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :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| |
  121. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :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| |
  123. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :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| |
  125. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :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| |
  127. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :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| |
  129. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  131. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | 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 **)** |
  133. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | 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 **)** |
  135. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | 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 **)** |
  137. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | 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 **)** |
  139. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | 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 **)** |
  141. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | 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 **)** |
  143. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | 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 **)** |
  145. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | 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 **)** |
  147. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | 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 **)** |
  149. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | 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 **)** |
  151. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | 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 **)** |
  153. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | 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 **)** |
  155. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | 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 **)** |
  157. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | 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 **)** |
  159. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | 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 **)** |
  161. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  163. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  165. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  167. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
  169. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
  171. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`bool<class_bool>` | :ref:`is_touchscreen_available<class_DisplayServer_method_is_touchscreen_available>` **(** **)** |const| |
  173. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  175. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :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| |
  177. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`keyboard_get_label_from_physical<class_DisplayServer_method_keyboard_get_label_from_physical>` **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const| |
  179. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  181. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  183. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  185. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  187. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  189. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  191. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  193. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  195. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  197. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  199. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Image<class_Image>` | :ref:`screen_get_image<class_DisplayServer_method_screen_get_image>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  201. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  203. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  205. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Color<class_Color>` | :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  207. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  209. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  211. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  213. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  215. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  217. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  219. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  221. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  223. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  225. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  227. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  229. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  231. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  233. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  235. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
  237. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  239. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
  241. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
  243. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
  245. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
  247. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
  249. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | 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 **)** |
  251. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
  253. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  255. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  257. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | 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 **)** |
  259. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  261. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  263. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  265. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :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| |
  267. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  269. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :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| |
  271. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  273. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  275. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  277. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :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| |
  279. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  281. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  283. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :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| |
  285. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :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| |
  287. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  289. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :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| |
  291. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | :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| |
  293. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | :ref:`bool<class_bool>` | :ref:`window_is_focused<class_DisplayServer_method_window_is_focused>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  295. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | :ref:`bool<class_bool>` | :ref:`window_is_maximize_allowed<class_DisplayServer_method_window_is_maximize_allowed>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  297. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
  299. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
  301. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  303. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  305. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | 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 **)** |
  307. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | 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 **)** |
  309. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  311. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | 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 **)** |
  313. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | 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 **)** |
  315. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | 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 **)** |
  317. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | 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 **)** |
  319. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | 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 **)** |
  321. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | 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 **)** |
  323. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | 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 **)** |
  325. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  327. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | 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 **)** |
  329. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | 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 **)** |
  331. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  333. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | 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 **)** |
  335. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  337. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  339. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  340. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  341. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  342. | 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 **)** |
  343. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  344. | 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 **)** |
  345. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  346. | 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 **)** |
  347. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  348. .. rst-class:: classref-section-separator
  349. ----
  350. .. rst-class:: classref-descriptions-group
  351. Enumerations
  352. ------------
  353. .. _enum_DisplayServer_Feature:
  354. .. rst-class:: classref-enumeration
  355. enum **Feature**:
  356. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
  359. Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
  360. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SUBWINDOWS** = ``1``
  363. Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)**
  364. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TOUCHSCREEN** = ``2``
  367. Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web**
  368. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE** = ``3``
  371. Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web**
  372. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE_WARP** = ``4``
  375. 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)**
  376. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD** = ``5``
  379. 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**
  380. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_VIRTUAL_KEYBOARD** = ``6``
  383. Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web**
  384. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CURSOR_SHAPE** = ``7``
  387. Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web**
  388. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8``
  391. Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web**
  392. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  393. .. rst-class:: classref-enumeration-constant
  394. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_DIALOG** = ``9``
  395. Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS**
  396. .. _class_DisplayServer_constant_FEATURE_IME:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_IME** = ``10``
  399. 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)**
  400. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_WINDOW_TRANSPARENCY** = ``11``
  403. Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)**
  404. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_HIDPI** = ``12``
  407. 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**
  408. .. _class_DisplayServer_constant_FEATURE_ICON:
  409. .. rst-class:: classref-enumeration-constant
  410. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ICON** = ``13``
  411. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)**
  412. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_ICON** = ``14``
  415. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS**
  416. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  417. .. rst-class:: classref-enumeration-constant
  418. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ORIENTATION** = ``15``
  419. Display server supports changing the screen orientation. **Android, iOS**
  420. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  421. .. rst-class:: classref-enumeration-constant
  422. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SWAP_BUFFERS** = ``16``
  423. 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)**
  424. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  425. .. rst-class:: classref-enumeration-constant
  426. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD_PRIMARY** = ``18``
  427. Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD<class_DisplayServer_constant_FEATURE_CLIPBOARD>`. **Linux (X11)**
  428. .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
  429. .. rst-class:: classref-enumeration-constant
  430. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TEXT_TO_SPEECH** = ``19``
  431. Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web**
  432. .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
  433. .. rst-class:: classref-enumeration-constant
  434. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_EXTEND_TO_TITLE** = ``20``
  435. 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**
  436. .. _class_DisplayServer_constant_FEATURE_SCREEN_CAPTURE:
  437. .. rst-class:: classref-enumeration-constant
  438. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SCREEN_CAPTURE** = ``21``
  439. Display server supports reading screen pixels. See :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>`.
  440. .. rst-class:: classref-item-separator
  441. ----
  442. .. _enum_DisplayServer_MouseMode:
  443. .. rst-class:: classref-enumeration
  444. enum **MouseMode**:
  445. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  446. .. rst-class:: classref-enumeration-constant
  447. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_VISIBLE** = ``0``
  448. Makes the mouse cursor visible if it is hidden.
  449. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  450. .. rst-class:: classref-enumeration-constant
  451. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_HIDDEN** = ``1``
  452. Makes the mouse cursor hidden if it is visible.
  453. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  454. .. rst-class:: classref-enumeration-constant
  455. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CAPTURED** = ``2``
  456. Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
  457. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  458. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  459. .. rst-class:: classref-enumeration-constant
  460. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED** = ``3``
  461. Confines the mouse cursor to the game window, and make it visible.
  462. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  463. .. rst-class:: classref-enumeration-constant
  464. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED_HIDDEN** = ``4``
  465. Confines the mouse cursor to the game window, and make it hidden.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _enum_DisplayServer_ScreenOrientation:
  469. .. rst-class:: classref-enumeration
  470. enum **ScreenOrientation**:
  471. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  472. .. rst-class:: classref-enumeration-constant
  473. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_LANDSCAPE** = ``0``
  474. Default landscape orientation.
  475. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  476. .. rst-class:: classref-enumeration-constant
  477. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_PORTRAIT** = ``1``
  478. Default portrait orientation.
  479. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  480. .. rst-class:: classref-enumeration-constant
  481. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_LANDSCAPE** = ``2``
  482. Reverse landscape orientation (upside down).
  483. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  484. .. rst-class:: classref-enumeration-constant
  485. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_PORTRAIT** = ``3``
  486. Reverse portrait orientation (upside down).
  487. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  488. .. rst-class:: classref-enumeration-constant
  489. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_LANDSCAPE** = ``4``
  490. Automatic landscape orientation (default or reverse depending on sensor).
  491. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  492. .. rst-class:: classref-enumeration-constant
  493. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_PORTRAIT** = ``5``
  494. Automatic portrait orientation (default or reverse depending on sensor).
  495. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  496. .. rst-class:: classref-enumeration-constant
  497. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR** = ``6``
  498. Automatic landscape or portrait orientation (default or reverse depending on sensor).
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _enum_DisplayServer_VirtualKeyboardType:
  502. .. rst-class:: classref-enumeration
  503. enum **VirtualKeyboardType**:
  504. .. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
  505. .. rst-class:: classref-enumeration-constant
  506. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  507. Default text virtual keyboard.
  508. .. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
  509. .. rst-class:: classref-enumeration-constant
  510. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  511. Multiline virtual keyboard.
  512. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
  513. .. rst-class:: classref-enumeration-constant
  514. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  515. Virtual number keypad, useful for PIN entry.
  516. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  517. .. rst-class:: classref-enumeration-constant
  518. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  519. Virtual number keypad, useful for entering fractional numbers.
  520. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
  521. .. rst-class:: classref-enumeration-constant
  522. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  523. Virtual phone number keypad.
  524. .. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  525. .. rst-class:: classref-enumeration-constant
  526. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  527. Virtual keyboard with additional keys to assist with typing email addresses.
  528. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
  529. .. rst-class:: classref-enumeration-constant
  530. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  531. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  532. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
  533. .. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
  534. .. rst-class:: classref-enumeration-constant
  535. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  536. Virtual keyboard with additional keys to assist with typing URLs.
  537. .. rst-class:: classref-item-separator
  538. ----
  539. .. _enum_DisplayServer_CursorShape:
  540. .. rst-class:: classref-enumeration
  541. enum **CursorShape**:
  542. .. _class_DisplayServer_constant_CURSOR_ARROW:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_ARROW** = ``0``
  545. 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>`.
  546. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_IBEAM** = ``1``
  549. 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>`.
  550. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  553. 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>`.
  554. .. _class_DisplayServer_constant_CURSOR_CROSS:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CROSS** = ``3``
  557. 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.
  558. .. _class_DisplayServer_constant_CURSOR_WAIT:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_WAIT** = ``4``
  561. 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>`.
  562. .. _class_DisplayServer_constant_CURSOR_BUSY:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BUSY** = ``5``
  565. 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>`.
  566. .. _class_DisplayServer_constant_CURSOR_DRAG:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_DRAG** = ``6``
  569. Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP<class_DisplayServer_constant_CURSOR_CAN_DROP>`.
  570. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  573. "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>`.
  574. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  577. 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.
  578. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSIZE** = ``9``
  581. 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>`.
  582. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSIZE** = ``10``
  585. 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>`.
  586. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  589. 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.
  590. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  593. 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.
  594. .. _class_DisplayServer_constant_CURSOR_MOVE:
  595. .. rst-class:: classref-enumeration-constant
  596. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MOVE** = ``13``
  597. Move cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be moved using the mouse.
  598. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  599. .. rst-class:: classref-enumeration-constant
  600. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSPLIT** = ``14``
  601. 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>`.
  602. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  603. .. rst-class:: classref-enumeration-constant
  604. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSPLIT** = ``15``
  605. 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>`.
  606. .. _class_DisplayServer_constant_CURSOR_HELP:
  607. .. rst-class:: classref-enumeration-constant
  608. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HELP** = ``16``
  609. 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.
  610. .. _class_DisplayServer_constant_CURSOR_MAX:
  611. .. rst-class:: classref-enumeration-constant
  612. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MAX** = ``17``
  613. Represents the size of the :ref:`CursorShape<enum_DisplayServer_CursorShape>` enum.
  614. .. rst-class:: classref-item-separator
  615. ----
  616. .. _enum_DisplayServer_FileDialogMode:
  617. .. rst-class:: classref-enumeration
  618. enum **FileDialogMode**:
  619. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_FILE:
  620. .. rst-class:: classref-enumeration-constant
  621. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_FILE** = ``0``
  622. The native file dialog allows selecting one, and only one file.
  623. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_FILES:
  624. .. rst-class:: classref-enumeration-constant
  625. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_FILES** = ``1``
  626. The native file dialog allows selecting multiple files.
  627. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_DIR:
  628. .. rst-class:: classref-enumeration-constant
  629. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_DIR** = ``2``
  630. The native file dialog only allows selecting a directory, disallowing the selection of any file.
  631. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_ANY:
  632. .. rst-class:: classref-enumeration-constant
  633. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_ANY** = ``3``
  634. The native file dialog allows selecting one file or directory.
  635. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_SAVE_FILE:
  636. .. rst-class:: classref-enumeration-constant
  637. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_SAVE_FILE** = ``4``
  638. The native file dialog will warn when a file exists.
  639. .. rst-class:: classref-item-separator
  640. ----
  641. .. _enum_DisplayServer_WindowMode:
  642. .. rst-class:: classref-enumeration
  643. enum **WindowMode**:
  644. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  645. .. rst-class:: classref-enumeration-constant
  646. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_WINDOWED** = ``0``
  647. Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
  648. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  649. .. rst-class:: classref-enumeration-constant
  650. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MINIMIZED** = ``1``
  651. 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.
  652. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  653. .. rst-class:: classref-enumeration-constant
  654. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MAXIMIZED** = ``2``
  655. 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.
  656. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  657. .. rst-class:: classref-enumeration-constant
  658. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_FULLSCREEN** = ``3``
  659. Full screen mode with full multi-window support.
  660. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  661. \ **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.
  662. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  663. .. rst-class:: classref-enumeration-constant
  664. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  665. 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).
  666. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  667. \ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
  668. \ **On macOS:** Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
  669. \ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
  670. \ **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.
  671. .. rst-class:: classref-item-separator
  672. ----
  673. .. _enum_DisplayServer_WindowFlags:
  674. .. rst-class:: classref-enumeration
  675. enum **WindowFlags**:
  676. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  677. .. rst-class:: classref-enumeration-constant
  678. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_RESIZE_DISABLED** = ``0``
  679. 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.
  680. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  681. .. rst-class:: classref-enumeration-constant
  682. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_BORDERLESS** = ``1``
  683. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  684. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  685. .. rst-class:: classref-enumeration-constant
  686. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_ALWAYS_ON_TOP** = ``2``
  687. The window is floating on top of all other windows. This flag is ignored for full-screen windows.
  688. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  689. .. rst-class:: classref-enumeration-constant
  690. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_TRANSPARENT** = ``3``
  691. The window background can be transparent.
  692. \ **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``.
  693. \ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  694. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  695. .. rst-class:: classref-enumeration-constant
  696. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_NO_FOCUS** = ``4``
  697. The window can't be focused. No-focus window will ignore all input, except mouse clicks.
  698. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  699. .. rst-class:: classref-enumeration-constant
  700. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_POPUP** = ``5``
  701. 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>`).
  702. .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
  703. .. rst-class:: classref-enumeration-constant
  704. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_EXTEND_TO_TITLE** = ``6``
  705. 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.
  706. Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
  707. 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.
  708. \ **Note:** This flag is implemented only on macOS.
  709. .. _class_DisplayServer_constant_WINDOW_FLAG_MOUSE_PASSTHROUGH:
  710. .. rst-class:: classref-enumeration-constant
  711. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MOUSE_PASSTHROUGH** = ``7``
  712. All mouse events are passed to the underlying window of the same application.
  713. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  714. .. rst-class:: classref-enumeration-constant
  715. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MAX** = ``8``
  716. Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
  717. .. rst-class:: classref-item-separator
  718. ----
  719. .. _enum_DisplayServer_WindowEvent:
  720. .. rst-class:: classref-enumeration
  721. enum **WindowEvent**:
  722. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  723. .. rst-class:: classref-enumeration-constant
  724. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_ENTER** = ``0``
  725. Sent when the mouse pointer enters the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  726. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  727. .. rst-class:: classref-enumeration-constant
  728. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_EXIT** = ``1``
  729. Sent when the mouse pointer exits the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  730. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  731. .. rst-class:: classref-enumeration-constant
  732. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_IN** = ``2``
  733. Sent when the window grabs focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  734. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  735. .. rst-class:: classref-enumeration-constant
  736. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_OUT** = ``3``
  737. Sent when the window loses focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  738. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  739. .. rst-class:: classref-enumeration-constant
  740. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_CLOSE_REQUEST** = ``4``
  741. 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>`.
  742. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  743. .. rst-class:: classref-enumeration-constant
  744. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_GO_BACK_REQUEST** = ``5``
  745. Sent when the device "Back" button is pressed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  746. \ **Note:** This event is implemented only on Android.
  747. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  748. .. rst-class:: classref-enumeration-constant
  749. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_DPI_CHANGE** = ``6``
  750. 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>`.
  751. \ **Note:** This flag is implemented only on macOS.
  752. .. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
  753. .. rst-class:: classref-enumeration-constant
  754. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_TITLEBAR_CHANGE** = ``7``
  755. 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>`.
  756. \ **Note:** This flag is implemented only on macOS.
  757. .. rst-class:: classref-item-separator
  758. ----
  759. .. _enum_DisplayServer_VSyncMode:
  760. .. rst-class:: classref-enumeration
  761. enum **VSyncMode**:
  762. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  763. .. rst-class:: classref-enumeration-constant
  764. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_DISABLED** = ``0``
  765. No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (notwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  766. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  767. .. rst-class:: classref-enumeration-constant
  768. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ENABLED** = ``1``
  769. 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 (notwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  770. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  771. .. rst-class:: classref-enumeration-constant
  772. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ADAPTIVE** = ``2``
  773. 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 (notwithstanding :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.
  774. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  775. .. rst-class:: classref-enumeration-constant
  776. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_MAILBOX** = ``3``
  777. 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 (notwithstanding :ref:`Engine.max_fps<class_Engine_property_max_fps>`).
  778. 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.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _enum_DisplayServer_HandleType:
  782. .. rst-class:: classref-enumeration
  783. enum **HandleType**:
  784. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  785. .. rst-class:: classref-enumeration-constant
  786. :ref:`HandleType<enum_DisplayServer_HandleType>` **DISPLAY_HANDLE** = ``0``
  787. Display handle:
  788. - Linux (X11): ``X11::Display*`` for the display.
  789. - Android: ``EGLDisplay`` for the display.
  790. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  791. .. rst-class:: classref-enumeration-constant
  792. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_HANDLE** = ``1``
  793. Window handle:
  794. - Windows: ``HWND`` for the window.
  795. - Linux (X11): ``X11::Window*`` for the window.
  796. - macOS: ``NSWindow*`` for the window.
  797. - iOS: ``UIViewController*`` for the view controller.
  798. - Android: ``jObject`` for the activity.
  799. .. _class_DisplayServer_constant_WINDOW_VIEW:
  800. .. rst-class:: classref-enumeration-constant
  801. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_VIEW** = ``2``
  802. Window view:
  803. - Windows: ``HDC`` for the window (only with the GL Compatibility renderer).
  804. - macOS: ``NSView*`` for the window main view.
  805. - iOS: ``UIView*`` for the window main view.
  806. .. _class_DisplayServer_constant_OPENGL_CONTEXT:
  807. .. rst-class:: classref-enumeration-constant
  808. :ref:`HandleType<enum_DisplayServer_HandleType>` **OPENGL_CONTEXT** = ``3``
  809. OpenGL context (only with the GL Compatibility renderer):
  810. - Windows: ``HGLRC`` for the window (native GL), or ``EGLContext`` for the window (ANGLE).
  811. - Linux: ``GLXContext*`` for the window.
  812. - macOS: ``NSOpenGLContext*`` for the window (native GL), or ``EGLContext`` for the window (ANGLE).
  813. - Android: ``EGLContext`` for the window.
  814. .. rst-class:: classref-item-separator
  815. ----
  816. .. _enum_DisplayServer_TTSUtteranceEvent:
  817. .. rst-class:: classref-enumeration
  818. enum **TTSUtteranceEvent**:
  819. .. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
  820. .. rst-class:: classref-enumeration-constant
  821. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  822. Utterance has begun to be spoken.
  823. .. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
  824. .. rst-class:: classref-enumeration-constant
  825. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  826. Utterance was successfully finished.
  827. .. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
  828. .. rst-class:: classref-enumeration-constant
  829. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  830. Utterance was canceled, or TTS service was unable to process it.
  831. .. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
  832. .. rst-class:: classref-enumeration-constant
  833. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  834. Utterance reached a word or sentence boundary.
  835. .. rst-class:: classref-section-separator
  836. ----
  837. .. rst-class:: classref-descriptions-group
  838. Constants
  839. ---------
  840. .. _class_DisplayServer_constant_SCREEN_WITH_MOUSE_FOCUS:
  841. .. rst-class:: classref-constant
  842. **SCREEN_WITH_MOUSE_FOCUS** = ``-4``
  843. Represents the screen containing the mouse pointer.
  844. .. _class_DisplayServer_constant_SCREEN_WITH_KEYBOARD_FOCUS:
  845. .. rst-class:: classref-constant
  846. **SCREEN_WITH_KEYBOARD_FOCUS** = ``-3``
  847. Represents the screen containing the window with the keyboard focus.
  848. .. _class_DisplayServer_constant_SCREEN_PRIMARY:
  849. .. rst-class:: classref-constant
  850. **SCREEN_PRIMARY** = ``-2``
  851. Represents the primary screen.
  852. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  853. .. rst-class:: classref-constant
  854. **SCREEN_OF_MAIN_WINDOW** = ``-1``
  855. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
  856. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  857. .. rst-class:: classref-constant
  858. **MAIN_WINDOW_ID** = ``0``
  859. The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``.
  860. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  861. .. rst-class:: classref-constant
  862. **INVALID_WINDOW_ID** = ``-1``
  863. The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result.
  864. .. rst-class:: classref-section-separator
  865. ----
  866. .. rst-class:: classref-descriptions-group
  867. Method Descriptions
  868. -------------------
  869. .. _class_DisplayServer_method_clipboard_get:
  870. .. rst-class:: classref-method
  871. :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  872. Returns the user's clipboard as a string if possible.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_DisplayServer_method_clipboard_get_image:
  876. .. rst-class:: classref-method
  877. :ref:`Image<class_Image>` **clipboard_get_image** **(** **)** |const|
  878. Returns the user's clipboard as an image if possible.
  879. .. rst-class:: classref-item-separator
  880. ----
  881. .. _class_DisplayServer_method_clipboard_get_primary:
  882. .. rst-class:: classref-method
  883. :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  884. 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.
  885. \ **Note:** This method is only implemented on Linux (X11).
  886. .. rst-class:: classref-item-separator
  887. ----
  888. .. _class_DisplayServer_method_clipboard_has:
  889. .. rst-class:: classref-method
  890. :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  891. Returns ``true`` if there is a text content on the user's clipboard.
  892. .. rst-class:: classref-item-separator
  893. ----
  894. .. _class_DisplayServer_method_clipboard_has_image:
  895. .. rst-class:: classref-method
  896. :ref:`bool<class_bool>` **clipboard_has_image** **(** **)** |const|
  897. Returns ``true`` if there is an image content on the user's clipboard.
  898. .. rst-class:: classref-item-separator
  899. ----
  900. .. _class_DisplayServer_method_clipboard_set:
  901. .. rst-class:: classref-method
  902. void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  903. Sets the user's clipboard content to the given string.
  904. .. rst-class:: classref-item-separator
  905. ----
  906. .. _class_DisplayServer_method_clipboard_set_primary:
  907. .. rst-class:: classref-method
  908. void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  909. 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.
  910. \ **Note:** This method is only implemented on Linux (X11).
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_DisplayServer_method_cursor_get_shape:
  914. .. rst-class:: classref-method
  915. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  916. Returns the default mouse cursor shape set by :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_DisplayServer_method_cursor_set_custom_image:
  920. .. rst-class:: classref-method
  921. 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) **)**
  922. 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>`.
  923. .. rst-class:: classref-item-separator
  924. ----
  925. .. _class_DisplayServer_method_cursor_set_shape:
  926. .. rst-class:: classref-method
  927. void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  928. 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>`.
  929. .. rst-class:: classref-item-separator
  930. ----
  931. .. _class_DisplayServer_method_dialog_input_text:
  932. .. rst-class:: classref-method
  933. :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 **)**
  934. 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.
  935. \ **Note:** This method is implemented only on macOS.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_DisplayServer_method_dialog_show:
  939. .. rst-class:: classref-method
  940. :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 **)**
  941. 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.
  942. \ **Note:** This method is implemented only on macOS.
  943. .. rst-class:: classref-item-separator
  944. ----
  945. .. _class_DisplayServer_method_enable_for_stealing_focus:
  946. .. rst-class:: classref-method
  947. void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  948. 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.
  949. \ **Note:** This method is implemented only on Windows.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_DisplayServer_method_file_dialog_show:
  953. .. rst-class:: classref-method
  954. :ref:`Error<enum_@GlobalScope_Error>` **file_dialog_show** **(** :ref:`String<class_String>` title, :ref:`String<class_String>` current_directory, :ref:`String<class_String>` filename, :ref:`bool<class_bool>` show_hidden, :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` mode, :ref:`PackedStringArray<class_PackedStringArray>` filters, :ref:`Callable<class_Callable>` callback **)**
  955. Displays OS native dialog for selecting files or directories in the file system.
  956. Callbacks have the following arguments: ``bool status, PackedStringArray selected_paths``.
  957. \ **Note:** This method is implemented if the display server has the ``FEATURE_NATIVE_DIALOG`` feature.
  958. \ **Note:** This method is implemented on Linux, Windows and macOS.
  959. \ **Note:** ``current_directory`` might be ignored.
  960. \ **Note:** On Linux, ``show_hidden`` is ignored.
  961. \ **Note:** On macOS, native file dialogs have no title.
  962. \ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions<class_OS_method_get_granted_permissions>` to get a list of saved bookmarks.
  963. .. rst-class:: classref-item-separator
  964. ----
  965. .. _class_DisplayServer_method_force_process_and_drop_events:
  966. .. rst-class:: classref-method
  967. void **force_process_and_drop_events** **(** **)**
  968. Forces window manager processing while ignoring all :ref:`InputEvent<class_InputEvent>`\ s. See also :ref:`process_events<class_DisplayServer_method_process_events>`.
  969. \ **Note:** This method is implemented on Windows and macOS.
  970. .. rst-class:: classref-item-separator
  971. ----
  972. .. _class_DisplayServer_method_get_accent_color:
  973. .. rst-class:: classref-method
  974. :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
  975. Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
  976. \ **Note:** This method is implemented on macOS and Windows.
  977. .. rst-class:: classref-item-separator
  978. ----
  979. .. _class_DisplayServer_method_get_display_cutouts:
  980. .. rst-class:: classref-method
  981. :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
  982. 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>`.
  983. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_DisplayServer_method_get_display_safe_area:
  987. .. rst-class:: classref-method
  988. :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
  989. 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>`.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_DisplayServer_method_get_keyboard_focus_screen:
  993. .. rst-class:: classref-method
  994. :ref:`int<class_int>` **get_keyboard_focus_screen** **(** **)** |const|
  995. Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_DisplayServer_method_get_name:
  999. .. rst-class:: classref-method
  1000. :ref:`String<class_String>` **get_name** **(** **)** |const|
  1001. 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).
  1002. 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>`).
  1003. .. rst-class:: classref-item-separator
  1004. ----
  1005. .. _class_DisplayServer_method_get_primary_screen:
  1006. .. rst-class:: classref-method
  1007. :ref:`int<class_int>` **get_primary_screen** **(** **)** |const|
  1008. Returns index of the primary screen.
  1009. .. rst-class:: classref-item-separator
  1010. ----
  1011. .. _class_DisplayServer_method_get_screen_count:
  1012. .. rst-class:: classref-method
  1013. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  1014. Returns the number of displays available.
  1015. .. rst-class:: classref-item-separator
  1016. ----
  1017. .. _class_DisplayServer_method_get_screen_from_rect:
  1018. .. rst-class:: classref-method
  1019. :ref:`int<class_int>` **get_screen_from_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |const|
  1020. Returns index of the screen which contains specified rectangle.
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_DisplayServer_method_get_swap_cancel_ok:
  1024. .. rst-class:: classref-method
  1025. :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  1026. Returns ``true`` if positions of **OK** and **Cancel** buttons are swapped in dialogs. This is enabled by default on Windows to follow interface conventions, and be toggled by changing :ref:`ProjectSettings.gui/common/swap_cancel_ok<class_ProjectSettings_property_gui/common/swap_cancel_ok>`.
  1027. \ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show<class_DisplayServer_method_dialog_show>`.
  1028. .. rst-class:: classref-item-separator
  1029. ----
  1030. .. _class_DisplayServer_method_get_window_at_screen_position:
  1031. .. rst-class:: classref-method
  1032. :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1033. 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:
  1034. ::
  1035. * (0, 0) +-------+
  1036. | |
  1037. +-------------+ | |
  1038. | | | |
  1039. | | | |
  1040. +-------------+ +-------+
  1041. .. rst-class:: classref-item-separator
  1042. ----
  1043. .. _class_DisplayServer_method_get_window_list:
  1044. .. rst-class:: classref-method
  1045. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  1046. Returns the list of Godot window IDs belonging to this process.
  1047. \ **Note:** Native dialogs are not included in this list.
  1048. .. rst-class:: classref-item-separator
  1049. ----
  1050. .. _class_DisplayServer_method_global_menu_add_check_item:
  1051. .. rst-class:: classref-method
  1052. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1053. Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1054. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1055. 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`).
  1056. \ **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``.
  1057. \ **Note:** This method is implemented only on macOS.
  1058. \ **Supported system menu IDs:**\
  1059. ::
  1060. "_main" - Main menu (macOS).
  1061. "_dock" - Dock popup menu (macOS).
  1062. .. rst-class:: classref-item-separator
  1063. ----
  1064. .. _class_DisplayServer_method_global_menu_add_icon_check_item:
  1065. .. rst-class:: classref-method
  1066. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1067. Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1068. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1069. 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`).
  1070. \ **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``.
  1071. \ **Note:** This method is implemented only on macOS.
  1072. \ **Supported system menu IDs:**\
  1073. ::
  1074. "_main" - Main menu (macOS).
  1075. "_dock" - Dock popup menu (macOS).
  1076. .. rst-class:: classref-item-separator
  1077. ----
  1078. .. _class_DisplayServer_method_global_menu_add_icon_item:
  1079. .. rst-class:: classref-method
  1080. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1081. Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1082. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1083. 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`).
  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_icon_radio_check_item:
  1093. .. rst-class:: classref-method
  1094. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1095. Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1096. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1097. 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`).
  1098. \ **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.
  1099. \ **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``.
  1100. \ **Note:** This method is implemented only on macOS.
  1101. \ **Supported system menu IDs:**\
  1102. ::
  1103. "_main" - Main menu (macOS).
  1104. "_dock" - Dock popup menu (macOS).
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_DisplayServer_method_global_menu_add_item:
  1108. .. rst-class:: classref-method
  1109. :ref:`int<class_int>` **global_menu_add_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1110. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1111. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1112. 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`).
  1113. \ **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``.
  1114. \ **Note:** This method is implemented only on macOS.
  1115. \ **Supported system menu IDs:**\
  1116. ::
  1117. "_main" - Main menu (macOS).
  1118. "_dock" - Dock popup menu (macOS).
  1119. .. rst-class:: classref-item-separator
  1120. ----
  1121. .. _class_DisplayServer_method_global_menu_add_multistate_item:
  1122. .. rst-class:: classref-method
  1123. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1124. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1125. 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``.
  1126. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1127. 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`).
  1128. \ **Note:** By default, there's no indication of the current item state, it should be changed manually.
  1129. \ **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``.
  1130. \ **Note:** This method is implemented only on macOS.
  1131. \ **Supported system menu IDs:**\
  1132. ::
  1133. "_main" - Main menu (macOS).
  1134. "_dock" - Dock popup menu (macOS).
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_DisplayServer_method_global_menu_add_radio_check_item:
  1138. .. rst-class:: classref-method
  1139. :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=Callable(), :ref:`Callable<class_Callable>` key_callback=Callable(), :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
  1140. Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1141. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1142. 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`).
  1143. \ **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.
  1144. \ **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``.
  1145. \ **Note:** This method is implemented only on macOS.
  1146. \ **Supported system menu IDs:**\
  1147. ::
  1148. "_main" - Main menu (macOS).
  1149. "_dock" - Dock popup menu (macOS).
  1150. .. rst-class:: classref-item-separator
  1151. ----
  1152. .. _class_DisplayServer_method_global_menu_add_separator:
  1153. .. rst-class:: classref-method
  1154. :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
  1155. Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
  1156. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1157. \ **Note:** This method is implemented only on macOS.
  1158. \ **Supported system menu IDs:**\
  1159. ::
  1160. "_main" - Main menu (macOS).
  1161. "_dock" - Dock popup menu (macOS).
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  1165. .. rst-class:: classref-method
  1166. :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 **)**
  1167. 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.
  1168. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1169. \ **Note:** This method is implemented only on macOS.
  1170. \ **Supported system menu IDs:**\
  1171. ::
  1172. "_main" - Main menu (macOS).
  1173. "_dock" - Dock popup menu (macOS).
  1174. .. rst-class:: classref-item-separator
  1175. ----
  1176. .. _class_DisplayServer_method_global_menu_clear:
  1177. .. rst-class:: classref-method
  1178. void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  1179. Removes all items from the global menu with ID ``menu_root``.
  1180. \ **Note:** This method is implemented only on macOS.
  1181. \ **Supported system menu IDs:**\
  1182. ::
  1183. "_main" - Main menu (macOS).
  1184. "_dock" - Dock popup menu (macOS).
  1185. .. rst-class:: classref-item-separator
  1186. ----
  1187. .. _class_DisplayServer_method_global_menu_get_item_accelerator:
  1188. .. rst-class:: classref-method
  1189. :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1190. 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.
  1191. \ **Note:** This method is implemented only on macOS.
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_DisplayServer_method_global_menu_get_item_callback:
  1195. .. rst-class:: classref-method
  1196. :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1197. Returns the callback of the item at index ``idx``.
  1198. \ **Note:** This method is implemented only on macOS.
  1199. .. rst-class:: classref-item-separator
  1200. ----
  1201. .. _class_DisplayServer_method_global_menu_get_item_count:
  1202. .. rst-class:: classref-method
  1203. :ref:`int<class_int>` **global_menu_get_item_count** **(** :ref:`String<class_String>` menu_root **)** |const|
  1204. Returns number of items in the global menu with ID ``menu_root``.
  1205. \ **Note:** This method is implemented only on macOS.
  1206. .. rst-class:: classref-item-separator
  1207. ----
  1208. .. _class_DisplayServer_method_global_menu_get_item_icon:
  1209. .. rst-class:: classref-method
  1210. :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1211. Returns the icon of the item at index ``idx``.
  1212. \ **Note:** This method is implemented only on macOS.
  1213. .. rst-class:: classref-item-separator
  1214. ----
  1215. .. _class_DisplayServer_method_global_menu_get_item_indentation_level:
  1216. .. rst-class:: classref-method
  1217. :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1218. Returns the horizontal offset of the item at the given ``idx``.
  1219. \ **Note:** This method is implemented only on macOS.
  1220. .. rst-class:: classref-item-separator
  1221. ----
  1222. .. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
  1223. .. rst-class:: classref-method
  1224. :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
  1225. 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.
  1226. \ **Note:** This method is implemented only on macOS.
  1227. .. rst-class:: classref-item-separator
  1228. ----
  1229. .. _class_DisplayServer_method_global_menu_get_item_index_from_text:
  1230. .. rst-class:: classref-method
  1231. :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
  1232. 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.
  1233. \ **Note:** This method is implemented only on macOS.
  1234. .. rst-class:: classref-item-separator
  1235. ----
  1236. .. _class_DisplayServer_method_global_menu_get_item_key_callback:
  1237. .. rst-class:: classref-method
  1238. :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1239. Returns the callback of the item accelerator at index ``idx``.
  1240. \ **Note:** This method is implemented only on macOS.
  1241. .. rst-class:: classref-item-separator
  1242. ----
  1243. .. _class_DisplayServer_method_global_menu_get_item_max_states:
  1244. .. rst-class:: classref-method
  1245. :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1246. 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.
  1247. \ **Note:** This method is implemented only on macOS.
  1248. .. rst-class:: classref-item-separator
  1249. ----
  1250. .. _class_DisplayServer_method_global_menu_get_item_state:
  1251. .. rst-class:: classref-method
  1252. :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1253. Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1254. \ **Note:** This method is implemented only on macOS.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  1258. .. rst-class:: classref-method
  1259. :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1260. 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.
  1261. \ **Note:** This method is implemented only on macOS.
  1262. .. rst-class:: classref-item-separator
  1263. ----
  1264. .. _class_DisplayServer_method_global_menu_get_item_tag:
  1265. .. rst-class:: classref-method
  1266. :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1267. 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.
  1268. \ **Note:** This method is implemented only on macOS.
  1269. .. rst-class:: classref-item-separator
  1270. ----
  1271. .. _class_DisplayServer_method_global_menu_get_item_text:
  1272. .. rst-class:: classref-method
  1273. :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1274. Returns the text of the item at index ``idx``.
  1275. \ **Note:** This method is implemented only on macOS.
  1276. .. rst-class:: classref-item-separator
  1277. ----
  1278. .. _class_DisplayServer_method_global_menu_get_item_tooltip:
  1279. .. rst-class:: classref-method
  1280. :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1281. Returns the tooltip associated with the specified index ``idx``.
  1282. \ **Note:** This method is implemented only on macOS.
  1283. .. rst-class:: classref-item-separator
  1284. ----
  1285. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  1286. .. rst-class:: classref-method
  1287. :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1288. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  1289. \ **Note:** This method is implemented only on macOS.
  1290. .. rst-class:: classref-item-separator
  1291. ----
  1292. .. _class_DisplayServer_method_global_menu_is_item_checked:
  1293. .. rst-class:: classref-method
  1294. :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1295. Returns ``true`` if the item at index ``idx`` is checked.
  1296. \ **Note:** This method is implemented only on macOS.
  1297. .. rst-class:: classref-item-separator
  1298. ----
  1299. .. _class_DisplayServer_method_global_menu_is_item_disabled:
  1300. .. rst-class:: classref-method
  1301. :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1302. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  1303. See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
  1304. \ **Note:** This method is implemented only on macOS.
  1305. .. rst-class:: classref-item-separator
  1306. ----
  1307. .. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
  1308. .. rst-class:: classref-method
  1309. :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1310. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  1311. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1312. \ **Note:** This method is implemented only on macOS.
  1313. .. rst-class:: classref-item-separator
  1314. ----
  1315. .. _class_DisplayServer_method_global_menu_remove_item:
  1316. .. rst-class:: classref-method
  1317. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  1318. Removes the item at index ``idx`` from the global menu ``menu_root``.
  1319. \ **Note:** The indices of items after the removed item will be shifted by one.
  1320. \ **Note:** This method is implemented only on macOS.
  1321. .. rst-class:: classref-item-separator
  1322. ----
  1323. .. _class_DisplayServer_method_global_menu_set_item_accelerator:
  1324. .. rst-class:: classref-method
  1325. void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
  1326. 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`).
  1327. \ **Note:** This method is implemented only on macOS.
  1328. .. rst-class:: classref-item-separator
  1329. ----
  1330. .. _class_DisplayServer_method_global_menu_set_item_callback:
  1331. .. rst-class:: classref-method
  1332. void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1333. Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
  1334. \ **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.
  1335. \ **Note:** This method is implemented only on macOS.
  1336. .. rst-class:: classref-item-separator
  1337. ----
  1338. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  1339. .. rst-class:: classref-method
  1340. void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1341. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  1342. \ **Note:** This method is implemented only on macOS.
  1343. .. rst-class:: classref-item-separator
  1344. ----
  1345. .. _class_DisplayServer_method_global_menu_set_item_checked:
  1346. .. rst-class:: classref-method
  1347. void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  1348. Sets the checkstate status of the item at index ``idx``.
  1349. \ **Note:** This method is implemented only on macOS.
  1350. .. rst-class:: classref-item-separator
  1351. ----
  1352. .. _class_DisplayServer_method_global_menu_set_item_disabled:
  1353. .. rst-class:: classref-method
  1354. void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  1355. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  1356. \ **Note:** This method is implemented only on macOS.
  1357. .. rst-class:: classref-item-separator
  1358. ----
  1359. .. _class_DisplayServer_method_global_menu_set_item_icon:
  1360. .. rst-class:: classref-method
  1361. void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  1362. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  1363. \ **Note:** This method is implemented only on macOS.
  1364. \ **Note:** This method is not supported by macOS "_dock" menu items.
  1365. .. rst-class:: classref-item-separator
  1366. ----
  1367. .. _class_DisplayServer_method_global_menu_set_item_indentation_level:
  1368. .. rst-class:: classref-method
  1369. void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
  1370. Sets the horizontal offset of the item at the given ``idx``.
  1371. \ **Note:** This method is implemented only on macOS.
  1372. .. rst-class:: classref-item-separator
  1373. ----
  1374. .. _class_DisplayServer_method_global_menu_set_item_key_callback:
  1375. .. rst-class:: classref-method
  1376. void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
  1377. Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
  1378. \ **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.
  1379. \ **Note:** This method is implemented only on macOS.
  1380. .. rst-class:: classref-item-separator
  1381. ----
  1382. .. _class_DisplayServer_method_global_menu_set_item_max_states:
  1383. .. rst-class:: classref-method
  1384. void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
  1385. 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.
  1386. \ **Note:** This method is implemented only on macOS.
  1387. .. rst-class:: classref-item-separator
  1388. ----
  1389. .. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
  1390. .. rst-class:: classref-method
  1391. void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1392. 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.
  1393. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1394. \ **Note:** This method is implemented only on macOS.
  1395. .. rst-class:: classref-item-separator
  1396. ----
  1397. .. _class_DisplayServer_method_global_menu_set_item_state:
  1398. .. rst-class:: classref-method
  1399. void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  1400. Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1401. \ **Note:** This method is implemented only on macOS.
  1402. .. rst-class:: classref-item-separator
  1403. ----
  1404. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  1405. .. rst-class:: classref-method
  1406. void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  1407. 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.
  1408. \ **Note:** This method is implemented only on macOS.
  1409. .. rst-class:: classref-item-separator
  1410. ----
  1411. .. _class_DisplayServer_method_global_menu_set_item_tag:
  1412. .. rst-class:: classref-method
  1413. void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  1414. 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.
  1415. \ **Note:** This method is implemented only on macOS.
  1416. .. rst-class:: classref-item-separator
  1417. ----
  1418. .. _class_DisplayServer_method_global_menu_set_item_text:
  1419. .. rst-class:: classref-method
  1420. void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  1421. Sets the text of the item at index ``idx``.
  1422. \ **Note:** This method is implemented only on macOS.
  1423. .. rst-class:: classref-item-separator
  1424. ----
  1425. .. _class_DisplayServer_method_global_menu_set_item_tooltip:
  1426. .. rst-class:: classref-method
  1427. void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  1428. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  1429. \ **Note:** This method is implemented only on macOS.
  1430. .. rst-class:: classref-item-separator
  1431. ----
  1432. .. _class_DisplayServer_method_has_feature:
  1433. .. rst-class:: classref-method
  1434. :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  1435. Returns ``true`` if the specified ``feature`` is supported by the current **DisplayServer**, ``false`` otherwise.
  1436. .. rst-class:: classref-item-separator
  1437. ----
  1438. .. _class_DisplayServer_method_ime_get_selection:
  1439. .. rst-class:: classref-method
  1440. :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  1441. 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.
  1442. \ **Note:** This method is implemented only on macOS.
  1443. .. rst-class:: classref-item-separator
  1444. ----
  1445. .. _class_DisplayServer_method_ime_get_text:
  1446. .. rst-class:: classref-method
  1447. :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  1448. Returns the composition string contained within the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ window.
  1449. \ **Note:** This method is implemented only on macOS.
  1450. .. rst-class:: classref-item-separator
  1451. ----
  1452. .. _class_DisplayServer_method_is_dark_mode:
  1453. .. rst-class:: classref-method
  1454. :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
  1455. Returns ``true`` if OS is using dark mode.
  1456. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1457. .. rst-class:: classref-item-separator
  1458. ----
  1459. .. _class_DisplayServer_method_is_dark_mode_supported:
  1460. .. rst-class:: classref-method
  1461. :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
  1462. Returns ``true`` if OS supports dark mode.
  1463. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1464. .. rst-class:: classref-item-separator
  1465. ----
  1466. .. _class_DisplayServer_method_is_touchscreen_available:
  1467. .. rst-class:: classref-method
  1468. :ref:`bool<class_bool>` **is_touchscreen_available** **(** **)** |const|
  1469. Returns ``true`` if touch events are available (Android or iOS), the capability is detected on the Web platform or if :ref:`ProjectSettings.input_devices/pointing/emulate_touch_from_mouse<class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse>` is ``true``.
  1470. .. rst-class:: classref-item-separator
  1471. ----
  1472. .. _class_DisplayServer_method_keyboard_get_current_layout:
  1473. .. rst-class:: classref-method
  1474. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1475. Returns active keyboard layout index.
  1476. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1477. .. rst-class:: classref-item-separator
  1478. ----
  1479. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  1480. .. rst-class:: classref-method
  1481. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1482. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  1483. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1484. .. rst-class:: classref-item-separator
  1485. ----
  1486. .. _class_DisplayServer_method_keyboard_get_label_from_physical:
  1487. .. rst-class:: classref-method
  1488. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_label_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1489. Converts a physical (US QWERTY) ``keycode`` to localized label printed on the key in the active keyboard layout.
  1490. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1491. .. rst-class:: classref-item-separator
  1492. ----
  1493. .. _class_DisplayServer_method_keyboard_get_layout_count:
  1494. .. rst-class:: classref-method
  1495. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1496. Returns the number of keyboard layouts.
  1497. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1498. .. rst-class:: classref-item-separator
  1499. ----
  1500. .. _class_DisplayServer_method_keyboard_get_layout_language:
  1501. .. rst-class:: classref-method
  1502. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1503. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1504. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1505. .. rst-class:: classref-item-separator
  1506. ----
  1507. .. _class_DisplayServer_method_keyboard_get_layout_name:
  1508. .. rst-class:: classref-method
  1509. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1510. Returns the localized name of the keyboard layout at position ``index``.
  1511. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1512. .. rst-class:: classref-item-separator
  1513. ----
  1514. .. _class_DisplayServer_method_keyboard_set_current_layout:
  1515. .. rst-class:: classref-method
  1516. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1517. Sets the active keyboard layout.
  1518. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1519. .. rst-class:: classref-item-separator
  1520. ----
  1521. .. _class_DisplayServer_method_mouse_get_button_state:
  1522. .. rst-class:: classref-method
  1523. |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> **mouse_get_button_state** **(** **)** |const|
  1524. 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>`.
  1525. .. rst-class:: classref-item-separator
  1526. ----
  1527. .. _class_DisplayServer_method_mouse_get_mode:
  1528. .. rst-class:: classref-method
  1529. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  1530. Returns the current mouse mode. See also :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>`.
  1531. .. rst-class:: classref-item-separator
  1532. ----
  1533. .. _class_DisplayServer_method_mouse_get_position:
  1534. .. rst-class:: classref-method
  1535. :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  1536. Returns the mouse cursor's current position in screen coordinates.
  1537. .. rst-class:: classref-item-separator
  1538. ----
  1539. .. _class_DisplayServer_method_mouse_set_mode:
  1540. .. rst-class:: classref-method
  1541. void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  1542. Sets the current mouse mode. See also :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>`.
  1543. .. rst-class:: classref-item-separator
  1544. ----
  1545. .. _class_DisplayServer_method_process_events:
  1546. .. rst-class:: classref-method
  1547. void **process_events** **(** **)**
  1548. 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>`.
  1549. .. rst-class:: classref-item-separator
  1550. ----
  1551. .. _class_DisplayServer_method_screen_get_dpi:
  1552. .. rst-class:: classref-method
  1553. :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1554. 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.
  1555. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1556. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1557. ::
  1558. ldpi - 120 dpi
  1559. mdpi - 160 dpi
  1560. hdpi - 240 dpi
  1561. xhdpi - 320 dpi
  1562. xxhdpi - 480 dpi
  1563. xxxhdpi - 640 dpi
  1564. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms.
  1565. .. rst-class:: classref-item-separator
  1566. ----
  1567. .. _class_DisplayServer_method_screen_get_image:
  1568. .. rst-class:: classref-method
  1569. :ref:`Image<class_Image>` **screen_get_image** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1570. Returns screenshot of the ``screen``.
  1571. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1572. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1573. .. rst-class:: classref-item-separator
  1574. ----
  1575. .. _class_DisplayServer_method_screen_get_max_scale:
  1576. .. rst-class:: classref-method
  1577. :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  1578. Returns the greatest scale factor of all screens.
  1579. \ **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.
  1580. \ **Note:** This method is implemented only on macOS.
  1581. .. rst-class:: classref-item-separator
  1582. ----
  1583. .. _class_DisplayServer_method_screen_get_orientation:
  1584. .. rst-class:: classref-method
  1585. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1586. Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>`.
  1587. \ **Note:** This method is implemented on Android and iOS.
  1588. .. rst-class:: classref-item-separator
  1589. ----
  1590. .. _class_DisplayServer_method_screen_get_pixel:
  1591. .. rst-class:: classref-method
  1592. :ref:`Color<class_Color>` **screen_get_pixel** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1593. Returns color of the display pixel at the ``position``.
  1594. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1595. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1596. .. rst-class:: classref-item-separator
  1597. ----
  1598. .. _class_DisplayServer_method_screen_get_position:
  1599. .. rst-class:: classref-method
  1600. :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1601. 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:
  1602. ::
  1603. * (0, 0) +-------+
  1604. | |
  1605. +-------------+ | |
  1606. | | | |
  1607. | | | |
  1608. +-------------+ +-------+
  1609. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1610. .. rst-class:: classref-item-separator
  1611. ----
  1612. .. _class_DisplayServer_method_screen_get_refresh_rate:
  1613. .. rst-class:: classref-method
  1614. :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1615. 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.
  1616. \ **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.
  1617. To fallback to a default refresh rate if the method fails, try:
  1618. ::
  1619. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  1620. if refresh_rate < 0:
  1621. refresh_rate = 60.0
  1622. .. rst-class:: classref-item-separator
  1623. ----
  1624. .. _class_DisplayServer_method_screen_get_scale:
  1625. .. rst-class:: classref-method
  1626. :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1627. Returns the scale factor of the specified screen by index.
  1628. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1629. \ **Note:** This method is implemented only on macOS.
  1630. .. rst-class:: classref-item-separator
  1631. ----
  1632. .. _class_DisplayServer_method_screen_get_size:
  1633. .. rst-class:: classref-method
  1634. :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1635. 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>`.
  1636. .. rst-class:: classref-item-separator
  1637. ----
  1638. .. _class_DisplayServer_method_screen_get_usable_rect:
  1639. .. rst-class:: classref-method
  1640. :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1641. 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>`.
  1642. .. rst-class:: classref-item-separator
  1643. ----
  1644. .. _class_DisplayServer_method_screen_is_kept_on:
  1645. .. rst-class:: classref-method
  1646. :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  1647. 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>`.
  1648. .. rst-class:: classref-item-separator
  1649. ----
  1650. .. _class_DisplayServer_method_screen_set_keep_on:
  1651. .. rst-class:: classref-method
  1652. void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  1653. 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>`.
  1654. .. rst-class:: classref-item-separator
  1655. ----
  1656. .. _class_DisplayServer_method_screen_set_orientation:
  1657. .. rst-class:: classref-method
  1658. void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  1659. Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>`.
  1660. \ **Note:** On iOS, this method has no effect if :ref:`ProjectSettings.display/window/handheld/orientation<class_ProjectSettings_property_display/window/handheld/orientation>` is not set to :ref:`SCREEN_SENSOR<class_DisplayServer_constant_SCREEN_SENSOR>`.
  1661. .. rst-class:: classref-item-separator
  1662. ----
  1663. .. _class_DisplayServer_method_set_icon:
  1664. .. rst-class:: classref-method
  1665. void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  1666. 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.
  1667. .. rst-class:: classref-item-separator
  1668. ----
  1669. .. _class_DisplayServer_method_set_native_icon:
  1670. .. rst-class:: classref-method
  1671. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1672. 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.
  1673. .. rst-class:: classref-item-separator
  1674. ----
  1675. .. _class_DisplayServer_method_tablet_get_current_driver:
  1676. .. rst-class:: classref-method
  1677. :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  1678. Returns current active tablet driver name.
  1679. \ **Note:** This method is implemented only on Windows.
  1680. .. rst-class:: classref-item-separator
  1681. ----
  1682. .. _class_DisplayServer_method_tablet_get_driver_count:
  1683. .. rst-class:: classref-method
  1684. :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  1685. Returns the total number of available tablet drivers.
  1686. \ **Note:** This method is implemented only on Windows.
  1687. .. rst-class:: classref-item-separator
  1688. ----
  1689. .. _class_DisplayServer_method_tablet_get_driver_name:
  1690. .. rst-class:: classref-method
  1691. :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1692. Returns the tablet driver name for the given index.
  1693. \ **Note:** This method is implemented only on Windows.
  1694. .. rst-class:: classref-item-separator
  1695. ----
  1696. .. _class_DisplayServer_method_tablet_set_current_driver:
  1697. .. rst-class:: classref-method
  1698. void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  1699. Set active tablet driver name.
  1700. \ **Note:** This method is implemented only on Windows.
  1701. .. rst-class:: classref-item-separator
  1702. ----
  1703. .. _class_DisplayServer_method_tts_get_voices:
  1704. .. rst-class:: classref-method
  1705. :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
  1706. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1707. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1708. - ``name`` is voice name.
  1709. - ``id`` is voice identifier.
  1710. - ``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.
  1711. 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.
  1712. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1713. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1714. .. rst-class:: classref-item-separator
  1715. ----
  1716. .. _class_DisplayServer_method_tts_get_voices_for_language:
  1717. .. rst-class:: classref-method
  1718. :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1719. Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
  1720. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1721. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1722. .. rst-class:: classref-item-separator
  1723. ----
  1724. .. _class_DisplayServer_method_tts_is_paused:
  1725. .. rst-class:: classref-method
  1726. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1727. Returns ``true`` if the synthesizer is in a paused state.
  1728. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1729. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1730. .. rst-class:: classref-item-separator
  1731. ----
  1732. .. _class_DisplayServer_method_tts_is_speaking:
  1733. .. rst-class:: classref-method
  1734. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1735. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1736. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1737. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1738. .. rst-class:: classref-item-separator
  1739. ----
  1740. .. _class_DisplayServer_method_tts_pause:
  1741. .. rst-class:: classref-method
  1742. void **tts_pause** **(** **)**
  1743. Puts the synthesizer into a paused state.
  1744. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1745. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1746. .. rst-class:: classref-item-separator
  1747. ----
  1748. .. _class_DisplayServer_method_tts_resume:
  1749. .. rst-class:: classref-method
  1750. void **tts_resume** **(** **)**
  1751. Resumes the synthesizer if it was paused.
  1752. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1753. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1754. .. rst-class:: classref-item-separator
  1755. ----
  1756. .. _class_DisplayServer_method_tts_set_utterance_callback:
  1757. .. rst-class:: classref-method
  1758. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
  1759. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1760. - :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.
  1761. - :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.
  1762. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1763. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1764. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1765. .. rst-class:: classref-item-separator
  1766. ----
  1767. .. _class_DisplayServer_method_tts_speak:
  1768. .. rst-class:: classref-method
  1769. 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 **)**
  1770. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1771. - ``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>`.
  1772. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1773. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1774. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1775. - ``utterance_id`` is passed as a parameter to the callback functions.
  1776. \ **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>`.
  1777. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1778. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1779. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1780. .. rst-class:: classref-item-separator
  1781. ----
  1782. .. _class_DisplayServer_method_tts_stop:
  1783. .. rst-class:: classref-method
  1784. void **tts_stop** **(** **)**
  1785. Stops synthesis in progress and removes all utterances from the queue.
  1786. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1787. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1788. .. rst-class:: classref-item-separator
  1789. ----
  1790. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  1791. .. rst-class:: classref-method
  1792. :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  1793. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1794. .. rst-class:: classref-item-separator
  1795. ----
  1796. .. _class_DisplayServer_method_virtual_keyboard_hide:
  1797. .. rst-class:: classref-method
  1798. void **virtual_keyboard_hide** **(** **)**
  1799. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1800. .. rst-class:: classref-item-separator
  1801. ----
  1802. .. _class_DisplayServer_method_virtual_keyboard_show:
  1803. .. rst-class:: classref-method
  1804. 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 **)**
  1805. Shows the virtual keyboard if the platform has one.
  1806. \ ``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).
  1807. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  1808. \ ``type`` parameter allows configuring which type of virtual keyboard to show.
  1809. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  1810. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  1811. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  1812. \ **Note:** This method is implemented on Android, iOS and Web.
  1813. .. rst-class:: classref-item-separator
  1814. ----
  1815. .. _class_DisplayServer_method_warp_mouse:
  1816. .. rst-class:: classref-method
  1817. void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1818. 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.
  1819. \ **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.
  1820. .. rst-class:: classref-item-separator
  1821. ----
  1822. .. _class_DisplayServer_method_window_can_draw:
  1823. .. rst-class:: classref-method
  1824. :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1825. 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``.
  1826. .. rst-class:: classref-item-separator
  1827. ----
  1828. .. _class_DisplayServer_method_window_get_active_popup:
  1829. .. rst-class:: classref-method
  1830. :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  1831. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  1832. .. rst-class:: classref-item-separator
  1833. ----
  1834. .. _class_DisplayServer_method_window_get_attached_instance_id:
  1835. .. rst-class:: classref-method
  1836. :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1837. 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.
  1838. .. rst-class:: classref-item-separator
  1839. ----
  1840. .. _class_DisplayServer_method_window_get_current_screen:
  1841. .. rst-class:: classref-method
  1842. :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1843. 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>`.
  1844. .. rst-class:: classref-item-separator
  1845. ----
  1846. .. _class_DisplayServer_method_window_get_flag:
  1847. .. rst-class:: classref-method
  1848. :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  1849. Returns the current value of the given window's ``flag``.
  1850. .. rst-class:: classref-item-separator
  1851. ----
  1852. .. _class_DisplayServer_method_window_get_max_size:
  1853. .. rst-class:: classref-method
  1854. :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1855. Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>`.
  1856. .. rst-class:: classref-item-separator
  1857. ----
  1858. .. _class_DisplayServer_method_window_get_min_size:
  1859. .. rst-class:: classref-method
  1860. :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1861. Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>`.
  1862. .. rst-class:: classref-item-separator
  1863. ----
  1864. .. _class_DisplayServer_method_window_get_mode:
  1865. .. rst-class:: classref-method
  1866. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1867. Returns the mode of the given window.
  1868. .. rst-class:: classref-item-separator
  1869. ----
  1870. .. _class_DisplayServer_method_window_get_native_handle:
  1871. .. rst-class:: classref-method
  1872. :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  1873. Returns internal structure pointers for use in plugins.
  1874. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows.
  1875. .. rst-class:: classref-item-separator
  1876. ----
  1877. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  1878. .. rst-class:: classref-method
  1879. :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  1880. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  1881. .. rst-class:: classref-item-separator
  1882. ----
  1883. .. _class_DisplayServer_method_window_get_position:
  1884. .. rst-class:: classref-method
  1885. :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1886. Returns the position of the client area of the given window on the screen.
  1887. .. rst-class:: classref-item-separator
  1888. ----
  1889. .. _class_DisplayServer_method_window_get_position_with_decorations:
  1890. .. rst-class:: classref-method
  1891. :ref:`Vector2i<class_Vector2i>` **window_get_position_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1892. 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>`.
  1893. .. rst-class:: classref-item-separator
  1894. ----
  1895. .. _class_DisplayServer_method_window_get_safe_title_margins:
  1896. .. rst-class:: classref-method
  1897. :ref:`Vector3i<class_Vector3i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1898. 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.
  1899. .. rst-class:: classref-item-separator
  1900. ----
  1901. .. _class_DisplayServer_method_window_get_size:
  1902. .. rst-class:: classref-method
  1903. :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1904. 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>`.
  1905. .. rst-class:: classref-item-separator
  1906. ----
  1907. .. _class_DisplayServer_method_window_get_size_with_decorations:
  1908. .. rst-class:: classref-method
  1909. :ref:`Vector2i<class_Vector2i>` **window_get_size_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1910. 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>`.
  1911. .. rst-class:: classref-item-separator
  1912. ----
  1913. .. _class_DisplayServer_method_window_get_vsync_mode:
  1914. .. rst-class:: classref-method
  1915. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1916. Returns the V-Sync mode of the given window.
  1917. .. rst-class:: classref-item-separator
  1918. ----
  1919. .. _class_DisplayServer_method_window_is_focused:
  1920. .. rst-class:: classref-method
  1921. :ref:`bool<class_bool>` **window_is_focused** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1922. Returns ``true`` if the window specified by ``window_id`` is focused.
  1923. .. rst-class:: classref-item-separator
  1924. ----
  1925. .. _class_DisplayServer_method_window_is_maximize_allowed:
  1926. .. rst-class:: classref-method
  1927. :ref:`bool<class_bool>` **window_is_maximize_allowed** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1928. Returns ``true`` if the given window can be maximized (the maximize button is enabled).
  1929. .. rst-class:: classref-item-separator
  1930. ----
  1931. .. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
  1932. .. rst-class:: classref-method
  1933. :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
  1934. Returns ``true``, if double-click on a window title should maximize it.
  1935. \ **Note:** This method is implemented only on macOS.
  1936. .. rst-class:: classref-item-separator
  1937. ----
  1938. .. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
  1939. .. rst-class:: classref-method
  1940. :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
  1941. Returns ``true``, if double-click on a window title should minimize it.
  1942. \ **Note:** This method is implemented only on macOS.
  1943. .. rst-class:: classref-item-separator
  1944. ----
  1945. .. _class_DisplayServer_method_window_move_to_foreground:
  1946. .. rst-class:: classref-method
  1947. void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  1948. Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows.
  1949. .. rst-class:: classref-item-separator
  1950. ----
  1951. .. _class_DisplayServer_method_window_request_attention:
  1952. .. rst-class:: classref-method
  1953. void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  1954. 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.
  1955. .. rst-class:: classref-item-separator
  1956. ----
  1957. .. _class_DisplayServer_method_window_set_current_screen:
  1958. .. rst-class:: classref-method
  1959. void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  1960. 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>`.
  1961. .. rst-class:: classref-item-separator
  1962. ----
  1963. .. _class_DisplayServer_method_window_set_drop_files_callback:
  1964. .. rst-class:: classref-method
  1965. void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1966. 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``.
  1967. \ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web.
  1968. .. rst-class:: classref-item-separator
  1969. ----
  1970. .. _class_DisplayServer_method_window_set_exclusive:
  1971. .. rst-class:: classref-method
  1972. void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  1973. 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.
  1974. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  1975. \ **Note:** This method is implemented on macOS and Windows.
  1976. .. rst-class:: classref-item-separator
  1977. ----
  1978. .. _class_DisplayServer_method_window_set_flag:
  1979. .. rst-class:: classref-method
  1980. void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  1981. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  1982. .. rst-class:: classref-item-separator
  1983. ----
  1984. .. _class_DisplayServer_method_window_set_ime_active:
  1985. .. rst-class:: classref-method
  1986. void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  1987. 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>`.
  1988. .. rst-class:: classref-item-separator
  1989. ----
  1990. .. _class_DisplayServer_method_window_set_ime_position:
  1991. .. rst-class:: classref-method
  1992. void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1993. 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``.
  1994. .. rst-class:: classref-item-separator
  1995. ----
  1996. .. _class_DisplayServer_method_window_set_input_event_callback:
  1997. .. rst-class:: classref-method
  1998. void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1999. Sets the ``callback`` that should be called when any :ref:`InputEvent<class_InputEvent>` is sent to the window specified by ``window_id``.
  2000. .. rst-class:: classref-item-separator
  2001. ----
  2002. .. _class_DisplayServer_method_window_set_input_text_callback:
  2003. .. rst-class:: classref-method
  2004. void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2005. Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``.
  2006. .. rst-class:: classref-item-separator
  2007. ----
  2008. .. _class_DisplayServer_method_window_set_max_size:
  2009. .. rst-class:: classref-method
  2010. void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  2011. 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>`.
  2012. \ **Note:** It's recommended to change this value using :ref:`Window.max_size<class_Window_property_max_size>` instead.
  2013. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  2014. .. rst-class:: classref-item-separator
  2015. ----
  2016. .. _class_DisplayServer_method_window_set_min_size:
  2017. .. rst-class:: classref-method
  2018. void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  2019. 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>`.
  2020. \ **Note:** It's recommended to change this value using :ref:`Window.min_size<class_Window_property_min_size>` instead.
  2021. \ **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.
  2022. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  2023. .. rst-class:: classref-item-separator
  2024. ----
  2025. .. _class_DisplayServer_method_window_set_mode:
  2026. .. rst-class:: classref-method
  2027. void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  2028. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  2029. \ **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.
  2030. .. rst-class:: classref-item-separator
  2031. ----
  2032. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  2033. .. rst-class:: classref-method
  2034. void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  2035. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  2036. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  2037. .. tabs::
  2038. .. code-tab:: gdscript
  2039. # Set region, using Path2D node.
  2040. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  2041. # Set region, using Polygon2D node.
  2042. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  2043. # Reset region to default.
  2044. DisplayServer.window_set_mouse_passthrough([])
  2045. .. code-tab:: csharp
  2046. // Set region, using Path2D node.
  2047. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  2048. // Set region, using Polygon2D node.
  2049. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  2050. // Reset region to default.
  2051. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  2052. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  2053. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  2054. .. rst-class:: classref-item-separator
  2055. ----
  2056. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  2057. .. rst-class:: classref-method
  2058. void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  2059. 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.
  2060. .. rst-class:: classref-item-separator
  2061. ----
  2062. .. _class_DisplayServer_method_window_set_position:
  2063. .. rst-class:: classref-method
  2064. void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  2065. 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:
  2066. ::
  2067. * (0, 0) +-------+
  2068. | |
  2069. +-------------+ | |
  2070. | | | |
  2071. | | | |
  2072. +-------------+ +-------+
  2073. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>` and :ref:`window_set_size<class_DisplayServer_method_window_set_size>`.
  2074. \ **Note:** It's recommended to change this value using :ref:`Window.position<class_Window_property_position>` instead.
  2075. .. rst-class:: classref-item-separator
  2076. ----
  2077. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  2078. .. rst-class:: classref-method
  2079. void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2080. Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized.
  2081. .. rst-class:: classref-item-separator
  2082. ----
  2083. .. _class_DisplayServer_method_window_set_size:
  2084. .. rst-class:: classref-method
  2085. void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  2086. 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>`.
  2087. \ **Note:** It's recommended to change this value using :ref:`Window.size<class_Window_property_size>` instead.
  2088. .. rst-class:: classref-item-separator
  2089. ----
  2090. .. _class_DisplayServer_method_window_set_title:
  2091. .. rst-class:: classref-method
  2092. void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  2093. Sets the title of the given window to ``title``.
  2094. \ **Note:** It's recommended to change this value using :ref:`Window.title<class_Window_property_title>` instead.
  2095. \ **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.
  2096. .. rst-class:: classref-item-separator
  2097. ----
  2098. .. _class_DisplayServer_method_window_set_transient:
  2099. .. rst-class:: classref-method
  2100. void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  2101. 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.
  2102. \ **Note:** It's recommended to change this value using :ref:`Window.transient<class_Window_property_transient>` instead.
  2103. \ **Note:** The behavior might be different depending on the platform.
  2104. .. rst-class:: classref-item-separator
  2105. ----
  2106. .. _class_DisplayServer_method_window_set_vsync_mode:
  2107. .. rst-class:: classref-method
  2108. void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  2109. 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>`.
  2110. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  2111. 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.
  2112. \ **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.
  2113. .. rst-class:: classref-item-separator
  2114. ----
  2115. .. _class_DisplayServer_method_window_set_window_buttons_offset:
  2116. .. rst-class:: classref-method
  2117. void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
  2118. 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.
  2119. \ **Note:** This flag is implemented only on macOS.
  2120. .. rst-class:: classref-item-separator
  2121. ----
  2122. .. _class_DisplayServer_method_window_set_window_event_callback:
  2123. .. rst-class:: classref-method
  2124. void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2125. Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``.
  2126. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2127. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2128. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2129. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2130. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2131. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2132. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`