class_displayserver.rst 301 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.1/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/DisplayServer.xml.
  6. .. _class_DisplayServer:
  7. DisplayServer
  8. =============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. A server interface for low-level window management.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **DisplayServer** handles everything related to window management. It is separated from :ref:`OS<class_OS>` as a single operating system may support multiple display servers.
  15. \ **Headless mode:** Starting the engine with the ``--headless`` :doc:`command line argument <../tutorials/editor/command_line_tutorial>` disables all rendering and window management functions. Most functions from **DisplayServer** will return dummy values in this case.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`String<class_String>` | :ref:`clipboard_get<class_DisplayServer_method_clipboard_get>` **(** **)** |const| |
  23. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
  25. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`clipboard_has<class_DisplayServer_method_clipboard_has>` **(** **)** |const| |
  27. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
  29. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
  31. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
  33. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`cursor_set_custom_image<class_DisplayServer_method_cursor_set_custom_image>` **(** :ref:`Resource<class_Resource>` cursor, :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape=0, :ref:`Vector2<class_Vector2>` hotspot=Vector2(0, 0) **)** |
  35. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
  37. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_input_text<class_DisplayServer_method_dialog_input_text>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`String<class_String>` existing_text, :ref:`Callable<class_Callable>` callback **)** |
  39. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_show<class_DisplayServer_method_dialog_show>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`PackedStringArray<class_PackedStringArray>` buttons, :ref:`Callable<class_Callable>` callback **)** |
  41. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
  43. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
  45. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Color<class_Color>` | :ref:`get_accent_color<class_DisplayServer_method_get_accent_color>` **(** **)** |const| |
  47. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Rect2[]<class_Rect2>` | :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>` **(** **)** |const| |
  49. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Rect2i<class_Rect2i>` | :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>` **(** **)** |const| |
  51. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`get_keyboard_focus_screen<class_DisplayServer_method_get_keyboard_focus_screen>` **(** **)** |const| |
  53. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
  55. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_primary_screen<class_DisplayServer_method_get_primary_screen>` **(** **)** |const| |
  57. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
  59. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_screen_from_rect<class_DisplayServer_method_get_screen_from_rect>` **(** :ref:`Rect2<class_Rect2>` rect **)** |const| |
  61. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
  63. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  65. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
  67. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`int<class_int>` | :ref:`global_menu_add_check_item<class_DisplayServer_method_global_menu_add_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=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 **)** |
  69. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_check_item<class_DisplayServer_method_global_menu_add_icon_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=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 **)** |
  71. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_item<class_DisplayServer_method_global_menu_add_icon_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=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 **)** |
  73. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`global_menu_add_icon_radio_check_item<class_DisplayServer_method_global_menu_add_icon_radio_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback=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_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 **)** |
  77. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state, :ref:`Callable<class_Callable>` callback=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_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 **)** |
  81. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)** |
  83. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` index=-1 **)** |
  85. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
  87. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`global_menu_get_item_accelerator<class_DisplayServer_method_global_menu_get_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  89. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_callback<class_DisplayServer_method_global_menu_get_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  91. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`global_menu_get_item_count<class_DisplayServer_method_global_menu_get_item_count>` **(** :ref:`String<class_String>` menu_root **)** |const| |
  93. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Texture2D<class_Texture2D>` | :ref:`global_menu_get_item_icon<class_DisplayServer_method_global_menu_get_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  95. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`global_menu_get_item_indentation_level<class_DisplayServer_method_global_menu_get_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  97. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_tag<class_DisplayServer_method_global_menu_get_item_index_from_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const| |
  99. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_text<class_DisplayServer_method_global_menu_get_item_index_from_text>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const| |
  101. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_key_callback<class_DisplayServer_method_global_menu_get_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  103. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`global_menu_get_item_max_states<class_DisplayServer_method_global_menu_get_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  105. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`int<class_int>` | :ref:`global_menu_get_item_state<class_DisplayServer_method_global_menu_get_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  107. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`String<class_String>` | :ref:`global_menu_get_item_submenu<class_DisplayServer_method_global_menu_get_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  109. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`Variant<class_Variant>` | :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  111. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`String<class_String>` | :ref:`global_menu_get_item_text<class_DisplayServer_method_global_menu_get_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  113. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`String<class_String>` | :ref:`global_menu_get_item_tooltip<class_DisplayServer_method_global_menu_get_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  115. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checkable<class_DisplayServer_method_global_menu_is_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  117. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checked<class_DisplayServer_method_global_menu_is_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  119. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_disabled<class_DisplayServer_method_global_menu_is_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  121. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`bool<class_bool>` | :ref:`global_menu_is_item_radio_checkable<class_DisplayServer_method_global_menu_is_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
  123. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
  125. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`global_menu_set_item_accelerator<class_DisplayServer_method_global_menu_set_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |
  127. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`global_menu_set_item_callback<class_DisplayServer_method_global_menu_set_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)** |
  129. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`global_menu_set_item_checkable<class_DisplayServer_method_global_menu_set_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
  131. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
  133. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  135. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`global_menu_set_item_icon<class_DisplayServer_method_global_menu_set_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
  137. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`global_menu_set_item_indentation_level<class_DisplayServer_method_global_menu_set_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)** |
  139. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`global_menu_set_item_key_callback<class_DisplayServer_method_global_menu_set_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)** |
  141. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`global_menu_set_item_max_states<class_DisplayServer_method_global_menu_set_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)** |
  143. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`global_menu_set_item_radio_checkable<class_DisplayServer_method_global_menu_set_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
  145. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`global_menu_set_item_state<class_DisplayServer_method_global_menu_set_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)** |
  147. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`global_menu_set_item_submenu<class_DisplayServer_method_global_menu_set_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)** |
  149. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)** |
  151. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`global_menu_set_item_text<class_DisplayServer_method_global_menu_set_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  153. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`global_menu_set_item_tooltip<class_DisplayServer_method_global_menu_set_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  155. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
  157. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
  159. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
  161. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
  163. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
  165. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | :ref:`bool<class_bool>` | :ref:`is_touchscreen_available<class_DisplayServer_method_is_touchscreen_available>` **(** **)** |const| |
  167. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
  169. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`keyboard_get_keycode_from_physical<class_DisplayServer_method_keyboard_get_keycode_from_physical>` **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const| |
  171. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
  173. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  175. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  177. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  179. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
  181. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
  183. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
  185. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
  187. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
  189. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  191. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | :ref:`Image<class_Image>` | :ref:`screen_get_image<class_DisplayServer_method_screen_get_image>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  193. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
  195. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  197. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. | :ref:`Color<class_Color>` | :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
  199. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  200. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  201. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  202. | :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  203. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  204. | :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  205. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  206. | :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  207. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  208. | :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  209. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  210. | :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
  211. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  212. | void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
  213. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  214. | void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
  215. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  216. | void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
  217. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  218. | void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  219. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  220. | :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
  221. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  222. | :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
  223. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  224. | :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  225. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  226. | void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
  227. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  228. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
  229. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  230. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  231. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  232. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
  233. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  234. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
  235. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  236. | void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
  237. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  238. | void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
  239. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  240. | void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
  241. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  242. | void | :ref:`tts_speak<class_DisplayServer_method_tts_speak>` **(** :ref:`String<class_String>` text, :ref:`String<class_String>` voice, :ref:`int<class_int>` volume=50, :ref:`float<class_float>` pitch=1.0, :ref:`float<class_float>` rate=1.0, :ref:`int<class_int>` utterance_id=0, :ref:`bool<class_bool>` interrupt=false **)** |
  243. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  244. | void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
  245. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  246. | :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
  247. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  248. | void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
  249. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  250. | void | :ref:`virtual_keyboard_show<class_DisplayServer_method_virtual_keyboard_show>` **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` type=0, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)** |
  251. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  252. | void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
  253. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  254. | :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  255. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  256. | :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
  257. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  258. | :ref:`int<class_int>` | :ref:`window_get_attached_instance_id<class_DisplayServer_method_window_get_attached_instance_id>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  259. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  260. | :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  261. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  262. | :ref:`bool<class_bool>` | :ref:`window_get_flag<class_DisplayServer_method_window_get_flag>` **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const| |
  263. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  264. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  265. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  266. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  267. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  268. | :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  269. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  270. | :ref:`int<class_int>` | :ref:`window_get_native_handle<class_DisplayServer_method_window_get_native_handle>` **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const| |
  271. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  272. | :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
  273. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  274. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  275. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  276. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position_with_decorations<class_DisplayServer_method_window_get_position_with_decorations>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  277. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  278. | :ref:`Vector3i<class_Vector3i>` | :ref:`window_get_safe_title_margins<class_DisplayServer_method_window_get_safe_title_margins>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  279. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  280. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  281. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  282. | :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size_with_decorations<class_DisplayServer_method_window_get_size_with_decorations>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  283. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  284. | :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` | :ref:`window_get_vsync_mode<class_DisplayServer_method_window_get_vsync_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  285. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  286. | :ref:`bool<class_bool>` | :ref:`window_is_focused<class_DisplayServer_method_window_is_focused>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  287. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  288. | :ref:`bool<class_bool>` | :ref:`window_is_maximize_allowed<class_DisplayServer_method_window_is_maximize_allowed>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
  289. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  290. | :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
  291. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  292. | :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
  293. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  294. | void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
  295. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  296. | void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
  297. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  298. | 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 **)** |
  299. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  300. | 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 **)** |
  301. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  302. | void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
  303. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  304. | 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 **)** |
  305. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  306. | 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 **)** |
  307. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  308. | 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 **)** |
  309. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  310. | 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 **)** |
  311. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  312. | 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 **)** |
  313. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  314. | 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 **)** |
  315. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  316. | 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 **)** |
  317. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  318. | void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
  319. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  320. | 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 **)** |
  321. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  322. | 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 **)** |
  323. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  324. | void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
  325. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  326. | 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 **)** |
  327. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  328. | void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
  329. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  330. | void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
  331. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  332. | void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
  333. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  334. | 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 **)** |
  335. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  336. | 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 **)** |
  337. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  338. | 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 **)** |
  339. +-------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  340. .. rst-class:: classref-section-separator
  341. ----
  342. .. rst-class:: classref-descriptions-group
  343. Enumerations
  344. ------------
  345. .. _enum_DisplayServer_Feature:
  346. .. rst-class:: classref-enumeration
  347. enum **Feature**:
  348. .. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
  351. Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
  352. .. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SUBWINDOWS** = ``1``
  355. Display server supports multiple windows that can be moved outside of the main window. **Windows, macOS, Linux (X11)**
  356. .. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TOUCHSCREEN** = ``2``
  359. Display server supports touchscreen input. **Windows, Linux (X11), Android, iOS, Web**
  360. .. _class_DisplayServer_constant_FEATURE_MOUSE:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE** = ``3``
  363. Display server supports mouse input. **Windows, macOS, Linux (X11), Android, Web**
  364. .. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_MOUSE_WARP** = ``4``
  367. 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)**
  368. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD** = ``5``
  371. 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**
  372. .. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_VIRTUAL_KEYBOARD** = ``6``
  375. Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. **Android, iOS, Web**
  376. .. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CURSOR_SHAPE** = ``7``
  379. Display server supports setting the mouse cursor shape to be different from the default. **Windows, macOS, Linux (X11), Android, Web**
  380. .. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CUSTOM_CURSOR_SHAPE** = ``8``
  383. Display server supports setting the mouse cursor shape to a custom image. **Windows, macOS, Linux (X11), Web**
  384. .. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_DIALOG** = ``9``
  387. Display server supports spawning dialogs using the operating system's native look-and-feel. **macOS**
  388. .. _class_DisplayServer_constant_FEATURE_IME:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_IME** = ``10``
  391. 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)**
  392. .. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
  393. .. rst-class:: classref-enumeration-constant
  394. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_WINDOW_TRANSPARENCY** = ``11``
  395. Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. **Windows, macOS, Linux (X11)**
  396. .. _class_DisplayServer_constant_FEATURE_HIDPI:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_HIDPI** = ``12``
  399. 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**
  400. .. _class_DisplayServer_constant_FEATURE_ICON:
  401. .. rst-class:: classref-enumeration-constant
  402. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ICON** = ``13``
  403. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS, Linux (X11)**
  404. .. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
  405. .. rst-class:: classref-enumeration-constant
  406. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_NATIVE_ICON** = ``14``
  407. Display server supports changing the window icon (usually displayed in the top-left corner). **Windows, macOS**
  408. .. _class_DisplayServer_constant_FEATURE_ORIENTATION:
  409. .. rst-class:: classref-enumeration-constant
  410. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_ORIENTATION** = ``15``
  411. Display server supports changing the screen orientation. **Android, iOS**
  412. .. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
  413. .. rst-class:: classref-enumeration-constant
  414. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SWAP_BUFFERS** = ``16``
  415. 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)**
  416. .. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
  417. .. rst-class:: classref-enumeration-constant
  418. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_CLIPBOARD_PRIMARY** = ``18``
  419. Display server supports Primary clipboard can be used. This is a different clipboard from :ref:`FEATURE_CLIPBOARD<class_DisplayServer_constant_FEATURE_CLIPBOARD>`. **Linux (X11)**
  420. .. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
  421. .. rst-class:: classref-enumeration-constant
  422. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_TEXT_TO_SPEECH** = ``19``
  423. Display server supports text-to-speech. See ``tts_*`` methods. **Windows, macOS, Linux (X11), Android, iOS, Web**
  424. .. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
  425. .. rst-class:: classref-enumeration-constant
  426. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_EXTEND_TO_TITLE** = ``20``
  427. 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**
  428. .. _class_DisplayServer_constant_FEATURE_SCREEN_CAPTURE:
  429. .. rst-class:: classref-enumeration-constant
  430. :ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_SCREEN_CAPTURE** = ``21``
  431. Display server supports reading screen pixels. See :ref:`screen_get_pixel<class_DisplayServer_method_screen_get_pixel>`.
  432. .. rst-class:: classref-item-separator
  433. ----
  434. .. _enum_DisplayServer_MouseMode:
  435. .. rst-class:: classref-enumeration
  436. enum **MouseMode**:
  437. .. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
  438. .. rst-class:: classref-enumeration-constant
  439. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_VISIBLE** = ``0``
  440. Makes the mouse cursor visible if it is hidden.
  441. .. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
  442. .. rst-class:: classref-enumeration-constant
  443. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_HIDDEN** = ``1``
  444. Makes the mouse cursor hidden if it is visible.
  445. .. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
  446. .. rst-class:: classref-enumeration-constant
  447. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CAPTURED** = ``2``
  448. Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
  449. \ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
  450. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
  451. .. rst-class:: classref-enumeration-constant
  452. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED** = ``3``
  453. Confines the mouse cursor to the game window, and make it visible.
  454. .. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
  455. .. rst-class:: classref-enumeration-constant
  456. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **MOUSE_MODE_CONFINED_HIDDEN** = ``4``
  457. Confines the mouse cursor to the game window, and make it hidden.
  458. .. rst-class:: classref-item-separator
  459. ----
  460. .. _enum_DisplayServer_ScreenOrientation:
  461. .. rst-class:: classref-enumeration
  462. enum **ScreenOrientation**:
  463. .. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
  464. .. rst-class:: classref-enumeration-constant
  465. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_LANDSCAPE** = ``0``
  466. Default landscape orientation.
  467. .. _class_DisplayServer_constant_SCREEN_PORTRAIT:
  468. .. rst-class:: classref-enumeration-constant
  469. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_PORTRAIT** = ``1``
  470. Default portrait orientation.
  471. .. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
  472. .. rst-class:: classref-enumeration-constant
  473. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_LANDSCAPE** = ``2``
  474. Reverse landscape orientation (upside down).
  475. .. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
  476. .. rst-class:: classref-enumeration-constant
  477. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_REVERSE_PORTRAIT** = ``3``
  478. Reverse portrait orientation (upside down).
  479. .. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
  480. .. rst-class:: classref-enumeration-constant
  481. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_LANDSCAPE** = ``4``
  482. Automatic landscape orientation (default or reverse depending on sensor).
  483. .. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
  484. .. rst-class:: classref-enumeration-constant
  485. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR_PORTRAIT** = ``5``
  486. Automatic portrait orientation (default or reverse depending on sensor).
  487. .. _class_DisplayServer_constant_SCREEN_SENSOR:
  488. .. rst-class:: classref-enumeration-constant
  489. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **SCREEN_SENSOR** = ``6``
  490. Automatic landscape or portrait orientation (default or reverse depending on sensor).
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _enum_DisplayServer_VirtualKeyboardType:
  494. .. rst-class:: classref-enumeration
  495. enum **VirtualKeyboardType**:
  496. .. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
  497. .. rst-class:: classref-enumeration-constant
  498. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  499. Default text virtual keyboard.
  500. .. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
  501. .. rst-class:: classref-enumeration-constant
  502. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  503. Multiline virtual keyboard.
  504. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
  505. .. rst-class:: classref-enumeration-constant
  506. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  507. Virtual number keypad, useful for PIN entry.
  508. .. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  509. .. rst-class:: classref-enumeration-constant
  510. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  511. Virtual number keypad, useful for entering fractional numbers.
  512. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
  513. .. rst-class:: classref-enumeration-constant
  514. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  515. Virtual phone number keypad.
  516. .. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  517. .. rst-class:: classref-enumeration-constant
  518. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  519. Virtual keyboard with additional keys to assist with typing email addresses.
  520. .. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
  521. .. rst-class:: classref-enumeration-constant
  522. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  523. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  524. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
  525. .. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
  526. .. rst-class:: classref-enumeration-constant
  527. :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  528. Virtual keyboard with additional keys to assist with typing URLs.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _enum_DisplayServer_CursorShape:
  532. .. rst-class:: classref-enumeration
  533. enum **CursorShape**:
  534. .. _class_DisplayServer_constant_CURSOR_ARROW:
  535. .. rst-class:: classref-enumeration-constant
  536. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_ARROW** = ``0``
  537. 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>`.
  538. .. _class_DisplayServer_constant_CURSOR_IBEAM:
  539. .. rst-class:: classref-enumeration-constant
  540. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_IBEAM** = ``1``
  541. 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>`.
  542. .. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
  543. .. rst-class:: classref-enumeration-constant
  544. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_POINTING_HAND** = ``2``
  545. 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>`.
  546. .. _class_DisplayServer_constant_CURSOR_CROSS:
  547. .. rst-class:: classref-enumeration-constant
  548. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CROSS** = ``3``
  549. 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.
  550. .. _class_DisplayServer_constant_CURSOR_WAIT:
  551. .. rst-class:: classref-enumeration-constant
  552. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_WAIT** = ``4``
  553. 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>`.
  554. .. _class_DisplayServer_constant_CURSOR_BUSY:
  555. .. rst-class:: classref-enumeration-constant
  556. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BUSY** = ``5``
  557. 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>`.
  558. .. _class_DisplayServer_constant_CURSOR_DRAG:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_DRAG** = ``6``
  561. Dragging hand cursor. This is displayed during drag-and-drop operations. See also :ref:`CURSOR_CAN_DROP<class_DisplayServer_constant_CURSOR_CAN_DROP>`.
  562. .. _class_DisplayServer_constant_CURSOR_CAN_DROP:
  563. .. rst-class:: classref-enumeration-constant
  564. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_CAN_DROP** = ``7``
  565. "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>`.
  566. .. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
  567. .. rst-class:: classref-enumeration-constant
  568. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FORBIDDEN** = ``8``
  569. 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.
  570. .. _class_DisplayServer_constant_CURSOR_VSIZE:
  571. .. rst-class:: classref-enumeration-constant
  572. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSIZE** = ``9``
  573. 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>`.
  574. .. _class_DisplayServer_constant_CURSOR_HSIZE:
  575. .. rst-class:: classref-enumeration-constant
  576. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSIZE** = ``10``
  577. 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>`.
  578. .. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
  579. .. rst-class:: classref-enumeration-constant
  580. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_BDIAGSIZE** = ``11``
  581. 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.
  582. .. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
  583. .. rst-class:: classref-enumeration-constant
  584. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_FDIAGSIZE** = ``12``
  585. 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.
  586. .. _class_DisplayServer_constant_CURSOR_MOVE:
  587. .. rst-class:: classref-enumeration-constant
  588. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MOVE** = ``13``
  589. Move cursor. Intended to be displayed when the hovered :ref:`Control<class_Control>` can be moved using the mouse.
  590. .. _class_DisplayServer_constant_CURSOR_VSPLIT:
  591. .. rst-class:: classref-enumeration-constant
  592. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_VSPLIT** = ``14``
  593. 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>`.
  594. .. _class_DisplayServer_constant_CURSOR_HSPLIT:
  595. .. rst-class:: classref-enumeration-constant
  596. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HSPLIT** = ``15``
  597. 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>`.
  598. .. _class_DisplayServer_constant_CURSOR_HELP:
  599. .. rst-class:: classref-enumeration-constant
  600. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_HELP** = ``16``
  601. 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.
  602. .. _class_DisplayServer_constant_CURSOR_MAX:
  603. .. rst-class:: classref-enumeration-constant
  604. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **CURSOR_MAX** = ``17``
  605. Represents the size of the :ref:`CursorShape<enum_DisplayServer_CursorShape>` enum.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _enum_DisplayServer_WindowMode:
  609. .. rst-class:: classref-enumeration
  610. enum **WindowMode**:
  611. .. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
  612. .. rst-class:: classref-enumeration-constant
  613. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_WINDOWED** = ``0``
  614. Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
  615. .. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
  616. .. rst-class:: classref-enumeration-constant
  617. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MINIMIZED** = ``1``
  618. 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.
  619. .. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
  620. .. rst-class:: classref-enumeration-constant
  621. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_MAXIMIZED** = ``2``
  622. 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.
  623. .. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
  624. .. rst-class:: classref-enumeration-constant
  625. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_FULLSCREEN** = ``3``
  626. Full screen mode with full multi-window support.
  627. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  628. \ **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.
  629. .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
  630. .. rst-class:: classref-enumeration-constant
  631. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = ``4``
  632. 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).
  633. Full screen window cover the entire display area of a screen, have no border or decorations. Display video mode is not changed.
  634. \ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
  635. \ **On macOS:** Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
  636. \ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
  637. \ **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.
  638. .. rst-class:: classref-item-separator
  639. ----
  640. .. _enum_DisplayServer_WindowFlags:
  641. .. rst-class:: classref-enumeration
  642. enum **WindowFlags**:
  643. .. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
  644. .. rst-class:: classref-enumeration-constant
  645. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_RESIZE_DISABLED** = ``0``
  646. 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.
  647. .. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
  648. .. rst-class:: classref-enumeration-constant
  649. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_BORDERLESS** = ``1``
  650. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
  651. .. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
  652. .. rst-class:: classref-enumeration-constant
  653. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_ALWAYS_ON_TOP** = ``2``
  654. The window is floating on top of all other windows. This flag is ignored for full-screen windows.
  655. .. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
  656. .. rst-class:: classref-enumeration-constant
  657. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_TRANSPARENT** = ``3``
  658. The window background can be transparent.
  659. \ **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``.
  660. \ **Note:** Transparency support is implemented on Linux (X11), macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
  661. .. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
  662. .. rst-class:: classref-enumeration-constant
  663. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_NO_FOCUS** = ``4``
  664. The window can't be focused. No-focus window will ignore all input, except mouse clicks.
  665. .. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
  666. .. rst-class:: classref-enumeration-constant
  667. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_POPUP** = ``5``
  668. 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>`).
  669. .. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
  670. .. rst-class:: classref-enumeration-constant
  671. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_EXTEND_TO_TITLE** = ``6``
  672. 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.
  673. Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
  674. 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.
  675. \ **Note:** This flag is implemented only on macOS.
  676. .. _class_DisplayServer_constant_WINDOW_FLAG_MOUSE_PASSTHROUGH:
  677. .. rst-class:: classref-enumeration-constant
  678. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MOUSE_PASSTHROUGH** = ``7``
  679. All mouse events are passed to the underlying window of the same application.
  680. .. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
  681. .. rst-class:: classref-enumeration-constant
  682. :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` **WINDOW_FLAG_MAX** = ``8``
  683. Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _enum_DisplayServer_WindowEvent:
  687. .. rst-class:: classref-enumeration
  688. enum **WindowEvent**:
  689. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
  690. .. rst-class:: classref-enumeration-constant
  691. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_ENTER** = ``0``
  692. Sent when the mouse pointer enters the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  693. .. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
  694. .. rst-class:: classref-enumeration-constant
  695. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_MOUSE_EXIT** = ``1``
  696. Sent when the mouse pointer exits the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  697. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
  698. .. rst-class:: classref-enumeration-constant
  699. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_IN** = ``2``
  700. Sent when the window grabs focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  701. .. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
  702. .. rst-class:: classref-enumeration-constant
  703. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_FOCUS_OUT** = ``3``
  704. Sent when the window loses focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  705. .. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
  706. .. rst-class:: classref-enumeration-constant
  707. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_CLOSE_REQUEST** = ``4``
  708. Sent when the user has attempted to close the window (e.g. close button is pressed), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  709. .. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
  710. .. rst-class:: classref-enumeration-constant
  711. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_GO_BACK_REQUEST** = ``5``
  712. Sent when the device "Back" button is pressed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  713. \ **Note:** This event is implemented only on Android.
  714. .. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
  715. .. rst-class:: classref-enumeration-constant
  716. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_DPI_CHANGE** = ``6``
  717. Sent when the window is moved to the display with different DPI, or display DPI is changed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  718. \ **Note:** This flag is implemented only on macOS.
  719. .. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
  720. .. rst-class:: classref-enumeration-constant
  721. :ref:`WindowEvent<enum_DisplayServer_WindowEvent>` **WINDOW_EVENT_TITLEBAR_CHANGE** = ``7``
  722. Sent when the window title bar decoration is changed (e.g. :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` is set or window entered/exited full screen mode), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
  723. \ **Note:** This flag is implemented only on macOS.
  724. .. rst-class:: classref-item-separator
  725. ----
  726. .. _enum_DisplayServer_VSyncMode:
  727. .. rst-class:: classref-enumeration
  728. enum **VSyncMode**:
  729. .. _class_DisplayServer_constant_VSYNC_DISABLED:
  730. .. rst-class:: classref-enumeration-constant
  731. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_DISABLED** = ``0``
  732. 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>`).
  733. .. _class_DisplayServer_constant_VSYNC_ENABLED:
  734. .. rst-class:: classref-enumeration-constant
  735. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ENABLED** = ``1``
  736. 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>`).
  737. .. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
  738. .. rst-class:: classref-enumeration-constant
  739. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_ADAPTIVE** = ``2``
  740. 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.
  741. .. _class_DisplayServer_constant_VSYNC_MAILBOX:
  742. .. rst-class:: classref-enumeration-constant
  743. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **VSYNC_MAILBOX** = ``3``
  744. 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>`).
  745. 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.
  746. .. rst-class:: classref-item-separator
  747. ----
  748. .. _enum_DisplayServer_HandleType:
  749. .. rst-class:: classref-enumeration
  750. enum **HandleType**:
  751. .. _class_DisplayServer_constant_DISPLAY_HANDLE:
  752. .. rst-class:: classref-enumeration-constant
  753. :ref:`HandleType<enum_DisplayServer_HandleType>` **DISPLAY_HANDLE** = ``0``
  754. Display handle:
  755. - Linux (X11): ``X11::Display*`` for the display.
  756. - Android: ``EGLDisplay`` for the display.
  757. .. _class_DisplayServer_constant_WINDOW_HANDLE:
  758. .. rst-class:: classref-enumeration-constant
  759. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_HANDLE** = ``1``
  760. Window handle:
  761. - Windows: ``HWND`` for the window.
  762. - Linux (X11): ``X11::Window*`` for the window.
  763. - macOS: ``NSWindow*`` for the window.
  764. - iOS: ``UIViewController*`` for the view controller.
  765. - Android: ``jObject`` for the activity.
  766. .. _class_DisplayServer_constant_WINDOW_VIEW:
  767. .. rst-class:: classref-enumeration-constant
  768. :ref:`HandleType<enum_DisplayServer_HandleType>` **WINDOW_VIEW** = ``2``
  769. Window view:
  770. - Windows: ``HDC`` for the window (only with the GL Compatibility renderer).
  771. - macOS: ``NSView*`` for the window main view.
  772. - iOS: ``UIView*`` for the window main view.
  773. .. _class_DisplayServer_constant_OPENGL_CONTEXT:
  774. .. rst-class:: classref-enumeration-constant
  775. :ref:`HandleType<enum_DisplayServer_HandleType>` **OPENGL_CONTEXT** = ``3``
  776. OpenGL context (only with the GL Compatibility renderer):
  777. - Windows: ``HGLRC`` for the window.
  778. - Linux: ``GLXContext*`` for the window.
  779. - macOS: ``NSOpenGLContext*`` for the window.
  780. - Android: ``EGLContext`` for the window.
  781. .. rst-class:: classref-item-separator
  782. ----
  783. .. _enum_DisplayServer_TTSUtteranceEvent:
  784. .. rst-class:: classref-enumeration
  785. enum **TTSUtteranceEvent**:
  786. .. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
  787. .. rst-class:: classref-enumeration-constant
  788. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  789. Utterance has begun to be spoken.
  790. .. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
  791. .. rst-class:: classref-enumeration-constant
  792. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  793. Utterance was successfully finished.
  794. .. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
  795. .. rst-class:: classref-enumeration-constant
  796. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  797. Utterance was canceled, or TTS service was unable to process it.
  798. .. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
  799. .. rst-class:: classref-enumeration-constant
  800. :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  801. Utterance reached a word or sentence boundary.
  802. .. rst-class:: classref-section-separator
  803. ----
  804. .. rst-class:: classref-descriptions-group
  805. Constants
  806. ---------
  807. .. _class_DisplayServer_constant_SCREEN_WITH_MOUSE_FOCUS:
  808. .. rst-class:: classref-constant
  809. **SCREEN_WITH_MOUSE_FOCUS** = ``-4``
  810. Represents the screen containing the mouse pointer.
  811. .. _class_DisplayServer_constant_SCREEN_WITH_KEYBOARD_FOCUS:
  812. .. rst-class:: classref-constant
  813. **SCREEN_WITH_KEYBOARD_FOCUS** = ``-3``
  814. Represents the screen containing the window with the keyboard focus.
  815. .. _class_DisplayServer_constant_SCREEN_PRIMARY:
  816. .. rst-class:: classref-constant
  817. **SCREEN_PRIMARY** = ``-2``
  818. Represents the primary screen.
  819. .. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
  820. .. rst-class:: classref-constant
  821. **SCREEN_OF_MAIN_WINDOW** = ``-1``
  822. Represents the screen where the main window is located. This is usually the default value in functions that allow specifying one of several screens.
  823. .. _class_DisplayServer_constant_MAIN_WINDOW_ID:
  824. .. rst-class:: classref-constant
  825. **MAIN_WINDOW_ID** = ``0``
  826. The ID of the main window spawned by the engine, which can be passed to methods expecting a ``window_id``.
  827. .. _class_DisplayServer_constant_INVALID_WINDOW_ID:
  828. .. rst-class:: classref-constant
  829. **INVALID_WINDOW_ID** = ``-1``
  830. The ID that refers to a nonexisting window. This is be returned by some **DisplayServer** methods if no window matches the requested result.
  831. .. rst-class:: classref-section-separator
  832. ----
  833. .. rst-class:: classref-descriptions-group
  834. Method Descriptions
  835. -------------------
  836. .. _class_DisplayServer_method_clipboard_get:
  837. .. rst-class:: classref-method
  838. :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
  839. Returns the user's clipboard as a string if possible.
  840. .. rst-class:: classref-item-separator
  841. ----
  842. .. _class_DisplayServer_method_clipboard_get_primary:
  843. .. rst-class:: classref-method
  844. :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
  845. 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.
  846. \ **Note:** This method is only implemented on Linux (X11).
  847. .. rst-class:: classref-item-separator
  848. ----
  849. .. _class_DisplayServer_method_clipboard_has:
  850. .. rst-class:: classref-method
  851. :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
  852. Returns ``true`` if there is content on the user's clipboard.
  853. .. rst-class:: classref-item-separator
  854. ----
  855. .. _class_DisplayServer_method_clipboard_set:
  856. .. rst-class:: classref-method
  857. void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
  858. Sets the user's clipboard content to the given string.
  859. .. rst-class:: classref-item-separator
  860. ----
  861. .. _class_DisplayServer_method_clipboard_set_primary:
  862. .. rst-class:: classref-method
  863. void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
  864. 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.
  865. \ **Note:** This method is only implemented on Linux (X11).
  866. .. rst-class:: classref-item-separator
  867. ----
  868. .. _class_DisplayServer_method_cursor_get_shape:
  869. .. rst-class:: classref-method
  870. :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
  871. Returns the default mouse cursor shape set by :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>`.
  872. .. rst-class:: classref-item-separator
  873. ----
  874. .. _class_DisplayServer_method_cursor_set_custom_image:
  875. .. rst-class:: classref-method
  876. 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) **)**
  877. 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>`.
  878. .. rst-class:: classref-item-separator
  879. ----
  880. .. _class_DisplayServer_method_cursor_set_shape:
  881. .. rst-class:: classref-method
  882. void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
  883. 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>`.
  884. .. rst-class:: classref-item-separator
  885. ----
  886. .. _class_DisplayServer_method_dialog_input_text:
  887. .. rst-class:: classref-method
  888. :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 **)**
  889. 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.
  890. \ **Note:** This method is implemented only on macOS.
  891. .. rst-class:: classref-item-separator
  892. ----
  893. .. _class_DisplayServer_method_dialog_show:
  894. .. rst-class:: classref-method
  895. :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 **)**
  896. 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.
  897. \ **Note:** This method is implemented only on macOS.
  898. .. rst-class:: classref-item-separator
  899. ----
  900. .. _class_DisplayServer_method_enable_for_stealing_focus:
  901. .. rst-class:: classref-method
  902. void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
  903. 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.
  904. \ **Note:** This method is implemented only on Windows.
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_DisplayServer_method_force_process_and_drop_events:
  908. .. rst-class:: classref-method
  909. void **force_process_and_drop_events** **(** **)**
  910. Forces window manager processing while ignoring all :ref:`InputEvent<class_InputEvent>`\ s. See also :ref:`process_events<class_DisplayServer_method_process_events>`.
  911. \ **Note:** This method is implemented on Windows and macOS.
  912. .. rst-class:: classref-item-separator
  913. ----
  914. .. _class_DisplayServer_method_get_accent_color:
  915. .. rst-class:: classref-method
  916. :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
  917. Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
  918. \ **Note:** This method is implemented on macOS and Windows.
  919. .. rst-class:: classref-item-separator
  920. ----
  921. .. _class_DisplayServer_method_get_display_cutouts:
  922. .. rst-class:: classref-method
  923. :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
  924. 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>`.
  925. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  926. .. rst-class:: classref-item-separator
  927. ----
  928. .. _class_DisplayServer_method_get_display_safe_area:
  929. .. rst-class:: classref-method
  930. :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
  931. 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>`.
  932. .. rst-class:: classref-item-separator
  933. ----
  934. .. _class_DisplayServer_method_get_keyboard_focus_screen:
  935. .. rst-class:: classref-method
  936. :ref:`int<class_int>` **get_keyboard_focus_screen** **(** **)** |const|
  937. Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window.
  938. .. rst-class:: classref-item-separator
  939. ----
  940. .. _class_DisplayServer_method_get_name:
  941. .. rst-class:: classref-method
  942. :ref:`String<class_String>` **get_name** **(** **)** |const|
  943. 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).
  944. 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>`).
  945. .. rst-class:: classref-item-separator
  946. ----
  947. .. _class_DisplayServer_method_get_primary_screen:
  948. .. rst-class:: classref-method
  949. :ref:`int<class_int>` **get_primary_screen** **(** **)** |const|
  950. Returns index of the primary screen.
  951. .. rst-class:: classref-item-separator
  952. ----
  953. .. _class_DisplayServer_method_get_screen_count:
  954. .. rst-class:: classref-method
  955. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  956. Returns the number of displays available.
  957. .. rst-class:: classref-item-separator
  958. ----
  959. .. _class_DisplayServer_method_get_screen_from_rect:
  960. .. rst-class:: classref-method
  961. :ref:`int<class_int>` **get_screen_from_rect** **(** :ref:`Rect2<class_Rect2>` rect **)** |const|
  962. Returns index of the screen which contains specified rectangle.
  963. .. rst-class:: classref-item-separator
  964. ----
  965. .. _class_DisplayServer_method_get_swap_cancel_ok:
  966. .. rst-class:: classref-method
  967. :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
  968. Returns ``true`` if positions of **OK** and **Cancel** buttons are swapped in dialogs. This is enabled by default on Windows and UWP to follow interface conventions, and be toggled by changing :ref:`ProjectSettings.gui/common/swap_cancel_ok<class_ProjectSettings_property_gui/common/swap_cancel_ok>`.
  969. \ **Note:** This doesn't affect native dialogs such as the ones spawned by :ref:`dialog_show<class_DisplayServer_method_dialog_show>`.
  970. .. rst-class:: classref-item-separator
  971. ----
  972. .. _class_DisplayServer_method_get_window_at_screen_position:
  973. .. rst-class:: classref-method
  974. :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  975. 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:
  976. ::
  977. * (0, 0) +-------+
  978. | |
  979. +-------------+ | |
  980. | | | |
  981. | | | |
  982. +-------------+ +-------+
  983. .. rst-class:: classref-item-separator
  984. ----
  985. .. _class_DisplayServer_method_get_window_list:
  986. .. rst-class:: classref-method
  987. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
  988. Returns the list of Godot window IDs belonging to this process.
  989. \ **Note:** Native dialogs are not included in this list.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_DisplayServer_method_global_menu_add_check_item:
  993. .. rst-class:: classref-method
  994. :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 **)**
  995. Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
  996. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  997. 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`).
  998. \ **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``.
  999. \ **Note:** This method is implemented only on macOS.
  1000. \ **Supported system menu IDs:**\
  1001. ::
  1002. "_main" - Main menu (macOS).
  1003. "_dock" - Dock popup menu (macOS).
  1004. .. rst-class:: classref-item-separator
  1005. ----
  1006. .. _class_DisplayServer_method_global_menu_add_icon_check_item:
  1007. .. rst-class:: classref-method
  1008. :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 **)**
  1009. Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1010. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1011. 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`).
  1012. \ **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``.
  1013. \ **Note:** This method is implemented only on macOS.
  1014. \ **Supported system menu IDs:**\
  1015. ::
  1016. "_main" - Main menu (macOS).
  1017. "_dock" - Dock popup menu (macOS).
  1018. .. rst-class:: classref-item-separator
  1019. ----
  1020. .. _class_DisplayServer_method_global_menu_add_icon_item:
  1021. .. rst-class:: classref-method
  1022. :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 **)**
  1023. Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1024. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1025. 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`).
  1026. \ **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``.
  1027. \ **Note:** This method is implemented only on macOS.
  1028. \ **Supported system menu IDs:**\
  1029. ::
  1030. "_main" - Main menu (macOS).
  1031. "_dock" - Dock popup menu (macOS).
  1032. .. rst-class:: classref-item-separator
  1033. ----
  1034. .. _class_DisplayServer_method_global_menu_add_icon_radio_check_item:
  1035. .. rst-class:: classref-method
  1036. :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 **)**
  1037. Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
  1038. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1039. 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`).
  1040. \ **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.
  1041. \ **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``.
  1042. \ **Note:** This method is implemented only on macOS.
  1043. \ **Supported system menu IDs:**\
  1044. ::
  1045. "_main" - Main menu (macOS).
  1046. "_dock" - Dock popup menu (macOS).
  1047. .. rst-class:: classref-item-separator
  1048. ----
  1049. .. _class_DisplayServer_method_global_menu_add_item:
  1050. .. rst-class:: classref-method
  1051. :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 **)**
  1052. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1053. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1054. 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`).
  1055. \ **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``.
  1056. \ **Note:** This method is implemented only on macOS.
  1057. \ **Supported system menu IDs:**\
  1058. ::
  1059. "_main" - Main menu (macOS).
  1060. "_dock" - Dock popup menu (macOS).
  1061. .. rst-class:: classref-item-separator
  1062. ----
  1063. .. _class_DisplayServer_method_global_menu_add_multistate_item:
  1064. .. rst-class:: classref-method
  1065. :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 **)**
  1066. Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
  1067. 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``.
  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:** By default, there's no indication of the current item state, it should be changed manually.
  1071. \ **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``.
  1072. \ **Note:** This method is implemented only on macOS.
  1073. \ **Supported system menu IDs:**\
  1074. ::
  1075. "_main" - Main menu (macOS).
  1076. "_dock" - Dock popup menu (macOS).
  1077. .. rst-class:: classref-item-separator
  1078. ----
  1079. .. _class_DisplayServer_method_global_menu_add_radio_check_item:
  1080. .. rst-class:: classref-method
  1081. :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 **)**
  1082. Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
  1083. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1084. 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`).
  1085. \ **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.
  1086. \ **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``.
  1087. \ **Note:** This method is implemented only on macOS.
  1088. \ **Supported system menu IDs:**\
  1089. ::
  1090. "_main" - Main menu (macOS).
  1091. "_dock" - Dock popup menu (macOS).
  1092. .. rst-class:: classref-item-separator
  1093. ----
  1094. .. _class_DisplayServer_method_global_menu_add_separator:
  1095. .. rst-class:: classref-method
  1096. :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
  1097. Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
  1098. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1099. \ **Note:** This method is implemented only on macOS.
  1100. \ **Supported system menu IDs:**\
  1101. ::
  1102. "_main" - Main menu (macOS).
  1103. "_dock" - Dock popup menu (macOS).
  1104. .. rst-class:: classref-item-separator
  1105. ----
  1106. .. _class_DisplayServer_method_global_menu_add_submenu_item:
  1107. .. rst-class:: classref-method
  1108. :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 **)**
  1109. 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.
  1110. Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
  1111. \ **Note:** This method is implemented only on macOS.
  1112. \ **Supported system menu IDs:**\
  1113. ::
  1114. "_main" - Main menu (macOS).
  1115. "_dock" - Dock popup menu (macOS).
  1116. .. rst-class:: classref-item-separator
  1117. ----
  1118. .. _class_DisplayServer_method_global_menu_clear:
  1119. .. rst-class:: classref-method
  1120. void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
  1121. Removes all items from the global menu with ID ``menu_root``.
  1122. \ **Note:** This method is implemented only on macOS.
  1123. \ **Supported system menu IDs:**\
  1124. ::
  1125. "_main" - Main menu (macOS).
  1126. "_dock" - Dock popup menu (macOS).
  1127. .. rst-class:: classref-item-separator
  1128. ----
  1129. .. _class_DisplayServer_method_global_menu_get_item_accelerator:
  1130. .. rst-class:: classref-method
  1131. :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1132. 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.
  1133. \ **Note:** This method is implemented only on macOS.
  1134. .. rst-class:: classref-item-separator
  1135. ----
  1136. .. _class_DisplayServer_method_global_menu_get_item_callback:
  1137. .. rst-class:: classref-method
  1138. :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1139. Returns the callback of the item at index ``idx``.
  1140. \ **Note:** This method is implemented only on macOS.
  1141. .. rst-class:: classref-item-separator
  1142. ----
  1143. .. _class_DisplayServer_method_global_menu_get_item_count:
  1144. .. rst-class:: classref-method
  1145. :ref:`int<class_int>` **global_menu_get_item_count** **(** :ref:`String<class_String>` menu_root **)** |const|
  1146. Returns number of items in the global menu with ID ``menu_root``.
  1147. \ **Note:** This method is implemented only on macOS.
  1148. .. rst-class:: classref-item-separator
  1149. ----
  1150. .. _class_DisplayServer_method_global_menu_get_item_icon:
  1151. .. rst-class:: classref-method
  1152. :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1153. Returns the icon of the item at index ``idx``.
  1154. \ **Note:** This method is implemented only on macOS.
  1155. .. rst-class:: classref-item-separator
  1156. ----
  1157. .. _class_DisplayServer_method_global_menu_get_item_indentation_level:
  1158. .. rst-class:: classref-method
  1159. :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1160. Returns the horizontal offset of the item at the given ``idx``.
  1161. \ **Note:** This method is implemented only on macOS.
  1162. .. rst-class:: classref-item-separator
  1163. ----
  1164. .. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
  1165. .. rst-class:: classref-method
  1166. :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
  1167. 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.
  1168. \ **Note:** This method is implemented only on macOS.
  1169. .. rst-class:: classref-item-separator
  1170. ----
  1171. .. _class_DisplayServer_method_global_menu_get_item_index_from_text:
  1172. .. rst-class:: classref-method
  1173. :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
  1174. 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.
  1175. \ **Note:** This method is implemented only on macOS.
  1176. .. rst-class:: classref-item-separator
  1177. ----
  1178. .. _class_DisplayServer_method_global_menu_get_item_key_callback:
  1179. .. rst-class:: classref-method
  1180. :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1181. Returns the callback of the item accelerator at index ``idx``.
  1182. \ **Note:** This method is implemented only on macOS.
  1183. .. rst-class:: classref-item-separator
  1184. ----
  1185. .. _class_DisplayServer_method_global_menu_get_item_max_states:
  1186. .. rst-class:: classref-method
  1187. :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1188. 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.
  1189. \ **Note:** This method is implemented only on macOS.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_DisplayServer_method_global_menu_get_item_state:
  1193. .. rst-class:: classref-method
  1194. :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1195. Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1196. \ **Note:** This method is implemented only on macOS.
  1197. .. rst-class:: classref-item-separator
  1198. ----
  1199. .. _class_DisplayServer_method_global_menu_get_item_submenu:
  1200. .. rst-class:: classref-method
  1201. :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1202. 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.
  1203. \ **Note:** This method is implemented only on macOS.
  1204. .. rst-class:: classref-item-separator
  1205. ----
  1206. .. _class_DisplayServer_method_global_menu_get_item_tag:
  1207. .. rst-class:: classref-method
  1208. :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1209. 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.
  1210. \ **Note:** This method is implemented only on macOS.
  1211. .. rst-class:: classref-item-separator
  1212. ----
  1213. .. _class_DisplayServer_method_global_menu_get_item_text:
  1214. .. rst-class:: classref-method
  1215. :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1216. Returns the text of the item at index ``idx``.
  1217. \ **Note:** This method is implemented only on macOS.
  1218. .. rst-class:: classref-item-separator
  1219. ----
  1220. .. _class_DisplayServer_method_global_menu_get_item_tooltip:
  1221. .. rst-class:: classref-method
  1222. :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1223. Returns the tooltip associated with the specified index ``idx``.
  1224. \ **Note:** This method is implemented only on macOS.
  1225. .. rst-class:: classref-item-separator
  1226. ----
  1227. .. _class_DisplayServer_method_global_menu_is_item_checkable:
  1228. .. rst-class:: classref-method
  1229. :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1230. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  1231. \ **Note:** This method is implemented only on macOS.
  1232. .. rst-class:: classref-item-separator
  1233. ----
  1234. .. _class_DisplayServer_method_global_menu_is_item_checked:
  1235. .. rst-class:: classref-method
  1236. :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1237. Returns ``true`` if the item at index ``idx`` is checked.
  1238. \ **Note:** This method is implemented only on macOS.
  1239. .. rst-class:: classref-item-separator
  1240. ----
  1241. .. _class_DisplayServer_method_global_menu_is_item_disabled:
  1242. .. rst-class:: classref-method
  1243. :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1244. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  1245. See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
  1246. \ **Note:** This method is implemented only on macOS.
  1247. .. rst-class:: classref-item-separator
  1248. ----
  1249. .. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
  1250. .. rst-class:: classref-method
  1251. :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
  1252. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  1253. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1254. \ **Note:** This method is implemented only on macOS.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_DisplayServer_method_global_menu_remove_item:
  1258. .. rst-class:: classref-method
  1259. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
  1260. Removes the item at index ``idx`` from the global menu ``menu_root``.
  1261. \ **Note:** The indices of items after the removed item will be shifted by one.
  1262. \ **Note:** This method is implemented only on macOS.
  1263. .. rst-class:: classref-item-separator
  1264. ----
  1265. .. _class_DisplayServer_method_global_menu_set_item_accelerator:
  1266. .. rst-class:: classref-method
  1267. void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
  1268. 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`).
  1269. \ **Note:** This method is implemented only on macOS.
  1270. .. rst-class:: classref-item-separator
  1271. ----
  1272. .. _class_DisplayServer_method_global_menu_set_item_callback:
  1273. .. rst-class:: classref-method
  1274. void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
  1275. Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
  1276. \ **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.
  1277. \ **Note:** This method is implemented only on macOS.
  1278. .. rst-class:: classref-item-separator
  1279. ----
  1280. .. _class_DisplayServer_method_global_menu_set_item_checkable:
  1281. .. rst-class:: classref-method
  1282. void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1283. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  1284. \ **Note:** This method is implemented only on macOS.
  1285. .. rst-class:: classref-item-separator
  1286. ----
  1287. .. _class_DisplayServer_method_global_menu_set_item_checked:
  1288. .. rst-class:: classref-method
  1289. void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  1290. Sets the checkstate status of the item at index ``idx``.
  1291. \ **Note:** This method is implemented only on macOS.
  1292. .. rst-class:: classref-item-separator
  1293. ----
  1294. .. _class_DisplayServer_method_global_menu_set_item_disabled:
  1295. .. rst-class:: classref-method
  1296. void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  1297. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  1298. \ **Note:** This method is implemented only on macOS.
  1299. .. rst-class:: classref-item-separator
  1300. ----
  1301. .. _class_DisplayServer_method_global_menu_set_item_icon:
  1302. .. rst-class:: classref-method
  1303. void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  1304. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  1305. \ **Note:** This method is implemented only on macOS.
  1306. \ **Note:** This method is not supported by macOS "_dock" menu items.
  1307. .. rst-class:: classref-item-separator
  1308. ----
  1309. .. _class_DisplayServer_method_global_menu_set_item_indentation_level:
  1310. .. rst-class:: classref-method
  1311. void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
  1312. Sets the horizontal offset of the item at the given ``idx``.
  1313. \ **Note:** This method is implemented only on macOS.
  1314. .. rst-class:: classref-item-separator
  1315. ----
  1316. .. _class_DisplayServer_method_global_menu_set_item_key_callback:
  1317. .. rst-class:: classref-method
  1318. void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
  1319. Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
  1320. \ **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.
  1321. \ **Note:** This method is implemented only on macOS.
  1322. .. rst-class:: classref-item-separator
  1323. ----
  1324. .. _class_DisplayServer_method_global_menu_set_item_max_states:
  1325. .. rst-class:: classref-method
  1326. void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
  1327. 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.
  1328. \ **Note:** This method is implemented only on macOS.
  1329. .. rst-class:: classref-item-separator
  1330. ----
  1331. .. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
  1332. .. rst-class:: classref-method
  1333. void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
  1334. 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.
  1335. \ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  1336. \ **Note:** This method is implemented only on macOS.
  1337. .. rst-class:: classref-item-separator
  1338. ----
  1339. .. _class_DisplayServer_method_global_menu_set_item_state:
  1340. .. rst-class:: classref-method
  1341. void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  1342. Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
  1343. \ **Note:** This method is implemented only on macOS.
  1344. .. rst-class:: classref-item-separator
  1345. ----
  1346. .. _class_DisplayServer_method_global_menu_set_item_submenu:
  1347. .. rst-class:: classref-method
  1348. void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  1349. 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.
  1350. \ **Note:** This method is implemented only on macOS.
  1351. .. rst-class:: classref-item-separator
  1352. ----
  1353. .. _class_DisplayServer_method_global_menu_set_item_tag:
  1354. .. rst-class:: classref-method
  1355. void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
  1356. 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.
  1357. \ **Note:** This method is implemented only on macOS.
  1358. .. rst-class:: classref-item-separator
  1359. ----
  1360. .. _class_DisplayServer_method_global_menu_set_item_text:
  1361. .. rst-class:: classref-method
  1362. void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  1363. Sets the text of the item at index ``idx``.
  1364. \ **Note:** This method is implemented only on macOS.
  1365. .. rst-class:: classref-item-separator
  1366. ----
  1367. .. _class_DisplayServer_method_global_menu_set_item_tooltip:
  1368. .. rst-class:: classref-method
  1369. void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  1370. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  1371. \ **Note:** This method is implemented only on macOS.
  1372. .. rst-class:: classref-item-separator
  1373. ----
  1374. .. _class_DisplayServer_method_has_feature:
  1375. .. rst-class:: classref-method
  1376. :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
  1377. Returns ``true`` if the specified ``feature`` is supported by the current **DisplayServer**, ``false`` otherwise.
  1378. .. rst-class:: classref-item-separator
  1379. ----
  1380. .. _class_DisplayServer_method_ime_get_selection:
  1381. .. rst-class:: classref-method
  1382. :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
  1383. 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.
  1384. \ **Note:** This method is implemented only on macOS.
  1385. .. rst-class:: classref-item-separator
  1386. ----
  1387. .. _class_DisplayServer_method_ime_get_text:
  1388. .. rst-class:: classref-method
  1389. :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
  1390. Returns the composition string contained within the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ window.
  1391. \ **Note:** This method is implemented only on macOS.
  1392. .. rst-class:: classref-item-separator
  1393. ----
  1394. .. _class_DisplayServer_method_is_dark_mode:
  1395. .. rst-class:: classref-method
  1396. :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
  1397. Returns ``true`` if OS is using dark mode.
  1398. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1399. .. rst-class:: classref-item-separator
  1400. ----
  1401. .. _class_DisplayServer_method_is_dark_mode_supported:
  1402. .. rst-class:: classref-method
  1403. :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
  1404. Returns ``true`` if OS supports dark mode.
  1405. \ **Note:** This method is implemented on macOS, Windows and Linux (X11).
  1406. .. rst-class:: classref-item-separator
  1407. ----
  1408. .. _class_DisplayServer_method_is_touchscreen_available:
  1409. .. rst-class:: classref-method
  1410. :ref:`bool<class_bool>` **is_touchscreen_available** **(** **)** |const|
  1411. 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``.
  1412. .. rst-class:: classref-item-separator
  1413. ----
  1414. .. _class_DisplayServer_method_keyboard_get_current_layout:
  1415. .. rst-class:: classref-method
  1416. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1417. Returns active keyboard layout index.
  1418. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1419. .. rst-class:: classref-item-separator
  1420. ----
  1421. .. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
  1422. .. rst-class:: classref-method
  1423. :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
  1424. Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
  1425. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1426. .. rst-class:: classref-item-separator
  1427. ----
  1428. .. _class_DisplayServer_method_keyboard_get_layout_count:
  1429. .. rst-class:: classref-method
  1430. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1431. Returns the number of keyboard layouts.
  1432. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1433. .. rst-class:: classref-item-separator
  1434. ----
  1435. .. _class_DisplayServer_method_keyboard_get_layout_language:
  1436. .. rst-class:: classref-method
  1437. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1438. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1439. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1440. .. rst-class:: classref-item-separator
  1441. ----
  1442. .. _class_DisplayServer_method_keyboard_get_layout_name:
  1443. .. rst-class:: classref-method
  1444. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1445. Returns the localized name of the keyboard layout at position ``index``.
  1446. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1447. .. rst-class:: classref-item-separator
  1448. ----
  1449. .. _class_DisplayServer_method_keyboard_set_current_layout:
  1450. .. rst-class:: classref-method
  1451. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1452. Sets the active keyboard layout.
  1453. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1454. .. rst-class:: classref-item-separator
  1455. ----
  1456. .. _class_DisplayServer_method_mouse_get_button_state:
  1457. .. rst-class:: classref-method
  1458. |bitfield|\<:ref:`MouseButtonMask<enum_@GlobalScope_MouseButtonMask>`\> **mouse_get_button_state** **(** **)** |const|
  1459. 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>`.
  1460. .. rst-class:: classref-item-separator
  1461. ----
  1462. .. _class_DisplayServer_method_mouse_get_mode:
  1463. .. rst-class:: classref-method
  1464. :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
  1465. Returns the current mouse mode. See also :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>`.
  1466. .. rst-class:: classref-item-separator
  1467. ----
  1468. .. _class_DisplayServer_method_mouse_get_position:
  1469. .. rst-class:: classref-method
  1470. :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
  1471. Returns the mouse cursor's current position in screen coordinates.
  1472. .. rst-class:: classref-item-separator
  1473. ----
  1474. .. _class_DisplayServer_method_mouse_set_mode:
  1475. .. rst-class:: classref-method
  1476. void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
  1477. Sets the current mouse mode. See also :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>`.
  1478. .. rst-class:: classref-item-separator
  1479. ----
  1480. .. _class_DisplayServer_method_process_events:
  1481. .. rst-class:: classref-method
  1482. void **process_events** **(** **)**
  1483. 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>`.
  1484. .. rst-class:: classref-item-separator
  1485. ----
  1486. .. _class_DisplayServer_method_screen_get_dpi:
  1487. .. rst-class:: classref-method
  1488. :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1489. 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.
  1490. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1491. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1492. ::
  1493. ldpi - 120 dpi
  1494. mdpi - 160 dpi
  1495. hdpi - 240 dpi
  1496. xhdpi - 320 dpi
  1497. xxhdpi - 480 dpi
  1498. xxxhdpi - 640 dpi
  1499. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows. Returns ``72`` on unsupported platforms.
  1500. .. rst-class:: classref-item-separator
  1501. ----
  1502. .. _class_DisplayServer_method_screen_get_image:
  1503. .. rst-class:: classref-method
  1504. :ref:`Image<class_Image>` **screen_get_image** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1505. Returns screenshot of the ``screen``.
  1506. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1507. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1508. .. rst-class:: classref-item-separator
  1509. ----
  1510. .. _class_DisplayServer_method_screen_get_max_scale:
  1511. .. rst-class:: classref-method
  1512. :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
  1513. Returns the greatest scale factor of all screens.
  1514. \ **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.
  1515. \ **Note:** This method is implemented only on macOS.
  1516. .. rst-class:: classref-item-separator
  1517. ----
  1518. .. _class_DisplayServer_method_screen_get_orientation:
  1519. .. rst-class:: classref-method
  1520. :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1521. Returns the ``screen``'s current orientation. See also :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>`.
  1522. \ **Note:** This method is implemented on Android and iOS.
  1523. .. rst-class:: classref-item-separator
  1524. ----
  1525. .. _class_DisplayServer_method_screen_get_pixel:
  1526. .. rst-class:: classref-method
  1527. :ref:`Color<class_Color>` **screen_get_pixel** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
  1528. Returns color of the display pixel at the ``position``.
  1529. \ **Note:** This method is implemented on Linux (X11), macOS, and Windows.
  1530. \ **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color.
  1531. .. rst-class:: classref-item-separator
  1532. ----
  1533. .. _class_DisplayServer_method_screen_get_position:
  1534. .. rst-class:: classref-method
  1535. :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1536. 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:
  1537. ::
  1538. * (0, 0) +-------+
  1539. | |
  1540. +-------------+ | |
  1541. | | | |
  1542. | | | |
  1543. +-------------+ +-------+
  1544. See also :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>`.
  1545. .. rst-class:: classref-item-separator
  1546. ----
  1547. .. _class_DisplayServer_method_screen_get_refresh_rate:
  1548. .. rst-class:: classref-method
  1549. :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1550. 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.
  1551. \ **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.
  1552. To fallback to a default refresh rate if the method fails, try:
  1553. ::
  1554. var refresh_rate = DisplayServer.screen_get_refresh_rate()
  1555. if refresh_rate < 0:
  1556. refresh_rate = 60.0
  1557. .. rst-class:: classref-item-separator
  1558. ----
  1559. .. _class_DisplayServer_method_screen_get_scale:
  1560. .. rst-class:: classref-method
  1561. :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1562. Returns the scale factor of the specified screen by index.
  1563. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1564. \ **Note:** This method is implemented only on macOS.
  1565. .. rst-class:: classref-item-separator
  1566. ----
  1567. .. _class_DisplayServer_method_screen_get_size:
  1568. .. rst-class:: classref-method
  1569. :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1570. 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>`.
  1571. .. rst-class:: classref-item-separator
  1572. ----
  1573. .. _class_DisplayServer_method_screen_get_usable_rect:
  1574. .. rst-class:: classref-method
  1575. :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1576. 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>`.
  1577. .. rst-class:: classref-item-separator
  1578. ----
  1579. .. _class_DisplayServer_method_screen_is_kept_on:
  1580. .. rst-class:: classref-method
  1581. :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
  1582. 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>`.
  1583. .. rst-class:: classref-item-separator
  1584. ----
  1585. .. _class_DisplayServer_method_screen_set_keep_on:
  1586. .. rst-class:: classref-method
  1587. void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
  1588. 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>`.
  1589. .. rst-class:: classref-item-separator
  1590. ----
  1591. .. _class_DisplayServer_method_screen_set_orientation:
  1592. .. rst-class:: classref-method
  1593. void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
  1594. Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>`.
  1595. \ **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>`.
  1596. .. rst-class:: classref-item-separator
  1597. ----
  1598. .. _class_DisplayServer_method_set_icon:
  1599. .. rst-class:: classref-method
  1600. void **set_icon** **(** :ref:`Image<class_Image>` image **)**
  1601. 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.
  1602. .. rst-class:: classref-item-separator
  1603. ----
  1604. .. _class_DisplayServer_method_set_native_icon:
  1605. .. rst-class:: classref-method
  1606. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1607. 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.
  1608. .. rst-class:: classref-item-separator
  1609. ----
  1610. .. _class_DisplayServer_method_tablet_get_current_driver:
  1611. .. rst-class:: classref-method
  1612. :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
  1613. Returns current active tablet driver name.
  1614. \ **Note:** This method is implemented only on Windows.
  1615. .. rst-class:: classref-item-separator
  1616. ----
  1617. .. _class_DisplayServer_method_tablet_get_driver_count:
  1618. .. rst-class:: classref-method
  1619. :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
  1620. Returns the total number of available tablet drivers.
  1621. \ **Note:** This method is implemented only on Windows.
  1622. .. rst-class:: classref-item-separator
  1623. ----
  1624. .. _class_DisplayServer_method_tablet_get_driver_name:
  1625. .. rst-class:: classref-method
  1626. :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1627. Returns the tablet driver name for the given index.
  1628. \ **Note:** This method is implemented only on Windows.
  1629. .. rst-class:: classref-item-separator
  1630. ----
  1631. .. _class_DisplayServer_method_tablet_set_current_driver:
  1632. .. rst-class:: classref-method
  1633. void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
  1634. Set active tablet driver name.
  1635. \ **Note:** This method is implemented only on Windows.
  1636. .. rst-class:: classref-item-separator
  1637. ----
  1638. .. _class_DisplayServer_method_tts_get_voices:
  1639. .. rst-class:: classref-method
  1640. :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
  1641. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1642. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1643. - ``name`` is voice name.
  1644. - ``id`` is voice identifier.
  1645. - ``language`` is language code in ``lang_Variant`` format. ``lang`` part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And ``Variant`` part is an engine dependent string describing country, region or/and dialect.
  1646. 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.
  1647. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1648. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1649. .. rst-class:: classref-item-separator
  1650. ----
  1651. .. _class_DisplayServer_method_tts_get_voices_for_language:
  1652. .. rst-class:: classref-method
  1653. :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1654. Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
  1655. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1656. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1657. .. rst-class:: classref-item-separator
  1658. ----
  1659. .. _class_DisplayServer_method_tts_is_paused:
  1660. .. rst-class:: classref-method
  1661. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1662. Returns ``true`` if the synthesizer is in a paused state.
  1663. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1664. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1665. .. rst-class:: classref-item-separator
  1666. ----
  1667. .. _class_DisplayServer_method_tts_is_speaking:
  1668. .. rst-class:: classref-method
  1669. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1670. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1671. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1672. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1673. .. rst-class:: classref-item-separator
  1674. ----
  1675. .. _class_DisplayServer_method_tts_pause:
  1676. .. rst-class:: classref-method
  1677. void **tts_pause** **(** **)**
  1678. Puts the synthesizer into a paused state.
  1679. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1680. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1681. .. rst-class:: classref-item-separator
  1682. ----
  1683. .. _class_DisplayServer_method_tts_resume:
  1684. .. rst-class:: classref-method
  1685. void **tts_resume** **(** **)**
  1686. Resumes the synthesizer if it was paused.
  1687. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1688. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1689. .. rst-class:: classref-item-separator
  1690. ----
  1691. .. _class_DisplayServer_method_tts_set_utterance_callback:
  1692. .. rst-class:: classref-method
  1693. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
  1694. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1695. - :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.
  1696. - :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.
  1697. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1698. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1699. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1700. .. rst-class:: classref-item-separator
  1701. ----
  1702. .. _class_DisplayServer_method_tts_speak:
  1703. .. rst-class:: classref-method
  1704. 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 **)**
  1705. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1706. - ``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>`.
  1707. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1708. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1709. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1710. - ``utterance_id`` is passed as a parameter to the callback functions.
  1711. \ **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>`.
  1712. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1713. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1714. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1715. .. rst-class:: classref-item-separator
  1716. ----
  1717. .. _class_DisplayServer_method_tts_stop:
  1718. .. rst-class:: classref-method
  1719. void **tts_stop** **(** **)**
  1720. Stops synthesis in progress and removes all utterances from the queue.
  1721. \ **Note:** This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
  1722. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1723. .. rst-class:: classref-item-separator
  1724. ----
  1725. .. _class_DisplayServer_method_virtual_keyboard_get_height:
  1726. .. rst-class:: classref-method
  1727. :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
  1728. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1729. .. rst-class:: classref-item-separator
  1730. ----
  1731. .. _class_DisplayServer_method_virtual_keyboard_hide:
  1732. .. rst-class:: classref-method
  1733. void **virtual_keyboard_hide** **(** **)**
  1734. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1735. .. rst-class:: classref-item-separator
  1736. ----
  1737. .. _class_DisplayServer_method_virtual_keyboard_show:
  1738. .. rst-class:: classref-method
  1739. 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 **)**
  1740. Shows the virtual keyboard if the platform has one.
  1741. \ ``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).
  1742. \ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
  1743. \ ``type`` parameter allows configuring which type of virtual keyboard to show.
  1744. \ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
  1745. \ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
  1746. \ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
  1747. \ **Note:** This method is implemented on Android, iOS and Web.
  1748. .. rst-class:: classref-item-separator
  1749. ----
  1750. .. _class_DisplayServer_method_warp_mouse:
  1751. .. rst-class:: classref-method
  1752. void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
  1753. 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.
  1754. \ **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.
  1755. .. rst-class:: classref-item-separator
  1756. ----
  1757. .. _class_DisplayServer_method_window_can_draw:
  1758. .. rst-class:: classref-method
  1759. :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1760. 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``.
  1761. .. rst-class:: classref-item-separator
  1762. ----
  1763. .. _class_DisplayServer_method_window_get_active_popup:
  1764. .. rst-class:: classref-method
  1765. :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
  1766. Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
  1767. .. rst-class:: classref-item-separator
  1768. ----
  1769. .. _class_DisplayServer_method_window_get_attached_instance_id:
  1770. .. rst-class:: classref-method
  1771. :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1772. 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.
  1773. .. rst-class:: classref-item-separator
  1774. ----
  1775. .. _class_DisplayServer_method_window_get_current_screen:
  1776. .. rst-class:: classref-method
  1777. :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1778. 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>`.
  1779. .. rst-class:: classref-item-separator
  1780. ----
  1781. .. _class_DisplayServer_method_window_get_flag:
  1782. .. rst-class:: classref-method
  1783. :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
  1784. Returns the current value of the given window's ``flag``.
  1785. .. rst-class:: classref-item-separator
  1786. ----
  1787. .. _class_DisplayServer_method_window_get_max_size:
  1788. .. rst-class:: classref-method
  1789. :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1790. Returns the window's maximum size (in pixels). See also :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>`.
  1791. .. rst-class:: classref-item-separator
  1792. ----
  1793. .. _class_DisplayServer_method_window_get_min_size:
  1794. .. rst-class:: classref-method
  1795. :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1796. Returns the window's minimum size (in pixels). See also :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>`.
  1797. .. rst-class:: classref-item-separator
  1798. ----
  1799. .. _class_DisplayServer_method_window_get_mode:
  1800. .. rst-class:: classref-method
  1801. :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1802. Returns the mode of the given window.
  1803. .. rst-class:: classref-item-separator
  1804. ----
  1805. .. _class_DisplayServer_method_window_get_native_handle:
  1806. .. rst-class:: classref-method
  1807. :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
  1808. Returns internal structure pointers for use in plugins.
  1809. \ **Note:** This method is implemented on Android, Linux (X11), macOS and Windows.
  1810. .. rst-class:: classref-item-separator
  1811. ----
  1812. .. _class_DisplayServer_method_window_get_popup_safe_rect:
  1813. .. rst-class:: classref-method
  1814. :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
  1815. Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
  1816. .. rst-class:: classref-item-separator
  1817. ----
  1818. .. _class_DisplayServer_method_window_get_position:
  1819. .. rst-class:: classref-method
  1820. :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1821. Returns the position of the client area of the given window on the screen.
  1822. .. rst-class:: classref-item-separator
  1823. ----
  1824. .. _class_DisplayServer_method_window_get_position_with_decorations:
  1825. .. rst-class:: classref-method
  1826. :ref:`Vector2i<class_Vector2i>` **window_get_position_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1827. 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>`.
  1828. .. rst-class:: classref-item-separator
  1829. ----
  1830. .. _class_DisplayServer_method_window_get_safe_title_margins:
  1831. .. rst-class:: classref-method
  1832. :ref:`Vector3i<class_Vector3i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1833. 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.
  1834. .. rst-class:: classref-item-separator
  1835. ----
  1836. .. _class_DisplayServer_method_window_get_size:
  1837. .. rst-class:: classref-method
  1838. :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1839. 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>`.
  1840. .. rst-class:: classref-item-separator
  1841. ----
  1842. .. _class_DisplayServer_method_window_get_size_with_decorations:
  1843. .. rst-class:: classref-method
  1844. :ref:`Vector2i<class_Vector2i>` **window_get_size_with_decorations** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1845. 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>`.
  1846. .. rst-class:: classref-item-separator
  1847. ----
  1848. .. _class_DisplayServer_method_window_get_vsync_mode:
  1849. .. rst-class:: classref-method
  1850. :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1851. Returns the V-Sync mode of the given window.
  1852. .. rst-class:: classref-item-separator
  1853. ----
  1854. .. _class_DisplayServer_method_window_is_focused:
  1855. .. rst-class:: classref-method
  1856. :ref:`bool<class_bool>` **window_is_focused** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1857. Returns ``true`` if the window specified by ``window_id`` is focused.
  1858. .. rst-class:: classref-item-separator
  1859. ----
  1860. .. _class_DisplayServer_method_window_is_maximize_allowed:
  1861. .. rst-class:: classref-method
  1862. :ref:`bool<class_bool>` **window_is_maximize_allowed** **(** :ref:`int<class_int>` window_id=0 **)** |const|
  1863. Returns ``true`` if the given window can be maximized (the maximize button is enabled).
  1864. .. rst-class:: classref-item-separator
  1865. ----
  1866. .. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
  1867. .. rst-class:: classref-method
  1868. :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
  1869. Returns ``true``, if double-click on a window title should maximize it.
  1870. \ **Note:** This method is implemented only on macOS.
  1871. .. rst-class:: classref-item-separator
  1872. ----
  1873. .. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
  1874. .. rst-class:: classref-method
  1875. :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
  1876. Returns ``true``, if double-click on a window title should minimize it.
  1877. \ **Note:** This method is implemented only on macOS.
  1878. .. rst-class:: classref-item-separator
  1879. ----
  1880. .. _class_DisplayServer_method_window_move_to_foreground:
  1881. .. rst-class:: classref-method
  1882. void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
  1883. Moves the window specified by ``window_id`` to the foreground, so that it is visible over other windows.
  1884. .. rst-class:: classref-item-separator
  1885. ----
  1886. .. _class_DisplayServer_method_window_request_attention:
  1887. .. rst-class:: classref-method
  1888. void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
  1889. 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.
  1890. .. rst-class:: classref-item-separator
  1891. ----
  1892. .. _class_DisplayServer_method_window_set_current_screen:
  1893. .. rst-class:: classref-method
  1894. void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
  1895. 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>`.
  1896. .. rst-class:: classref-item-separator
  1897. ----
  1898. .. _class_DisplayServer_method_window_set_drop_files_callback:
  1899. .. rst-class:: classref-method
  1900. void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1901. 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``.
  1902. \ **Note:** This method is implemented on Windows, macOS, Linux (X11) and Web.
  1903. .. rst-class:: classref-item-separator
  1904. ----
  1905. .. _class_DisplayServer_method_window_set_exclusive:
  1906. .. rst-class:: classref-method
  1907. void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
  1908. 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.
  1909. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
  1910. \ **Note:** This method is implemented on macOS and Windows.
  1911. .. rst-class:: classref-item-separator
  1912. ----
  1913. .. _class_DisplayServer_method_window_set_flag:
  1914. .. rst-class:: classref-method
  1915. void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
  1916. Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
  1917. .. rst-class:: classref-item-separator
  1918. ----
  1919. .. _class_DisplayServer_method_window_set_ime_active:
  1920. .. rst-class:: classref-method
  1921. void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
  1922. 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>`.
  1923. .. rst-class:: classref-item-separator
  1924. ----
  1925. .. _class_DisplayServer_method_window_set_ime_position:
  1926. .. rst-class:: classref-method
  1927. void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  1928. 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``.
  1929. .. rst-class:: classref-item-separator
  1930. ----
  1931. .. _class_DisplayServer_method_window_set_input_event_callback:
  1932. .. rst-class:: classref-method
  1933. void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1934. Sets the ``callback`` that should be called when any :ref:`InputEvent<class_InputEvent>` is sent to the window specified by ``window_id``.
  1935. .. rst-class:: classref-item-separator
  1936. ----
  1937. .. _class_DisplayServer_method_window_set_input_text_callback:
  1938. .. rst-class:: classref-method
  1939. void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  1940. Sets the ``callback`` that should be called when text is entered using the virtual keyboard to the window specified by ``window_id``.
  1941. .. rst-class:: classref-item-separator
  1942. ----
  1943. .. _class_DisplayServer_method_window_set_max_size:
  1944. .. rst-class:: classref-method
  1945. void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
  1946. 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>`.
  1947. \ **Note:** It's recommended to change this value using :ref:`Window.max_size<class_Window_property_max_size>` instead.
  1948. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1949. .. rst-class:: classref-item-separator
  1950. ----
  1951. .. _class_DisplayServer_method_window_set_min_size:
  1952. .. rst-class:: classref-method
  1953. void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
  1954. 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>`.
  1955. \ **Note:** It's recommended to change this value using :ref:`Window.min_size<class_Window_property_min_size>` instead.
  1956. \ **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.
  1957. \ **Note:** Using third-party tools, it is possible for users to disable window geometry restrictions and therefore bypass this limit.
  1958. .. rst-class:: classref-item-separator
  1959. ----
  1960. .. _class_DisplayServer_method_window_set_mode:
  1961. .. rst-class:: classref-method
  1962. void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
  1963. Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
  1964. \ **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.
  1965. .. rst-class:: classref-item-separator
  1966. ----
  1967. .. _class_DisplayServer_method_window_set_mouse_passthrough:
  1968. .. rst-class:: classref-method
  1969. void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
  1970. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  1971. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  1972. .. tabs::
  1973. .. code-tab:: gdscript
  1974. # Set region, using Path2D node.
  1975. DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
  1976. # Set region, using Polygon2D node.
  1977. DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
  1978. # Reset region to default.
  1979. DisplayServer.window_set_mouse_passthrough([])
  1980. .. code-tab:: csharp
  1981. // Set region, using Path2D node.
  1982. DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
  1983. // Set region, using Polygon2D node.
  1984. DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
  1985. // Reset region to default.
  1986. DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
  1987. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is.
  1988. \ **Note:** This method is implemented on Linux (X11), macOS and Windows.
  1989. .. rst-class:: classref-item-separator
  1990. ----
  1991. .. _class_DisplayServer_method_window_set_popup_safe_rect:
  1992. .. rst-class:: classref-method
  1993. void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
  1994. 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.
  1995. .. rst-class:: classref-item-separator
  1996. ----
  1997. .. _class_DisplayServer_method_window_set_position:
  1998. .. rst-class:: classref-method
  1999. void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
  2000. 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:
  2001. ::
  2002. * (0, 0) +-------+
  2003. | |
  2004. +-------------+ | |
  2005. | | | |
  2006. | | | |
  2007. +-------------+ +-------+
  2008. See also :ref:`window_get_position<class_DisplayServer_method_window_get_position>` and :ref:`window_set_size<class_DisplayServer_method_window_set_size>`.
  2009. \ **Note:** It's recommended to change this value using :ref:`Window.position<class_Window_property_position>` instead.
  2010. .. rst-class:: classref-item-separator
  2011. ----
  2012. .. _class_DisplayServer_method_window_set_rect_changed_callback:
  2013. .. rst-class:: classref-method
  2014. void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2015. Sets the ``callback`` that will be called when the window specified by ``window_id`` is moved or resized.
  2016. .. rst-class:: classref-item-separator
  2017. ----
  2018. .. _class_DisplayServer_method_window_set_size:
  2019. .. rst-class:: classref-method
  2020. void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
  2021. 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>`.
  2022. \ **Note:** It's recommended to change this value using :ref:`Window.size<class_Window_property_size>` instead.
  2023. .. rst-class:: classref-item-separator
  2024. ----
  2025. .. _class_DisplayServer_method_window_set_title:
  2026. .. rst-class:: classref-method
  2027. void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
  2028. Sets the title of the given window to ``title``.
  2029. \ **Note:** It's recommended to change this value using :ref:`Window.title<class_Window_property_title>` instead.
  2030. \ **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.
  2031. .. rst-class:: classref-item-separator
  2032. ----
  2033. .. _class_DisplayServer_method_window_set_transient:
  2034. .. rst-class:: classref-method
  2035. void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
  2036. 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.
  2037. \ **Note:** It's recommended to change this value using :ref:`Window.transient<class_Window_property_transient>` instead.
  2038. \ **Note:** The behavior might be different depending on the platform.
  2039. .. rst-class:: classref-item-separator
  2040. ----
  2041. .. _class_DisplayServer_method_window_set_vsync_mode:
  2042. .. rst-class:: classref-method
  2043. void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
  2044. 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>`.
  2045. See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
  2046. 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.
  2047. \ **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.
  2048. .. rst-class:: classref-item-separator
  2049. ----
  2050. .. _class_DisplayServer_method_window_set_window_buttons_offset:
  2051. .. rst-class:: classref-method
  2052. void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
  2053. 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.
  2054. \ **Note:** This flag is implemented only on macOS.
  2055. .. rst-class:: classref-item-separator
  2056. ----
  2057. .. _class_DisplayServer_method_window_set_window_event_callback:
  2058. .. rst-class:: classref-method
  2059. void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
  2060. Sets the ``callback`` that will be called when an event occurs in the window specified by ``window_id``.
  2061. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  2062. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  2063. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  2064. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  2065. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  2066. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  2067. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`