class_displayserver.rst 321 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036
  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:`Dictionary<class_Dictionary>` | :ref:`global_menu_get_system_menu_roots<class_DisplayServer_method_global_menu_get_system_menu_roots>` **(** **)** |const| |
  123. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :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| |
  125. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :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| |
  127. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :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| |
  129. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_hidden<class_DisplayServer_method_global_menu_is_item_hidden>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  131. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | :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| |
  133. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  135. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | 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 **)** |
  137. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | 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 **)** |
  139. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | 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 **)** |
  141. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | 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 **)** |
  143. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | 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 **)** |
  145. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`global_menu_set_item_hidden<class_DisplayServer_method_global_menu_set_item_hidden>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` hidden **)** |
  147. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`global_menu_set_item_hover_callbacks<class_DisplayServer_method_global_menu_set_item_hover_callbacks>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)** |
  149. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | 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 **)** |
  151. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | 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 **)** |
  153. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | 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 **)** |
  155. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | 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 **)** |
  157. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | 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 **)** |
  159. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | 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 **)** |
  161. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | 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 **)** |
  163. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | 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 **)** |
  165. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | 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 **)** |
  167. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | 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 **)** |
  169. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`global_menu_set_popup_callbacks<class_DisplayServer_method_global_menu_set_popup_callbacks>` **(** :ref:`String<class_String>` menu_root, :ref:`Callable<class_Callable>` open_callback, :ref:`Callable<class_Callable>` close_callback **)** |
  171. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  173. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  175. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  177. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
  179. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
  181. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`bool<class_bool>` | :ref:`is_touchscreen_available<class_DisplayServer_method_is_touchscreen_available>` **(** **)** |const| |
  183. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  185. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | :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| |
  187. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | :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| |
  189. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  191. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  193. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  195. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  197. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  199. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  201. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  203. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  205. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  207. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  209. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`Image<class_Image>` | :ref:`screen_get_image<class_DisplayServer_method_screen_get_image>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  211. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  213. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  215. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | :ref:`Color<class_Color>` | :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  217. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  219. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  221. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  223. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  225. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  227. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  229. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  231. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  233. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  235. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  237. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  239. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  241. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  243. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  245. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
  247. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  249. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
  251. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
  253. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
  255. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
  257. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
  259. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | 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 **)** |
  261. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
  263. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  265. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  267. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | 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 **)** |
  269. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  271. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  273. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  275. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :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| |
  277. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  279. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :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| |
  281. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  283. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  285. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  287. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :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| |
  289. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  291. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  293. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | :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| |
  295. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | :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| |
  297. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  299. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | :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| |
  301. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_title_size<class_DisplayServer_method_window_get_title_size>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |const| |
  303. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | :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| |
  305. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | :ref:`bool<class_bool>` | :ref:`window_is_focused<class_DisplayServer_method_window_is_focused>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  307. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | :ref:`bool<class_bool>` | :ref:`window_is_maximize_allowed<class_DisplayServer_method_window_is_maximize_allowed>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  309. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
  311. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
  313. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  315. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  317. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | 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 **)** |
  319. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | 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 **)** |
  321. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  323. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | 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 **)** |
  325. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | 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 **)** |
  327. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | 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 **)** |
  329. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | 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 **)** |
  331. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | 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 **)** |
  333. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | 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 **)** |
  335. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | 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 **)** |
  337. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  339. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  340. | 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 **)** |
  341. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  342. | 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 **)** |
  343. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  344. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  345. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  346. | 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 **)** |
  347. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  348. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  349. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  350. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  351. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  352. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  353. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  354. | 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 **)** |
  355. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  356. | 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 **)** |
  357. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  358. | 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 **)** |
  359. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  360. .. rst-class:: classref-section-separator
  361. ----
  362. .. rst-class:: classref-descriptions-group
  363. Enumerations
  364. ------------
  365. .. _enum_DisplayServer_Feature:
  366. .. rst-class:: classref-enumeration
  367. enum **Feature**:
  368. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
  371. Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
  372. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SUBWINDOWS** = ``1``
  375. Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)**
  376. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TOUCHSCREEN** = ``2``
  379. Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web**
  380. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE** = ``3``
  383. Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web**
  384. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE_WARP** = ``4``
  387. 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)**
  388. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD** = ``5``
  391. 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**
  392. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  393. .. rst-class:: classref-enumeration-constant
  394. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_VIRTUAL_KEYBOARD** = ``6``
  395. Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web**
  396. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CURSOR_SHAPE** = ``7``
  399. Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web**
  400. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8``
  403. Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web**
  404. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_DIALOG** = ``9``
  407. Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS**
  408. .. _class_DisplayServer_constant_FEATURE_IME:
  409. .. rst-class:: classref-enumeration-constant
  410. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_IME** = ``10``
  411. 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)**
  412. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_WINDOW_TRANSPARENCY** = ``11``
  415. Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)**
  416. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  417. .. rst-class:: classref-enumeration-constant
  418. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_HIDPI** = ``12``
  419. 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**
  420. .. _class_DisplayServer_constant_FEATURE_ICON:
  421. .. rst-class:: classref-enumeration-constant
  422. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ICON** = ``13``
  423. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)**
  424. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  425. .. rst-class:: classref-enumeration-constant
  426. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_ICON** = ``14``
  427. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS**
  428. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  429. .. rst-class:: classref-enumeration-constant
  430. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ORIENTATION** = ``15``
  431. Display server supports changing the screen orientation. **Android, iOS**
  432. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  433. .. rst-class:: classref-enumeration-constant
  434. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SWAP_BUFFERS** = ``16``
  435. 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)**
  436. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  437. .. rst-class:: classref-enumeration-constant
  438. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD_PRIMARY** = ``18``
  439. Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD<class_DisplayServer_constant_FEATURE_CLIPBOARD>`. **Linux (X11)**
  440. .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
  441. .. rst-class:: classref-enumeration-constant
  442. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TEXT_TO_SPEECH** = ``19``
  443. Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web**
  444. .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
  445. .. rst-class:: classref-enumeration-constant
  446. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_EXTEND_TO_TITLE** = ``20``
  447. 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**
  448. .. _class_DisplayServer_constant_FEATURE_SCREEN_CAPTURE:
  449. .. rst-class:: classref-enumeration-constant
  450. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SCREEN_CAPTURE** = ``21``
  451. Display server supports reading screen pixels. See :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>`.
  452. .. rst-class:: classref-item-separator
  453. ----
  454. .. _enum_DisplayServer_MouseMode:
  455. .. rst-class:: classref-enumeration
  456. enum **MouseMode**:
  457. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  458. .. rst-class:: classref-enumeration-constant
  459. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_VISIBLE** = ``0``
  460. Makes the mouse cursor visible if it is hidden.
  461. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  462. .. rst-class:: classref-enumeration-constant
  463. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_HIDDEN** = ``1``
  464. Makes the mouse cursor hidden if it is visible.
  465. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CAPTURED** = ``2``
  468. Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
  469. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  470. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  471. .. rst-class:: classref-enumeration-constant
  472. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED** = ``3``
  473. Confines the mouse cursor to the game window, and make it visible.
  474. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  475. .. rst-class:: classref-enumeration-constant
  476. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED_HIDDEN** = ``4``
  477. Confines the mouse cursor to the game window, and make it hidden.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _enum_DisplayServer_ScreenOrientation:
  481. .. rst-class:: classref-enumeration
  482. enum **ScreenOrientation**:
  483. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  484. .. rst-class:: classref-enumeration-constant
  485. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_LANDSCAPE** = ``0``
  486. Default landscape orientation.
  487. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  488. .. rst-class:: classref-enumeration-constant
  489. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_PORTRAIT** = ``1``
  490. Default portrait orientation.
  491. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  492. .. rst-class:: classref-enumeration-constant
  493. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_LANDSCAPE** = ``2``
  494. Reverse landscape orientation (upside down).
  495. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  496. .. rst-class:: classref-enumeration-constant
  497. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_PORTRAIT** = ``3``
  498. Reverse portrait orientation (upside down).
  499. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  500. .. rst-class:: classref-enumeration-constant
  501. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_LANDSCAPE** = ``4``
  502. Automatic landscape orientation (default or reverse depending on sensor).
  503. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  504. .. rst-class:: classref-enumeration-constant
  505. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_PORTRAIT** = ``5``
  506. Automatic portrait orientation (default or reverse depending on sensor).
  507. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  508. .. rst-class:: classref-enumeration-constant
  509. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR** = ``6``
  510. Automatic landscape or portrait orientation (default or reverse depending on sensor).
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _enum_DisplayServer_VirtualKeyboardType:
  514. .. rst-class:: classref-enumeration
  515. enum **VirtualKeyboardType**:
  516. .. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
  517. .. rst-class:: classref-enumeration-constant
  518. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  519. Default text virtual keyboard.
  520. .. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
  521. .. rst-class:: classref-enumeration-constant
  522. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  523. Multiline virtual keyboard.
  524. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
  525. .. rst-class:: classref-enumeration-constant
  526. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  527. Virtual number keypad, useful for PIN entry.
  528. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  529. .. rst-class:: classref-enumeration-constant
  530. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  531. Virtual number keypad, useful for entering fractional numbers.
  532. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
  533. .. rst-class:: classref-enumeration-constant
  534. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  535. Virtual phone number keypad.
  536. .. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  537. .. rst-class:: classref-enumeration-constant
  538. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  539. Virtual keyboard with additional keys to assist with typing email addresses.
  540. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
  541. .. rst-class:: classref-enumeration-constant
  542. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  543. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  544. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
  545. .. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
  546. .. rst-class:: classref-enumeration-constant
  547. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  548. Virtual keyboard with additional keys to assist with typing URLs.
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _enum_DisplayServer_CursorShape:
  552. .. rst-class:: classref-enumeration
  553. enum **CursorShape**:
  554. .. _class_DisplayServer_constant_CURSOR_ARROW:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_ARROW** = ``0``
  557. 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>`.
  558. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_IBEAM** = ``1``
  561. 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>`.
  562. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  565. 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>`.
  566. .. _class_DisplayServer_constant_CURSOR_CROSS:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CROSS** = ``3``
  569. 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.
  570. .. _class_DisplayServer_constant_CURSOR_WAIT:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_WAIT** = ``4``
  573. 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>`.
  574. .. _class_DisplayServer_constant_CURSOR_BUSY:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BUSY** = ``5``
  577. 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>`.
  578. .. _class_DisplayServer_constant_CURSOR_DRAG:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_DRAG** = ``6``
  581. Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP<class_DisplayServer_constant_CURSOR_CAN_DROP>`.
  582. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  585. "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>`.
  586. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  589. 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.
  590. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSIZE** = ``9``
  593. 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>`.
  594. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  595. .. rst-class:: classref-enumeration-constant
  596. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSIZE** = ``10``
  597. 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>`.
  598. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  599. .. rst-class:: classref-enumeration-constant
  600. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  601. 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.
  602. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  603. .. rst-class:: classref-enumeration-constant
  604. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  605. 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.
  606. .. _class_DisplayServer_constant_CURSOR_MOVE:
  607. .. rst-class:: classref-enumeration-constant
  608. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MOVE** = ``13``
  609. Move cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be moved using the mouse.
  610. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  611. .. rst-class:: classref-enumeration-constant
  612. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSPLIT** = ``14``
  613. 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>`.
  614. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  615. .. rst-class:: classref-enumeration-constant
  616. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSPLIT** = ``15``
  617. 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>`.
  618. .. _class_DisplayServer_constant_CURSOR_HELP:
  619. .. rst-class:: classref-enumeration-constant
  620. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HELP** = ``16``
  621. 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.
  622. .. _class_DisplayServer_constant_CURSOR_MAX:
  623. .. rst-class:: classref-enumeration-constant
  624. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MAX** = ``17``
  625. Represents the size of the :ref:`CursorShape<enum_DisplayServer_CursorShape>` enum.
  626. .. rst-class:: classref-item-separator
  627. ----
  628. .. _enum_DisplayServer_FileDialogMode:
  629. .. rst-class:: classref-enumeration
  630. enum **FileDialogMode**:
  631. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_FILE:
  632. .. rst-class:: classref-enumeration-constant
  633. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_FILE** = ``0``
  634. The native file dialog allows selecting one, and only one file.
  635. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_FILES:
  636. .. rst-class:: classref-enumeration-constant
  637. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_FILES** = ``1``
  638. The native file dialog allows selecting multiple files.
  639. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_DIR:
  640. .. rst-class:: classref-enumeration-constant
  641. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_DIR** = ``2``
  642. The native file dialog only allows selecting a directory, disallowing the selection of any file.
  643. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_OPEN_ANY:
  644. .. rst-class:: classref-enumeration-constant
  645. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_OPEN_ANY** = ``3``
  646. The native file dialog allows selecting one file or directory.
  647. .. _class_DisplayServer_constant_FILE_DIALOG_MODE_SAVE_FILE:
  648. .. rst-class:: classref-enumeration-constant
  649. :ref:`FileDialogMode<enum_DisplayServer_FileDialogMode>` **FILE_DIALOG_MODE_SAVE_FILE** = ``4``
  650. The native file dialog will warn when a file exists.
  651. .. rst-class:: classref-item-separator
  652. ----
  653. .. _enum_DisplayServer_WindowMode:
  654. .. rst-class:: classref-enumeration
  655. enum **WindowMode**:
  656. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  657. .. rst-class:: classref-enumeration-constant
  658. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_WINDOWED** = ``0``
  659. Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
  660. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  661. .. rst-class:: classref-enumeration-constant
  662. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MINIMIZED** = ``1``
  663. 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.
  664. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  665. .. rst-class:: classref-enumeration-constant
  666. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MAXIMIZED** = ``2``
  667. 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.
  668. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  669. .. rst-class:: classref-enumeration-constant
  670. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_FULLSCREEN** = ``3``
  671. Full screen mode with full multi-window support.
  672. Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed.
  673. \ **On Windows:** Multi-window full-screen mode has a 1px border of the :ref:`ProjectSettings.rendering/environment/defaults/default_clear_color<class_ProjectSettings_property_rendering/environment/defaults/default_clear_color>` color.
  674. \ **On macOS:** A new desktop is used to display the running project.
  675. \ **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.
  676. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  677. .. rst-class:: classref-enumeration-constant
  678. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  679. 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).
  680. Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed.
  681. \ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
  682. \ **On macOS:** A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
  683. \ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
  684. \ **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.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _enum_DisplayServer_WindowFlags:
  688. .. rst-class:: classref-enumeration
  689. enum **WindowFlags**:
  690. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  691. .. rst-class:: classref-enumeration-constant
  692. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_RESIZE_DISABLED** = ``0``
  693. 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.
  694. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  695. .. rst-class:: classref-enumeration-constant
  696. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_BORDERLESS** = ``1``
  697. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  698. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  699. .. rst-class:: classref-enumeration-constant
  700. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_ALWAYS_ON_TOP** = ``2``
  701. The window is floating on top of all other windows. This flag is ignored for full-screen windows.
  702. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  703. .. rst-class:: classref-enumeration-constant
  704. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_TRANSPARENT** = ``3``
  705. The window background can be transparent.
  706. \ **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``.
  707. \ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  708. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  709. .. rst-class:: classref-enumeration-constant
  710. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_NO_FOCUS** = ``4``
  711. The window can't be focused. No-focus window will ignore all input, except mouse clicks.
  712. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  713. .. rst-class:: classref-enumeration-constant
  714. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_POPUP** = ``5``
  715. 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>`).
  716. .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
  717. .. rst-class:: classref-enumeration-constant
  718. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_EXTEND_TO_TITLE** = ``6``
  719. 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.
  720. Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
  721. 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.
  722. \ **Note:** This flag is implemented only on macOS.
  723. .. _class_DisplayServer_constant_WINDOW_FLAG_MOUSE_PASSTHROUGH:
  724. .. rst-class:: classref-enumeration-constant
  725. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MOUSE_PASSTHROUGH** = ``7``
  726. All mouse events are passed to the underlying window of the same application.
  727. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  728. .. rst-class:: classref-enumeration-constant
  729. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MAX** = ``8``
  730. Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _enum_DisplayServer_WindowEvent:
  734. .. rst-class:: classref-enumeration
  735. enum **WindowEvent**:
  736. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  737. .. rst-class:: classref-enumeration-constant
  738. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_ENTER** = ``0``
  739. Sent when the mouse pointer enters the window.
  740. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  741. .. rst-class:: classref-enumeration-constant
  742. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_EXIT** = ``1``
  743. Sent when the mouse pointer exits the window.
  744. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  745. .. rst-class:: classref-enumeration-constant
  746. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_IN** = ``2``
  747. Sent when the window grabs focus.
  748. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  749. .. rst-class:: classref-enumeration-constant
  750. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_OUT** = ``3``
  751. Sent when the window loses focus.
  752. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  753. .. rst-class:: classref-enumeration-constant
  754. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_CLOSE_REQUEST** = ``4``
  755. Sent when the user has attempted to close the window (e.g. close button is pressed).
  756. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  757. .. rst-class:: classref-enumeration-constant
  758. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_GO_BACK_REQUEST** = ``5``
  759. Sent when the device "Back" button is pressed.
  760. \ **Note:** This event is implemented only on Android.
  761. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  762. .. rst-class:: classref-enumeration-constant
  763. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_DPI_CHANGE** = ``6``
  764. Sent when the window is moved to the display with different DPI, or display DPI is changed.
  765. \ **Note:** This flag is implemented only on macOS.
  766. .. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
  767. .. rst-class:: classref-enumeration-constant
  768. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_TITLEBAR_CHANGE** = ``7``
  769. 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).
  770. \ **Note:** This flag is implemented only on macOS.
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _enum_DisplayServer_VSyncMode:
  774. .. rst-class:: classref-enumeration
  775. enum **VSyncMode**:
  776. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  777. .. rst-class:: classref-enumeration-constant
  778. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_DISABLED** = ``0``
  779. 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>`).
  780. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  781. .. rst-class:: classref-enumeration-constant
  782. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ENABLED** = ``1``
  783. 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>`).
  784. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  785. .. rst-class:: classref-enumeration-constant
  786. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ADAPTIVE** = ``2``
  787. 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.
  788. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  789. .. rst-class:: classref-enumeration-constant
  790. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_MAILBOX** = ``3``
  791. 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>`).
  792. 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.
  793. .. rst-class:: classref-item-separator
  794. ----
  795. .. _enum_DisplayServer_HandleType:
  796. .. rst-class:: classref-enumeration
  797. enum **HandleType**:
  798. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  799. .. rst-class:: classref-enumeration-constant
  800. :ref:`HandleType<enum_DisplayServer_HandleType>` **DISPLAY_HANDLE** = ``0``
  801. Display handle:
  802. - Linux (X11): ``X11::Display*`` for the display.
  803. - Android: ``EGLDisplay`` for the display.
  804. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  805. .. rst-class:: classref-enumeration-constant
  806. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_HANDLE** = ``1``
  807. Window handle:
  808. - Windows: ``HWND`` for the window.
  809. - Linux (X11): ``X11::Window*`` for the window.
  810. - macOS: ``NSWindow*`` for the window.
  811. - iOS: ``UIViewController*`` for the view controller.
  812. - Android: ``jObject`` for the activity.
  813. .. _class_DisplayServer_constant_WINDOW_VIEW:
  814. .. rst-class:: classref-enumeration-constant
  815. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_VIEW** = ``2``
  816. Window view:
  817. - Windows: ``HDC`` for the window (only with the GL Compatibility renderer).
  818. - macOS: ``NSView*`` for the window main view.
  819. - iOS: ``UIView*`` for the window main view.
  820. .. _class_DisplayServer_constant_OPENGL_CONTEXT:
  821. .. rst-class:: classref-enumeration-constant
  822. :ref:`HandleType<enum_DisplayServer_HandleType>` **OPENGL_CONTEXT** = ``3``
  823. OpenGL context (only with the GL Compatibility renderer):
  824. - Windows: ``HGLRC`` for the window (native GL), or ``EGLContext`` for the window (ANGLE).
  825. - Linux: ``GLXContext*`` for the window.
  826. - macOS: ``NSOpenGLContext*`` for the window (native GL), or ``EGLContext`` for the window (ANGLE).
  827. - Android: ``EGLContext`` for the window.
  828. .. rst-class:: classref-item-separator
  829. ----
  830. .. _enum_DisplayServer_TTSUtteranceEvent:
  831. .. rst-class:: classref-enumeration
  832. enum **TTSUtteranceEvent**:
  833. .. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
  834. .. rst-class:: classref-enumeration-constant
  835. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  836. Utterance has begun to be spoken.
  837. .. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
  838. .. rst-class:: classref-enumeration-constant
  839. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  840. Utterance was successfully finished.
  841. .. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
  842. .. rst-class:: classref-enumeration-constant
  843. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  844. Utterance was canceled, or TTS service was unable to process it.
  845. .. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
  846. .. rst-class:: classref-enumeration-constant
  847. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  848. Utterance reached a word or sentence boundary.
  849. .. rst-class:: classref-section-separator
  850. ----
  851. .. rst-class:: classref-descriptions-group
  852. Constants
  853. ---------
  854. .. _class_DisplayServer_constant_SCREEN_WITH_MOUSE_FOCUS:
  855. .. rst-class:: classref-constant
  856. **SCREEN_WITH_MOUSE_FOCUS** = ``-4``
  857. Represents the screen containing the mouse pointer.
  858. .. _class_DisplayServer_constant_SCREEN_WITH_KEYBOARD_FOCUS:
  859. .. rst-class:: classref-constant
  860. **SCREEN_WITH_KEYBOARD_FOCUS** = ``-3``
  861. Represents the screen containing the window with the keyboard focus.
  862. .. _class_DisplayServer_constant_SCREEN_PRIMARY:
  863. .. rst-class:: classref-constant
  864. **SCREEN_PRIMARY** = ``-2``
  865. Represents the primary screen.
  866. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  867. .. rst-class:: classref-constant
  868. **SCREEN_OF_MAIN_WINDOW** = ``-1``
  869. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
  870. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  871. .. rst-class:: classref-constant
  872. **MAIN_WINDOW_ID** = ``0``
  873. The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``.
  874. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  875. .. rst-class:: classref-constant
  876. **INVALID_WINDOW_ID** = ``-1``
  877. The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result.
  878. .. rst-class:: classref-section-separator
  879. ----
  880. .. rst-class:: classref-descriptions-group
  881. Method Descriptions
  882. -------------------
  883. .. _class_DisplayServer_method_clipboard_get:
  884. .. rst-class:: classref-method
  885. :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  886. Returns the user's clipboard as a string if possible.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_DisplayServer_method_clipboard_get_image:
  890. .. rst-class:: classref-method
  891. :ref:`Image<class_Image>` **clipboard_get_image** **(** **)** |const|
  892. Returns the user's clipboard as an image if possible.
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_DisplayServer_method_clipboard_get_primary:
  896. .. rst-class:: classref-method
  897. :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  898. 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.
  899. \ **Note:** This method is only implemented on Linux (X11).
  900. .. rst-class:: classref-item-separator
  901. ----
  902. .. _class_DisplayServer_method_clipboard_has:
  903. .. rst-class:: classref-method
  904. :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  905. Returns ``true`` if there is a text content on the user's clipboard.
  906. .. rst-class:: classref-item-separator
  907. ----
  908. .. _class_DisplayServer_method_clipboard_has_image:
  909. .. rst-class:: classref-method
  910. :ref:`bool<class_bool>` **clipboard_has_image** **(** **)** |const|
  911. Returns ``true`` if there is an image content on the user's clipboard.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_DisplayServer_method_clipboard_set:
  915. .. rst-class:: classref-method
  916. void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  917. Sets the user's clipboard content to the given string.
  918. .. rst-class:: classref-item-separator
  919. ----
  920. .. _class_DisplayServer_method_clipboard_set_primary:
  921. .. rst-class:: classref-method
  922. void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  923. 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.
  924. \ **Note:** This method is only implemented on Linux (X11).
  925. .. rst-class:: classref-item-separator
  926. ----
  927. .. _class_DisplayServer_method_cursor_get_shape:
  928. .. rst-class:: classref-method
  929. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  930. Returns the default mouse cursor shape set by :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  931. .. rst-class:: classref-item-separator
  932. ----
  933. .. _class_DisplayServer_method_cursor_set_custom_image:
  934. .. rst-class:: classref-method
  935. 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) **)**
  936. 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>`.
  937. .. rst-class:: classref-item-separator
  938. ----
  939. .. _class_DisplayServer_method_cursor_set_shape:
  940. .. rst-class:: classref-method
  941. void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  942. 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>`.
  943. .. rst-class:: classref-item-separator
  944. ----
  945. .. _class_DisplayServer_method_dialog_input_text:
  946. .. rst-class:: classref-method
  947. :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 **)**
  948. 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.
  949. \ **Note:** This method is implemented only on macOS.
  950. .. rst-class:: classref-item-separator
  951. ----
  952. .. _class_DisplayServer_method_dialog_show:
  953. .. rst-class:: classref-method
  954. :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 **)**
  955. 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.
  956. \ **Note:** This method is implemented only on macOS.
  957. .. rst-class:: classref-item-separator
  958. ----
  959. .. _class_DisplayServer_method_enable_for_stealing_focus:
  960. .. rst-class:: classref-method
  961. void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  962. 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.
  963. \ **Note:** This method is implemented only on Windows.
  964. .. rst-class:: classref-item-separator
  965. ----
  966. .. _class_DisplayServer_method_file_dialog_show:
  967. .. rst-class:: classref-method
  968. :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 **)**
  969. Displays OS native dialog for selecting files or directories in the file system.
  970. Callbacks have the following arguments: ``bool status, PackedStringArray selected_paths, int selected_filter_index``.
  971. \ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG<class_DisplayServer_constant_FEATURE_NATIVE_DIALOG>` feature.
  972. \ **Note:** This method is implemented on Linux, Windows and macOS.
  973. \ **Note:** ``current_directory`` might be ignored.
  974. \ **Note:** On Linux, ``show_hidden`` is ignored.
  975. \ **Note:** On macOS, native file dialogs have no title.
  976. \ **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.
  977. .. rst-class:: classref-item-separator
  978. ----
  979. .. _class_DisplayServer_method_force_process_and_drop_events:
  980. .. rst-class:: classref-method
  981. void **force_process_and_drop_events** **(** **)**
  982. Forces window manager processing while ignoring all :ref:`InputEvent<class_InputEvent>`\ s. See also :ref:`process_events<class_DisplayServer_method_process_events>`.
  983. \ **Note:** This method is implemented on Windows and macOS.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_DisplayServer_method_get_accent_color:
  987. .. rst-class:: classref-method
  988. :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
  989. Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
  990. \ **Note:** This method is implemented on macOS and Windows.
  991. .. rst-class:: classref-item-separator
  992. ----
  993. .. _class_DisplayServer_method_get_display_cutouts:
  994. .. rst-class:: classref-method
  995. :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
  996. 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>`.
  997. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  998. .. rst-class:: classref-item-separator
  999. ----
  1000. .. _class_DisplayServer_method_get_display_safe_area:
  1001. .. rst-class:: classref-method
  1002. :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
  1003. 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>`.
  1004. .. rst-class:: classref-item-separator
  1005. ----
  1006. .. _class_DisplayServer_method_get_keyboard_focus_screen:
  1007. .. rst-class:: classref-method
  1008. :ref:`int<class_int>` **get_keyboard_focus_screen** **(** **)** |const|
  1009. Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window.
  1010. .. rst-class:: classref-item-separator
  1011. ----
  1012. .. _class_DisplayServer_method_get_name:
  1013. .. rst-class:: classref-method
  1014. :ref:`String<class_String>` **get_name** **(** **)** |const|
  1015. 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).
  1016. 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>`).
  1017. .. rst-class:: classref-item-separator
  1018. ----
  1019. .. _class_DisplayServer_method_get_primary_screen:
  1020. .. rst-class:: classref-method
  1021. :ref:`int<class_int>` **get_primary_screen** **(** **)** |const|
  1022. Returns index of the primary screen.
  1023. .. rst-class:: classref-item-separator
  1024. ----
  1025. .. _class_DisplayServer_method_get_screen_count:
  1026. .. rst-class:: classref-method
  1027. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  1028. Returns the number of displays available.
  1029. .. rst-class:: classref-item-separator
  1030. ----
  1031. .. _class_DisplayServer_method_get_screen_from_rect:
  1032. .. rst-class:: classref-method
  1033. :ref:`int<class_int>` **get_screen_from_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |const|
  1034. Returns index of the screen which contains specified rectangle.
  1035. .. rst-class:: classref-item-separator
  1036. ----
  1037. .. _class_DisplayServer_method_get_swap_cancel_ok:
  1038. .. rst-class:: classref-method
  1039. :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  1040. 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>`.
  1041. \ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show<class_DisplayServer_method_dialog_show>`.
  1042. .. rst-class:: classref-item-separator
  1043. ----
  1044. .. _class_DisplayServer_method_get_window_at_screen_position:
  1045. .. rst-class:: classref-method
  1046. :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1047. 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:
  1048. ::
  1049. * (0, 0) +-------+
  1050. | |
  1051. +-------------+ | |
  1052. | | | |
  1053. | | | |
  1054. +-------------+ +-------+
  1055. .. rst-class:: classref-item-separator
  1056. ----
  1057. .. _class_DisplayServer_method_get_window_list:
  1058. .. rst-class:: classref-method
  1059. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  1060. Returns the list of Godot window IDs belonging to this process.
  1061. \ **Note:** Native dialogs are not included in this list.
  1062. .. rst-class:: classref-item-separator
  1063. ----
  1064. .. _class_DisplayServer_method_global_menu_add_check_item:
  1065. .. rst-class:: classref-method
  1066. :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 **)**
  1067. Adds a new checkable item with text ``label`` 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. "_apple" - Apple menu (macOS, custom items added before "Services").
  1077. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1078. "_help" - Help menu (macOS).
  1079. .. rst-class:: classref-item-separator
  1080. ----
  1081. .. _class_DisplayServer_method_global_menu_add_icon_check_item:
  1082. .. rst-class:: classref-method
  1083. :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 **)**
  1084. Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1085. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1086. 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`).
  1087. \ **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``.
  1088. \ **Note:** This method is implemented only on macOS.
  1089. \ **Supported system menu IDs:**\
  1090. ::
  1091. "_main" - Main menu (macOS).
  1092. "_dock" - Dock popup menu (macOS).
  1093. "_apple" - Apple menu (macOS, custom items added before "Services").
  1094. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1095. "_help" - Help menu (macOS).
  1096. .. rst-class:: classref-item-separator
  1097. ----
  1098. .. _class_DisplayServer_method_global_menu_add_icon_item:
  1099. .. rst-class:: classref-method
  1100. :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 **)**
  1101. Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1102. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1103. 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`).
  1104. \ **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``.
  1105. \ **Note:** This method is implemented only on macOS.
  1106. \ **Supported system menu IDs:**\
  1107. ::
  1108. "_main" - Main menu (macOS).
  1109. "_dock" - Dock popup menu (macOS).
  1110. "_apple" - Apple menu (macOS, custom items added before "Services").
  1111. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1112. "_help" - Help menu (macOS).
  1113. .. rst-class:: classref-item-separator
  1114. ----
  1115. .. _class_DisplayServer_method_global_menu_add_icon_radio_check_item:
  1116. .. rst-class:: classref-method
  1117. :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 **)**
  1118. Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1119. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1120. 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`).
  1121. \ **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.
  1122. \ **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``.
  1123. \ **Note:** This method is implemented only on macOS.
  1124. \ **Supported system menu IDs:**\
  1125. ::
  1126. "_main" - Main menu (macOS).
  1127. "_dock" - Dock popup menu (macOS).
  1128. "_apple" - Apple menu (macOS, custom items added before "Services").
  1129. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1130. "_help" - Help menu (macOS).
  1131. .. rst-class:: classref-item-separator
  1132. ----
  1133. .. _class_DisplayServer_method_global_menu_add_item:
  1134. .. rst-class:: classref-method
  1135. :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 **)**
  1136. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1137. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1138. 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`).
  1139. \ **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``.
  1140. \ **Note:** This method is implemented only on macOS.
  1141. \ **Supported system menu IDs:**\
  1142. ::
  1143. "_main" - Main menu (macOS).
  1144. "_dock" - Dock popup menu (macOS).
  1145. "_apple" - Apple menu (macOS, custom items added before "Services").
  1146. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1147. "_help" - Help menu (macOS).
  1148. .. rst-class:: classref-item-separator
  1149. ----
  1150. .. _class_DisplayServer_method_global_menu_add_multistate_item:
  1151. .. rst-class:: classref-method
  1152. :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 **)**
  1153. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1154. 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``.
  1155. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1156. 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`).
  1157. \ **Note:** By default, there's no indication of the current item state, it should be changed manually.
  1158. \ **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``.
  1159. \ **Note:** This method is implemented only on macOS.
  1160. \ **Supported system menu IDs:**\
  1161. ::
  1162. "_main" - Main menu (macOS).
  1163. "_dock" - Dock popup menu (macOS).
  1164. "_apple" - Apple menu (macOS, custom items added before "Services").
  1165. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1166. "_help" - Help menu (macOS).
  1167. .. rst-class:: classref-item-separator
  1168. ----
  1169. .. _class_DisplayServer_method_global_menu_add_radio_check_item:
  1170. .. rst-class:: classref-method
  1171. :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 **)**
  1172. Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1173. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1174. 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`).
  1175. \ **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.
  1176. \ **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``.
  1177. \ **Note:** This method is implemented only on macOS.
  1178. \ **Supported system menu IDs:**\
  1179. ::
  1180. "_main" - Main menu (macOS).
  1181. "_dock" - Dock popup menu (macOS).
  1182. "_apple" - Apple menu (macOS, custom items added before "Services").
  1183. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1184. "_help" - Help menu (macOS).
  1185. .. rst-class:: classref-item-separator
  1186. ----
  1187. .. _class_DisplayServer_method_global_menu_add_separator:
  1188. .. rst-class:: classref-method
  1189. :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
  1190. Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
  1191. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1192. \ **Note:** This method is implemented only on macOS.
  1193. \ **Supported system menu IDs:**\
  1194. ::
  1195. "_main" - Main menu (macOS).
  1196. "_dock" - Dock popup menu (macOS).
  1197. "_apple" - Apple menu (macOS, custom items added before "Services").
  1198. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1199. "_help" - Help menu (macOS).
  1200. .. rst-class:: classref-item-separator
  1201. ----
  1202. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  1203. .. rst-class:: classref-method
  1204. :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 **)**
  1205. 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.
  1206. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1207. \ **Note:** This method is implemented only on macOS.
  1208. \ **Supported system menu IDs:**\
  1209. ::
  1210. "_main" - Main menu (macOS).
  1211. "_dock" - Dock popup menu (macOS).
  1212. "_apple" - Apple menu (macOS, custom items added before "Services").
  1213. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1214. "_help" - Help menu (macOS).
  1215. .. rst-class:: classref-item-separator
  1216. ----
  1217. .. _class_DisplayServer_method_global_menu_clear:
  1218. .. rst-class:: classref-method
  1219. void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  1220. Removes all items from the global menu with ID ``menu_root``.
  1221. \ **Note:** This method is implemented only on macOS.
  1222. \ **Supported system menu IDs:**\
  1223. ::
  1224. "_main" - Main menu (macOS).
  1225. "_dock" - Dock popup menu (macOS).
  1226. "_apple" - Apple menu (macOS, custom items added before "Services").
  1227. "_window" - Window menu (macOS, custom items added after "Bring All to Front").
  1228. "_help" - Help menu (macOS).
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_DisplayServer_method_global_menu_get_item_accelerator:
  1232. .. rst-class:: classref-method
  1233. :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1234. 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.
  1235. \ **Note:** This method is implemented only on macOS.
  1236. .. rst-class:: classref-item-separator
  1237. ----
  1238. .. _class_DisplayServer_method_global_menu_get_item_callback:
  1239. .. rst-class:: classref-method
  1240. :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1241. Returns the callback of the item at index ``idx``.
  1242. \ **Note:** This method is implemented only on macOS.
  1243. .. rst-class:: classref-item-separator
  1244. ----
  1245. .. _class_DisplayServer_method_global_menu_get_item_count:
  1246. .. rst-class:: classref-method
  1247. :ref:`int<class_int>` **global_menu_get_item_count** **(** :ref:`String<class_String>` menu_root **)** |const|
  1248. Returns number of items in the global menu with ID ``menu_root``.
  1249. \ **Note:** This method is implemented only on macOS.
  1250. .. rst-class:: classref-item-separator
  1251. ----
  1252. .. _class_DisplayServer_method_global_menu_get_item_icon:
  1253. .. rst-class:: classref-method
  1254. :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1255. Returns the icon of the item at index ``idx``.
  1256. \ **Note:** This method is implemented only on macOS.
  1257. .. rst-class:: classref-item-separator
  1258. ----
  1259. .. _class_DisplayServer_method_global_menu_get_item_indentation_level:
  1260. .. rst-class:: classref-method
  1261. :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1262. Returns the horizontal offset of the item at the given ``idx``.
  1263. \ **Note:** This method is implemented only on macOS.
  1264. .. rst-class:: classref-item-separator
  1265. ----
  1266. .. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
  1267. .. rst-class:: classref-method
  1268. :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
  1269. 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.
  1270. \ **Note:** This method is implemented only on macOS.
  1271. .. rst-class:: classref-item-separator
  1272. ----
  1273. .. _class_DisplayServer_method_global_menu_get_item_index_from_text:
  1274. .. rst-class:: classref-method
  1275. :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
  1276. 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.
  1277. \ **Note:** This method is implemented only on macOS.
  1278. .. rst-class:: classref-item-separator
  1279. ----
  1280. .. _class_DisplayServer_method_global_menu_get_item_key_callback:
  1281. .. rst-class:: classref-method
  1282. :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1283. Returns the callback of the item accelerator at index ``idx``.
  1284. \ **Note:** This method is implemented only on macOS.
  1285. .. rst-class:: classref-item-separator
  1286. ----
  1287. .. _class_DisplayServer_method_global_menu_get_item_max_states:
  1288. .. rst-class:: classref-method
  1289. :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1290. 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.
  1291. \ **Note:** This method is implemented only on macOS.
  1292. .. rst-class:: classref-item-separator
  1293. ----
  1294. .. _class_DisplayServer_method_global_menu_get_item_state:
  1295. .. rst-class:: classref-method
  1296. :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1297. Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1298. \ **Note:** This method is implemented only on macOS.
  1299. .. rst-class:: classref-item-separator
  1300. ----
  1301. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  1302. .. rst-class:: classref-method
  1303. :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1304. 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.
  1305. \ **Note:** This method is implemented only on macOS.
  1306. .. rst-class:: classref-item-separator
  1307. ----
  1308. .. _class_DisplayServer_method_global_menu_get_item_tag:
  1309. .. rst-class:: classref-method
  1310. :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1311. 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.
  1312. \ **Note:** This method is implemented only on macOS.
  1313. .. rst-class:: classref-item-separator
  1314. ----
  1315. .. _class_DisplayServer_method_global_menu_get_item_text:
  1316. .. rst-class:: classref-method
  1317. :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1318. Returns the text of the item at index ``idx``.
  1319. \ **Note:** This method is implemented only on macOS.
  1320. .. rst-class:: classref-item-separator
  1321. ----
  1322. .. _class_DisplayServer_method_global_menu_get_item_tooltip:
  1323. .. rst-class:: classref-method
  1324. :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1325. Returns the tooltip associated with the specified index ``idx``.
  1326. \ **Note:** This method is implemented only on macOS.
  1327. .. rst-class:: classref-item-separator
  1328. ----
  1329. .. _class_DisplayServer_method_global_menu_get_system_menu_roots:
  1330. .. rst-class:: classref-method
  1331. :ref:`Dictionary<class_Dictionary>` **global_menu_get_system_menu_roots** **(** **)** |const|
  1332. Returns Dictionary of supported system menu IDs and names.
  1333. \ **Note:** This method is implemented only on macOS.
  1334. .. rst-class:: classref-item-separator
  1335. ----
  1336. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  1337. .. rst-class:: classref-method
  1338. :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1339. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  1340. \ **Note:** This method is implemented only on macOS.
  1341. .. rst-class:: classref-item-separator
  1342. ----
  1343. .. _class_DisplayServer_method_global_menu_is_item_checked:
  1344. .. rst-class:: classref-method
  1345. :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1346. Returns ``true`` if the item at index ``idx`` is checked.
  1347. \ **Note:** This method is implemented only on macOS.
  1348. .. rst-class:: classref-item-separator
  1349. ----
  1350. .. _class_DisplayServer_method_global_menu_is_item_disabled:
  1351. .. rst-class:: classref-method
  1352. :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1353. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  1354. See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
  1355. \ **Note:** This method is implemented only on macOS.
  1356. .. rst-class:: classref-item-separator
  1357. ----
  1358. .. _class_DisplayServer_method_global_menu_is_item_hidden:
  1359. .. rst-class:: classref-method
  1360. :ref:`bool<class_bool>` **global_menu_is_item_hidden** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1361. Returns ``true`` if the item at index ``idx`` is hidden.
  1362. See :ref:`global_menu_set_item_hidden<class_DisplayServer_method_global_menu_set_item_hidden>` for more info on how to hide an item.
  1363. \ **Note:** This method is implemented only on macOS.
  1364. .. rst-class:: classref-item-separator
  1365. ----
  1366. .. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
  1367. .. rst-class:: classref-method
  1368. :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1369. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  1370. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1371. \ **Note:** This method is implemented only on macOS.
  1372. .. rst-class:: classref-item-separator
  1373. ----
  1374. .. _class_DisplayServer_method_global_menu_remove_item:
  1375. .. rst-class:: classref-method
  1376. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  1377. Removes the item at index ``idx`` from the global menu ``menu_root``.
  1378. \ **Note:** The indices of items after the removed item will be shifted by one.
  1379. \ **Note:** This method is implemented only on macOS.
  1380. .. rst-class:: classref-item-separator
  1381. ----
  1382. .. _class_DisplayServer_method_global_menu_set_item_accelerator:
  1383. .. rst-class:: classref-method
  1384. void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
  1385. 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`).
  1386. \ **Note:** This method is implemented only on macOS.
  1387. .. rst-class:: classref-item-separator
  1388. ----
  1389. .. _class_DisplayServer_method_global_menu_set_item_callback:
  1390. .. rst-class:: classref-method
  1391. void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1392. Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
  1393. \ **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.
  1394. \ **Note:** This method is implemented only on macOS.
  1395. .. rst-class:: classref-item-separator
  1396. ----
  1397. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  1398. .. rst-class:: classref-method
  1399. void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1400. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  1401. \ **Note:** This method is implemented only on macOS.
  1402. .. rst-class:: classref-item-separator
  1403. ----
  1404. .. _class_DisplayServer_method_global_menu_set_item_checked:
  1405. .. rst-class:: classref-method
  1406. void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  1407. Sets the checkstate status of the item at index ``idx``.
  1408. \ **Note:** This method is implemented only on macOS.
  1409. .. rst-class:: classref-item-separator
  1410. ----
  1411. .. _class_DisplayServer_method_global_menu_set_item_disabled:
  1412. .. rst-class:: classref-method
  1413. void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  1414. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  1415. \ **Note:** This method is implemented only on macOS.
  1416. .. rst-class:: classref-item-separator
  1417. ----
  1418. .. _class_DisplayServer_method_global_menu_set_item_hidden:
  1419. .. rst-class:: classref-method
  1420. void **global_menu_set_item_hidden** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` hidden **)**
  1421. Hides/shows the item at index ``idx``. When it is hidden, an item does not appear in a menu and its action cannot be invoked.
  1422. \ **Note:** This method is implemented only on macOS.
  1423. .. rst-class:: classref-item-separator
  1424. ----
  1425. .. _class_DisplayServer_method_global_menu_set_item_hover_callbacks:
  1426. .. rst-class:: classref-method
  1427. void **global_menu_set_item_hover_callbacks** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1428. Sets the callback of the item at index ``idx``. The callback is emitted when an item is hovered.
  1429. \ **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.
  1430. \ **Note:** This method is implemented only on macOS.
  1431. .. rst-class:: classref-item-separator
  1432. ----
  1433. .. _class_DisplayServer_method_global_menu_set_item_icon:
  1434. .. rst-class:: classref-method
  1435. void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  1436. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  1437. \ **Note:** This method is implemented only on macOS.
  1438. \ **Note:** This method is not supported by macOS "_dock" menu items.
  1439. .. rst-class:: classref-item-separator
  1440. ----
  1441. .. _class_DisplayServer_method_global_menu_set_item_indentation_level:
  1442. .. rst-class:: classref-method
  1443. void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
  1444. Sets the horizontal offset of the item at the given ``idx``.
  1445. \ **Note:** This method is implemented only on macOS.
  1446. .. rst-class:: classref-item-separator
  1447. ----
  1448. .. _class_DisplayServer_method_global_menu_set_item_key_callback:
  1449. .. rst-class:: classref-method
  1450. void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
  1451. Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
  1452. \ **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.
  1453. \ **Note:** This method is implemented only on macOS.
  1454. .. rst-class:: classref-item-separator
  1455. ----
  1456. .. _class_DisplayServer_method_global_menu_set_item_max_states:
  1457. .. rst-class:: classref-method
  1458. void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
  1459. 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.
  1460. \ **Note:** This method is implemented only on macOS.
  1461. .. rst-class:: classref-item-separator
  1462. ----
  1463. .. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
  1464. .. rst-class:: classref-method
  1465. void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1466. 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.
  1467. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1468. \ **Note:** This method is implemented only on macOS.
  1469. .. rst-class:: classref-item-separator
  1470. ----
  1471. .. _class_DisplayServer_method_global_menu_set_item_state:
  1472. .. rst-class:: classref-method
  1473. void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  1474. Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1475. \ **Note:** This method is implemented only on macOS.
  1476. .. rst-class:: classref-item-separator
  1477. ----
  1478. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  1479. .. rst-class:: classref-method
  1480. void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  1481. 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.
  1482. \ **Note:** This method is implemented only on macOS.
  1483. .. rst-class:: classref-item-separator
  1484. ----
  1485. .. _class_DisplayServer_method_global_menu_set_item_tag:
  1486. .. rst-class:: classref-method
  1487. void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  1488. 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.
  1489. \ **Note:** This method is implemented only on macOS.
  1490. .. rst-class:: classref-item-separator
  1491. ----
  1492. .. _class_DisplayServer_method_global_menu_set_item_text:
  1493. .. rst-class:: classref-method
  1494. void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  1495. Sets the text of the item at index ``idx``.
  1496. \ **Note:** This method is implemented only on macOS.
  1497. .. rst-class:: classref-item-separator
  1498. ----
  1499. .. _class_DisplayServer_method_global_menu_set_item_tooltip:
  1500. .. rst-class:: classref-method
  1501. void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  1502. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  1503. \ **Note:** This method is implemented only on macOS.
  1504. .. rst-class:: classref-item-separator
  1505. ----
  1506. .. _class_DisplayServer_method_global_menu_set_popup_callbacks:
  1507. .. rst-class:: classref-method
  1508. void **global_menu_set_popup_callbacks** **(** :ref:`String<class_String>` menu_root, :ref:`Callable<class_Callable>` open_callback, :ref:`Callable<class_Callable>` close_callback **)**
  1509. Registers callables to emit when the menu is respectively about to show or closed.
  1510. .. rst-class:: classref-item-separator
  1511. ----
  1512. .. _class_DisplayServer_method_has_feature:
  1513. .. rst-class:: classref-method
  1514. :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  1515. Returns ``true`` if the specified ``feature`` is supported by the current **DisplayServer**, ``false`` otherwise.
  1516. .. rst-class:: classref-item-separator
  1517. ----
  1518. .. _class_DisplayServer_method_ime_get_selection:
  1519. .. rst-class:: classref-method
  1520. :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  1521. 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.
  1522. \ **Note:** This method is implemented only on macOS.
  1523. .. rst-class:: classref-item-separator
  1524. ----
  1525. .. _class_DisplayServer_method_ime_get_text:
  1526. .. rst-class:: classref-method
  1527. :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  1528. Returns the composition string contained within the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ window.
  1529. \ **Note:** This method is implemented only on macOS.
  1530. .. rst-class:: classref-item-separator
  1531. ----
  1532. .. _class_DisplayServer_method_is_dark_mode:
  1533. .. rst-class:: classref-method
  1534. :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
  1535. Returns ``true`` if OS is using dark mode.
  1536. \ **Note:** This method is implemented on Android, iOS, macOS, Windows, and Linux (X11).
  1537. .. rst-class:: classref-item-separator
  1538. ----
  1539. .. _class_DisplayServer_method_is_dark_mode_supported:
  1540. .. rst-class:: classref-method
  1541. :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
  1542. Returns ``true`` if OS supports dark mode.
  1543. \ **Note:** This method is implemented on Android, iOS, macOS, Windows, and Linux (X11).
  1544. .. rst-class:: classref-item-separator
  1545. ----
  1546. .. _class_DisplayServer_method_is_touchscreen_available:
  1547. .. rst-class:: classref-method
  1548. :ref:`bool<class_bool>` **is_touchscreen_available** **(** **)** |const|
  1549. 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``.
  1550. .. rst-class:: classref-item-separator
  1551. ----
  1552. .. _class_DisplayServer_method_keyboard_get_current_layout:
  1553. .. rst-class:: classref-method
  1554. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1555. Returns active keyboard layout index.
  1556. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1557. .. rst-class:: classref-item-separator
  1558. ----
  1559. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  1560. .. rst-class:: classref-method
  1561. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1562. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  1563. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1564. .. rst-class:: classref-item-separator
  1565. ----
  1566. .. _class_DisplayServer_method_keyboard_get_label_from_physical:
  1567. .. rst-class:: classref-method
  1568. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_label_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1569. Converts a physical (US QWERTY) ``keycode`` to localized label printed on the key in the active keyboard layout.
  1570. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1571. .. rst-class:: classref-item-separator
  1572. ----
  1573. .. _class_DisplayServer_method_keyboard_get_layout_count:
  1574. .. rst-class:: classref-method
  1575. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1576. Returns the number of keyboard layouts.
  1577. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1578. .. rst-class:: classref-item-separator
  1579. ----
  1580. .. _class_DisplayServer_method_keyboard_get_layout_language:
  1581. .. rst-class:: classref-method
  1582. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1583. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1584. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1585. .. rst-class:: classref-item-separator
  1586. ----
  1587. .. _class_DisplayServer_method_keyboard_get_layout_name:
  1588. .. rst-class:: classref-method
  1589. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1590. Returns the localized name of the keyboard layout at position ``index``.
  1591. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1592. .. rst-class:: classref-item-separator
  1593. ----
  1594. .. _class_DisplayServer_method_keyboard_set_current_layout:
  1595. .. rst-class:: classref-method
  1596. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1597. Sets the active keyboard layout.
  1598. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1599. .. rst-class:: classref-item-separator
  1600. ----
  1601. .. _class_DisplayServer_method_mouse_get_button_state:
  1602. .. rst-class:: classref-method
  1603. |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> **mouse_get_button_state** **(** **)** |const|
  1604. 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>`.
  1605. .. rst-class:: classref-item-separator
  1606. ----
  1607. .. _class_DisplayServer_method_mouse_get_mode:
  1608. .. rst-class:: classref-method
  1609. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  1610. Returns the current mouse mode. See also :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>`.
  1611. .. rst-class:: classref-item-separator
  1612. ----
  1613. .. _class_DisplayServer_method_mouse_get_position:
  1614. .. rst-class:: classref-method
  1615. :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  1616. Returns the mouse cursor's current position in screen coordinates.
  1617. .. rst-class:: classref-item-separator
  1618. ----
  1619. .. _class_DisplayServer_method_mouse_set_mode:
  1620. .. rst-class:: classref-method
  1621. void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  1622. Sets the current mouse mode. See also :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>`.
  1623. .. rst-class:: classref-item-separator
  1624. ----
  1625. .. _class_DisplayServer_method_process_events:
  1626. .. rst-class:: classref-method
  1627. void **process_events** **(** **)**
  1628. 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>`.
  1629. .. rst-class:: classref-item-separator
  1630. ----
  1631. .. _class_DisplayServer_method_screen_get_dpi:
  1632. .. rst-class:: classref-method
  1633. :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1634. 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.
  1635. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1636. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1637. ::
  1638. ldpi - 120 dpi
  1639. mdpi - 160 dpi
  1640. hdpi - 240 dpi
  1641. xhdpi - 320 dpi
  1642. xxhdpi - 480 dpi
  1643. xxxhdpi - 640 dpi
  1644. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms.
  1645. .. rst-class:: classref-item-separator
  1646. ----
  1647. .. _class_DisplayServer_method_screen_get_image:
  1648. .. rst-class:: classref-method
  1649. :ref:`Image<class_Image>` **screen_get_image** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1650. Returns screenshot of the ``screen``.
  1651. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1652. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1653. .. rst-class:: classref-item-separator
  1654. ----
  1655. .. _class_DisplayServer_method_screen_get_max_scale:
  1656. .. rst-class:: classref-method
  1657. :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  1658. Returns the greatest scale factor of all screens.
  1659. \ **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.
  1660. \ **Note:** This method is implemented only on macOS.
  1661. .. rst-class:: classref-item-separator
  1662. ----
  1663. .. _class_DisplayServer_method_screen_get_orientation:
  1664. .. rst-class:: classref-method
  1665. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1666. Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>`.
  1667. \ **Note:** This method is implemented on Android and iOS.
  1668. .. rst-class:: classref-item-separator
  1669. ----
  1670. .. _class_DisplayServer_method_screen_get_pixel:
  1671. .. rst-class:: classref-method
  1672. :ref:`Color<class_Color>` **screen_get_pixel** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1673. Returns color of the display pixel at the ``position``.
  1674. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1675. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1676. .. rst-class:: classref-item-separator
  1677. ----
  1678. .. _class_DisplayServer_method_screen_get_position:
  1679. .. rst-class:: classref-method
  1680. :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1681. 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:
  1682. ::
  1683. * (0, 0) +-------+
  1684. | |
  1685. +-------------+ | |
  1686. | | | |
  1687. | | | |
  1688. +-------------+ +-------+
  1689. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1690. .. rst-class:: classref-item-separator
  1691. ----
  1692. .. _class_DisplayServer_method_screen_get_refresh_rate:
  1693. .. rst-class:: classref-method
  1694. :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1695. 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.
  1696. \ **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.
  1697. To fallback to a default refresh rate if the method fails, try:
  1698. ::
  1699. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  1700. if refresh_rate < 0:
  1701. refresh_rate = 60.0
  1702. .. rst-class:: classref-item-separator
  1703. ----
  1704. .. _class_DisplayServer_method_screen_get_scale:
  1705. .. rst-class:: classref-method
  1706. :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1707. Returns the scale factor of the specified screen by index.
  1708. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1709. \ **Note:** This method is implemented only on macOS.
  1710. .. rst-class:: classref-item-separator
  1711. ----
  1712. .. _class_DisplayServer_method_screen_get_size:
  1713. .. rst-class:: classref-method
  1714. :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1715. 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>`.
  1716. .. rst-class:: classref-item-separator
  1717. ----
  1718. .. _class_DisplayServer_method_screen_get_usable_rect:
  1719. .. rst-class:: classref-method
  1720. :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1721. 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>`.
  1722. .. rst-class:: classref-item-separator
  1723. ----
  1724. .. _class_DisplayServer_method_screen_is_kept_on:
  1725. .. rst-class:: classref-method
  1726. :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  1727. 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>`.
  1728. .. rst-class:: classref-item-separator
  1729. ----
  1730. .. _class_DisplayServer_method_screen_set_keep_on:
  1731. .. rst-class:: classref-method
  1732. void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  1733. 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>`.
  1734. .. rst-class:: classref-item-separator
  1735. ----
  1736. .. _class_DisplayServer_method_screen_set_orientation:
  1737. .. rst-class:: classref-method
  1738. void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  1739. Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>`.
  1740. \ **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>`.
  1741. .. rst-class:: classref-item-separator
  1742. ----
  1743. .. _class_DisplayServer_method_set_icon:
  1744. .. rst-class:: classref-method
  1745. void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  1746. 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.
  1747. .. rst-class:: classref-item-separator
  1748. ----
  1749. .. _class_DisplayServer_method_set_native_icon:
  1750. .. rst-class:: classref-method
  1751. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1752. 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.
  1753. .. rst-class:: classref-item-separator
  1754. ----
  1755. .. _class_DisplayServer_method_tablet_get_current_driver:
  1756. .. rst-class:: classref-method
  1757. :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  1758. Returns current active tablet driver name.
  1759. \ **Note:** This method is implemented only on Windows.
  1760. .. rst-class:: classref-item-separator
  1761. ----
  1762. .. _class_DisplayServer_method_tablet_get_driver_count:
  1763. .. rst-class:: classref-method
  1764. :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  1765. Returns the total number of available tablet drivers.
  1766. \ **Note:** This method is implemented only on Windows.
  1767. .. rst-class:: classref-item-separator
  1768. ----
  1769. .. _class_DisplayServer_method_tablet_get_driver_name:
  1770. .. rst-class:: classref-method
  1771. :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1772. Returns the tablet driver name for the given index.
  1773. \ **Note:** This method is implemented only on Windows.
  1774. .. rst-class:: classref-item-separator
  1775. ----
  1776. .. _class_DisplayServer_method_tablet_set_current_driver:
  1777. .. rst-class:: classref-method
  1778. void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  1779. Set active tablet driver name.
  1780. Supported drivers:
  1781. - ``winink``: Windows Ink API, default (Windows 8.1+ required).
  1782. - ``wintab``: Wacom Wintab API (compatible device driver required).
  1783. - ``dummy``: Dummy driver, tablet input is disabled.
  1784. \ **Note:** This method is implemented only on Windows.
  1785. .. rst-class:: classref-item-separator
  1786. ----
  1787. .. _class_DisplayServer_method_tts_get_voices:
  1788. .. rst-class:: classref-method
  1789. :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
  1790. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1791. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1792. - ``name`` is voice name.
  1793. - ``id`` is voice identifier.
  1794. - ``language`` is language code in ``lang_Variant`` format. The ``lang`` part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. The ``Variant`` part is an engine-dependent string describing country, region or/and dialect.
  1795. 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.
  1796. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1797. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1798. .. rst-class:: classref-item-separator
  1799. ----
  1800. .. _class_DisplayServer_method_tts_get_voices_for_language:
  1801. .. rst-class:: classref-method
  1802. :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1803. Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
  1804. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1805. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1806. .. rst-class:: classref-item-separator
  1807. ----
  1808. .. _class_DisplayServer_method_tts_is_paused:
  1809. .. rst-class:: classref-method
  1810. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1811. Returns ``true`` if the synthesizer is in a paused state.
  1812. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1813. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1814. .. rst-class:: classref-item-separator
  1815. ----
  1816. .. _class_DisplayServer_method_tts_is_speaking:
  1817. .. rst-class:: classref-method
  1818. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1819. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1820. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1821. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1822. .. rst-class:: classref-item-separator
  1823. ----
  1824. .. _class_DisplayServer_method_tts_pause:
  1825. .. rst-class:: classref-method
  1826. void **tts_pause** **(** **)**
  1827. Puts the synthesizer into a paused state.
  1828. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1829. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1830. .. rst-class:: classref-item-separator
  1831. ----
  1832. .. _class_DisplayServer_method_tts_resume:
  1833. .. rst-class:: classref-method
  1834. void **tts_resume** **(** **)**
  1835. Resumes the synthesizer if it was paused.
  1836. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1837. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1838. .. rst-class:: classref-item-separator
  1839. ----
  1840. .. _class_DisplayServer_method_tts_set_utterance_callback:
  1841. .. rst-class:: classref-method
  1842. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
  1843. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1844. - :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.
  1845. - :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.
  1846. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1847. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1848. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1849. .. rst-class:: classref-item-separator
  1850. ----
  1851. .. _class_DisplayServer_method_tts_speak:
  1852. .. rst-class:: classref-method
  1853. 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 **)**
  1854. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1855. - ``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>`.
  1856. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1857. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1858. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1859. - ``utterance_id`` is passed as a parameter to the callback functions.
  1860. \ **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>`.
  1861. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1862. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1863. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1864. .. rst-class:: classref-item-separator
  1865. ----
  1866. .. _class_DisplayServer_method_tts_stop:
  1867. .. rst-class:: classref-method
  1868. void **tts_stop** **(** **)**
  1869. Stops synthesis in progress and removes all utterances from the queue.
  1870. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1871. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1872. .. rst-class:: classref-item-separator
  1873. ----
  1874. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  1875. .. rst-class:: classref-method
  1876. :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  1877. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1878. .. rst-class:: classref-item-separator
  1879. ----
  1880. .. _class_DisplayServer_method_virtual_keyboard_hide:
  1881. .. rst-class:: classref-method
  1882. void **virtual_keyboard_hide** **(** **)**
  1883. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1884. .. rst-class:: classref-item-separator
  1885. ----
  1886. .. _class_DisplayServer_method_virtual_keyboard_show:
  1887. .. rst-class:: classref-method
  1888. 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 **)**
  1889. Shows the virtual keyboard if the platform has one.
  1890. \ ``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).
  1891. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  1892. \ ``type`` parameter allows configuring which type of virtual keyboard to show.
  1893. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  1894. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  1895. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  1896. \ **Note:** This method is implemented on Android, iOS and Web.
  1897. .. rst-class:: classref-item-separator
  1898. ----
  1899. .. _class_DisplayServer_method_warp_mouse:
  1900. .. rst-class:: classref-method
  1901. void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1902. 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.
  1903. \ **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.
  1904. .. rst-class:: classref-item-separator
  1905. ----
  1906. .. _class_DisplayServer_method_window_can_draw:
  1907. .. rst-class:: classref-method
  1908. :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1909. 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``.
  1910. .. rst-class:: classref-item-separator
  1911. ----
  1912. .. _class_DisplayServer_method_window_get_active_popup:
  1913. .. rst-class:: classref-method
  1914. :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  1915. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  1916. .. rst-class:: classref-item-separator
  1917. ----
  1918. .. _class_DisplayServer_method_window_get_attached_instance_id:
  1919. .. rst-class:: classref-method
  1920. :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1921. 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.
  1922. .. rst-class:: classref-item-separator
  1923. ----
  1924. .. _class_DisplayServer_method_window_get_current_screen:
  1925. .. rst-class:: classref-method
  1926. :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1927. 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>`.
  1928. .. rst-class:: classref-item-separator
  1929. ----
  1930. .. _class_DisplayServer_method_window_get_flag:
  1931. .. rst-class:: classref-method
  1932. :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  1933. Returns the current value of the given window's ``flag``.
  1934. .. rst-class:: classref-item-separator
  1935. ----
  1936. .. _class_DisplayServer_method_window_get_max_size:
  1937. .. rst-class:: classref-method
  1938. :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1939. Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>`.
  1940. .. rst-class:: classref-item-separator
  1941. ----
  1942. .. _class_DisplayServer_method_window_get_min_size:
  1943. .. rst-class:: classref-method
  1944. :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1945. Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>`.
  1946. .. rst-class:: classref-item-separator
  1947. ----
  1948. .. _class_DisplayServer_method_window_get_mode:
  1949. .. rst-class:: classref-method
  1950. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1951. Returns the mode of the given window.
  1952. .. rst-class:: classref-item-separator
  1953. ----
  1954. .. _class_DisplayServer_method_window_get_native_handle:
  1955. .. rst-class:: classref-method
  1956. :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  1957. Returns internal structure pointers for use in plugins.
  1958. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows.
  1959. .. rst-class:: classref-item-separator
  1960. ----
  1961. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  1962. .. rst-class:: classref-method
  1963. :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  1964. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  1965. .. rst-class:: classref-item-separator
  1966. ----
  1967. .. _class_DisplayServer_method_window_get_position:
  1968. .. rst-class:: classref-method
  1969. :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1970. Returns the position of the client area of the given window on the screen.
  1971. .. rst-class:: classref-item-separator
  1972. ----
  1973. .. _class_DisplayServer_method_window_get_position_with_decorations:
  1974. .. rst-class:: classref-method
  1975. :ref:`Vector2i<class_Vector2i>` **window_get_position_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1976. 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>`.
  1977. .. rst-class:: classref-item-separator
  1978. ----
  1979. .. _class_DisplayServer_method_window_get_safe_title_margins:
  1980. .. rst-class:: classref-method
  1981. :ref:`Vector3i<class_Vector3i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1982. 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.
  1983. .. rst-class:: classref-item-separator
  1984. ----
  1985. .. _class_DisplayServer_method_window_get_size:
  1986. .. rst-class:: classref-method
  1987. :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1988. 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>`.
  1989. .. rst-class:: classref-item-separator
  1990. ----
  1991. .. _class_DisplayServer_method_window_get_size_with_decorations:
  1992. .. rst-class:: classref-method
  1993. :ref:`Vector2i<class_Vector2i>` **window_get_size_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1994. 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>`.
  1995. .. rst-class:: classref-item-separator
  1996. ----
  1997. .. _class_DisplayServer_method_window_get_title_size:
  1998. .. rst-class:: classref-method
  1999. :ref:`Vector2i<class_Vector2i>` **window_get_title_size** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |const|
  2000. Returns the estimated window title bar size (including text and window buttons) for the window specified by ``window_id`` (in pixels). This method does not change the window title.
  2001. \ **Note:** This method is implemented on macOS and Windows.
  2002. .. rst-class:: classref-item-separator
  2003. ----
  2004. .. _class_DisplayServer_method_window_get_vsync_mode:
  2005. .. rst-class:: classref-method
  2006. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  2007. Returns the V-Sync mode of the given window.
  2008. .. rst-class:: classref-item-separator
  2009. ----
  2010. .. _class_DisplayServer_method_window_is_focused:
  2011. .. rst-class:: classref-method
  2012. :ref:`bool<class_bool>` **window_is_focused** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  2013. Returns ``true`` if the window specified by ``window_id`` is focused.
  2014. .. rst-class:: classref-item-separator
  2015. ----
  2016. .. _class_DisplayServer_method_window_is_maximize_allowed:
  2017. .. rst-class:: classref-method
  2018. :ref:`bool<class_bool>` **window_is_maximize_allowed** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  2019. Returns ``true`` if the given window can be maximized (the maximize button is enabled).
  2020. .. rst-class:: classref-item-separator
  2021. ----
  2022. .. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
  2023. .. rst-class:: classref-method
  2024. :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
  2025. Returns ``true``, if double-click on a window title should maximize it.
  2026. \ **Note:** This method is implemented only on macOS.
  2027. .. rst-class:: classref-item-separator
  2028. ----
  2029. .. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
  2030. .. rst-class:: classref-method
  2031. :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
  2032. Returns ``true``, if double-click on a window title should minimize it.
  2033. \ **Note:** This method is implemented only on macOS.
  2034. .. rst-class:: classref-item-separator
  2035. ----
  2036. .. _class_DisplayServer_method_window_move_to_foreground:
  2037. .. rst-class:: classref-method
  2038. void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  2039. Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows.
  2040. .. rst-class:: classref-item-separator
  2041. ----
  2042. .. _class_DisplayServer_method_window_request_attention:
  2043. .. rst-class:: classref-method
  2044. void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  2045. 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.
  2046. .. rst-class:: classref-item-separator
  2047. ----
  2048. .. _class_DisplayServer_method_window_set_current_screen:
  2049. .. rst-class:: classref-method
  2050. void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  2051. 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>`.
  2052. .. rst-class:: classref-item-separator
  2053. ----
  2054. .. _class_DisplayServer_method_window_set_drop_files_callback:
  2055. .. rst-class:: classref-method
  2056. void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2057. 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``.
  2058. \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window<class_Window>` node will override its default implementation, which can introduce bugs.
  2059. \ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web.
  2060. .. rst-class:: classref-item-separator
  2061. ----
  2062. .. _class_DisplayServer_method_window_set_exclusive:
  2063. .. rst-class:: classref-method
  2064. void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  2065. 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.
  2066. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  2067. \ **Note:** This method is implemented on macOS and Windows.
  2068. .. rst-class:: classref-item-separator
  2069. ----
  2070. .. _class_DisplayServer_method_window_set_flag:
  2071. .. rst-class:: classref-method
  2072. void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  2073. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  2074. .. rst-class:: classref-item-separator
  2075. ----
  2076. .. _class_DisplayServer_method_window_set_ime_active:
  2077. .. rst-class:: classref-method
  2078. void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  2079. 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>`.
  2080. .. rst-class:: classref-item-separator
  2081. ----
  2082. .. _class_DisplayServer_method_window_set_ime_position:
  2083. .. rst-class:: classref-method
  2084. void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  2085. 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``.
  2086. .. rst-class:: classref-item-separator
  2087. ----
  2088. .. _class_DisplayServer_method_window_set_input_event_callback:
  2089. .. rst-class:: classref-method
  2090. void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2091. Sets the ``callback`` that should be called when any :ref:`InputEvent<class_InputEvent>` is sent to the window specified by ``window_id``.
  2092. \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window<class_Window>` node will override its default implementation, which can introduce bugs.
  2093. .. rst-class:: classref-item-separator
  2094. ----
  2095. .. _class_DisplayServer_method_window_set_input_text_callback:
  2096. .. rst-class:: classref-method
  2097. void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2098. Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``.
  2099. \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window<class_Window>` node will override its default implementation, which can introduce bugs.
  2100. .. rst-class:: classref-item-separator
  2101. ----
  2102. .. _class_DisplayServer_method_window_set_max_size:
  2103. .. rst-class:: classref-method
  2104. void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  2105. 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>`.
  2106. \ **Note:** It's recommended to change this value using :ref:`Window.max_size<class_Window_property_max_size>` instead.
  2107. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  2108. .. rst-class:: classref-item-separator
  2109. ----
  2110. .. _class_DisplayServer_method_window_set_min_size:
  2111. .. rst-class:: classref-method
  2112. void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  2113. 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>`.
  2114. \ **Note:** It's recommended to change this value using :ref:`Window.min_size<class_Window_property_min_size>` instead.
  2115. \ **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.
  2116. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  2117. .. rst-class:: classref-item-separator
  2118. ----
  2119. .. _class_DisplayServer_method_window_set_mode:
  2120. .. rst-class:: classref-method
  2121. void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  2122. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  2123. \ **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.
  2124. .. rst-class:: classref-item-separator
  2125. ----
  2126. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  2127. .. rst-class:: classref-method
  2128. void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  2129. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  2130. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  2131. .. tabs::
  2132. .. code-tab:: gdscript
  2133. # Set region, using Path2D node.
  2134. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  2135. # Set region, using Polygon2D node.
  2136. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  2137. # Reset region to default.
  2138. DisplayServer.window_set_mouse_passthrough([])
  2139. .. code-tab:: csharp
  2140. // Set region, using Path2D node.
  2141. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  2142. // Set region, using Polygon2D node.
  2143. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  2144. // Reset region to default.
  2145. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  2146. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  2147. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  2148. .. rst-class:: classref-item-separator
  2149. ----
  2150. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  2151. .. rst-class:: classref-method
  2152. void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  2153. 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.
  2154. .. rst-class:: classref-item-separator
  2155. ----
  2156. .. _class_DisplayServer_method_window_set_position:
  2157. .. rst-class:: classref-method
  2158. void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  2159. 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:
  2160. ::
  2161. * (0, 0) +-------+
  2162. | |
  2163. +-------------+ | |
  2164. | | | |
  2165. | | | |
  2166. +-------------+ +-------+
  2167. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>` and :ref:`window_set_size<class_DisplayServer_method_window_set_size>`.
  2168. \ **Note:** It's recommended to change this value using :ref:`Window.position<class_Window_property_position>` instead.
  2169. .. rst-class:: classref-item-separator
  2170. ----
  2171. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  2172. .. rst-class:: classref-method
  2173. void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2174. Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized.
  2175. \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window<class_Window>` node will override its default implementation, which can introduce bugs.
  2176. .. rst-class:: classref-item-separator
  2177. ----
  2178. .. _class_DisplayServer_method_window_set_size:
  2179. .. rst-class:: classref-method
  2180. void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  2181. 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>`.
  2182. \ **Note:** It's recommended to change this value using :ref:`Window.size<class_Window_property_size>` instead.
  2183. .. rst-class:: classref-item-separator
  2184. ----
  2185. .. _class_DisplayServer_method_window_set_title:
  2186. .. rst-class:: classref-method
  2187. void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  2188. Sets the title of the given window to ``title``.
  2189. \ **Note:** It's recommended to change this value using :ref:`Window.title<class_Window_property_title>` instead.
  2190. \ **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.
  2191. .. rst-class:: classref-item-separator
  2192. ----
  2193. .. _class_DisplayServer_method_window_set_transient:
  2194. .. rst-class:: classref-method
  2195. void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  2196. 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.
  2197. \ **Note:** It's recommended to change this value using :ref:`Window.transient<class_Window_property_transient>` instead.
  2198. \ **Note:** The behavior might be different depending on the platform.
  2199. .. rst-class:: classref-item-separator
  2200. ----
  2201. .. _class_DisplayServer_method_window_set_vsync_mode:
  2202. .. rst-class:: classref-method
  2203. void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  2204. 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>`.
  2205. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  2206. 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.
  2207. \ **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.
  2208. .. rst-class:: classref-item-separator
  2209. ----
  2210. .. _class_DisplayServer_method_window_set_window_buttons_offset:
  2211. .. rst-class:: classref-method
  2212. void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
  2213. 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.
  2214. \ **Note:** This flag is implemented only on macOS.
  2215. .. rst-class:: classref-item-separator
  2216. ----
  2217. .. _class_DisplayServer_method_window_set_window_event_callback:
  2218. .. rst-class:: classref-method
  2219. void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2220. Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``.
  2221. \ **Warning:** Advanced users only! Adding such a callback to a :ref:`Window<class_Window>` node will override its default implementation, which can introduce bugs.
  2222. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2223. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2224. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2225. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2226. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2227. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2228. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`