class_os.rst 201 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/OS.xml.
  6. .. _class_OS:
  7. OS
  8. ==
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Operating System functions.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  25. | :ref:`String<class_String>` | :ref:`clipboard<class_OS_property_clipboard>` | ``""`` |
  26. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  27. | :ref:`int<class_int>` | :ref:`current_screen<class_OS_property_current_screen>` | ``0`` |
  28. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  29. | :ref:`bool<class_bool>` | :ref:`delta_smoothing<class_OS_property_delta_smoothing>` | ``true`` |
  30. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  31. | :ref:`int<class_int>` | :ref:`exit_code<class_OS_property_exit_code>` | ``0`` |
  32. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  33. | :ref:`bool<class_bool>` | :ref:`keep_screen_on<class_OS_property_keep_screen_on>` | ``true`` |
  34. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  35. | :ref:`bool<class_bool>` | :ref:`low_processor_usage_mode<class_OS_property_low_processor_usage_mode>` | ``false`` |
  36. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  37. | :ref:`int<class_int>` | :ref:`low_processor_usage_mode_sleep_usec<class_OS_property_low_processor_usage_mode_sleep_usec>` | ``6900`` |
  38. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  39. | :ref:`Vector2<class_Vector2>` | :ref:`max_window_size<class_OS_property_max_window_size>` | ``Vector2( 0, 0 )`` |
  40. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  41. | :ref:`Vector2<class_Vector2>` | :ref:`min_window_size<class_OS_property_min_window_size>` | ``Vector2( 0, 0 )`` |
  42. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  43. | :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` | :ref:`screen_orientation<class_OS_property_screen_orientation>` | ``0`` |
  44. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  45. | :ref:`String<class_String>` | :ref:`tablet_driver<class_OS_property_tablet_driver>` | ``""`` |
  46. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  47. | :ref:`bool<class_bool>` | :ref:`vsync_enabled<class_OS_property_vsync_enabled>` | ``true`` |
  48. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  49. | :ref:`bool<class_bool>` | :ref:`vsync_via_compositor<class_OS_property_vsync_via_compositor>` | ``false`` |
  50. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  51. | :ref:`bool<class_bool>` | :ref:`window_borderless<class_OS_property_window_borderless>` | ``false`` |
  52. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  53. | :ref:`bool<class_bool>` | :ref:`window_fullscreen<class_OS_property_window_fullscreen>` | ``false`` |
  54. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  55. | :ref:`bool<class_bool>` | :ref:`window_maximized<class_OS_property_window_maximized>` | ``false`` |
  56. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  57. | :ref:`bool<class_bool>` | :ref:`window_minimized<class_OS_property_window_minimized>` | ``false`` |
  58. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  59. | :ref:`bool<class_bool>` | :ref:`window_per_pixel_transparency_enabled<class_OS_property_window_per_pixel_transparency_enabled>` | ``false`` |
  60. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  61. | :ref:`Vector2<class_Vector2>` | :ref:`window_position<class_OS_property_window_position>` | ``Vector2( 0, 0 )`` |
  62. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  63. | :ref:`bool<class_bool>` | :ref:`window_resizable<class_OS_property_window_resizable>` | ``true`` |
  64. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  65. | :ref:`Vector2<class_Vector2>` | :ref:`window_size<class_OS_property_window_size>` | ``Vector2( 0, 0 )`` |
  66. +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+
  67. .. rst-class:: classref-reftable-group
  68. Methods
  69. -------
  70. .. table::
  71. :widths: auto
  72. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`alert<class_OS_method_alert>` **(** :ref:`String<class_String>` text, :ref:`String<class_String>` title="Alert!" **)** |
  74. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`can_draw<class_OS_method_can_draw>` **(** **)** |const| |
  76. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`can_use_threads<class_OS_method_can_use_threads>` **(** **)** |const| |
  78. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`center_window<class_OS_method_center_window>` **(** **)** |
  80. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`close_midi_inputs<class_OS_method_close_midi_inputs>` **(** **)** |
  82. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`crash<class_OS_method_crash>` **(** :ref:`String<class_String>` message **)** |
  84. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`delay_msec<class_OS_method_delay_msec>` **(** :ref:`int<class_int>` msec **)** |const| |
  86. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`delay_usec<class_OS_method_delay_usec>` **(** :ref:`int<class_int>` usec **)** |const| |
  88. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`dump_memory_to_file<class_OS_method_dump_memory_to_file>` **(** :ref:`String<class_String>` file **)** |
  90. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`dump_resources_to_file<class_OS_method_dump_resources_to_file>` **(** :ref:`String<class_String>` file **)** |
  92. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`execute<class_OS_method_execute>` **(** :ref:`String<class_String>` path, :ref:`PoolStringArray<class_PoolStringArray>` arguments, :ref:`bool<class_bool>` blocking=true, :ref:`Array<class_Array>` output=[ ], :ref:`bool<class_bool>` read_stderr=false, :ref:`bool<class_bool>` open_console=false **)** |
  94. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`int<class_int>` | :ref:`find_scancode_from_string<class_OS_method_find_scancode_from_string>` **(** :ref:`String<class_String>` string **)** |const| |
  96. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_audio_driver_count<class_OS_method_get_audio_driver_count>` **(** **)** |const| |
  98. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`String<class_String>` | :ref:`get_audio_driver_name<class_OS_method_get_audio_driver_name>` **(** :ref:`int<class_int>` driver **)** |const| |
  100. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`String<class_String>` | :ref:`get_cache_dir<class_OS_method_get_cache_dir>` **(** **)** |const| |
  102. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_cmdline_args<class_OS_method_get_cmdline_args>` **(** **)** |
  104. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`String<class_String>` | :ref:`get_config_dir<class_OS_method_get_config_dir>` **(** **)** |const| |
  106. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_connected_midi_inputs<class_OS_method_get_connected_midi_inputs>` **(** **)** |
  108. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`VideoDriver<enum_OS_VideoDriver>` | :ref:`get_current_video_driver<class_OS_method_get_current_video_driver>` **(** **)** |const| |
  110. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`String<class_String>` | :ref:`get_data_dir<class_OS_method_get_data_dir>` **(** **)** |const| |
  112. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_date<class_OS_method_get_date>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  114. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_datetime<class_OS_method_get_datetime>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  116. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_datetime_from_unix_time<class_OS_method_get_datetime_from_unix_time>` **(** :ref:`int<class_int>` unix_time_val **)** |const| |
  118. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`Array<class_Array>` | :ref:`get_display_cutouts<class_OS_method_get_display_cutouts>` **(** **)** |const| |
  120. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_dynamic_memory_usage<class_OS_method_get_dynamic_memory_usage>` **(** **)** |const| |
  122. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`String<class_String>` | :ref:`get_environment<class_OS_method_get_environment>` **(** :ref:`String<class_String>` variable **)** |const| |
  124. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`String<class_String>` | :ref:`get_executable_path<class_OS_method_get_executable_path>` **(** **)** |const| |
  126. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_granted_permissions<class_OS_method_get_granted_permissions>` **(** **)** |const| |
  128. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`Vector2<class_Vector2>` | :ref:`get_ime_selection<class_OS_method_get_ime_selection>` **(** **)** |const| |
  130. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`String<class_String>` | :ref:`get_ime_text<class_OS_method_get_ime_text>` **(** **)** |const| |
  132. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`String<class_String>` | :ref:`get_latin_keyboard_variant<class_OS_method_get_latin_keyboard_variant>` **(** **)** |const| |
  134. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`String<class_String>` | :ref:`get_locale<class_OS_method_get_locale>` **(** **)** |const| |
  136. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`String<class_String>` | :ref:`get_locale_language<class_OS_method_get_locale_language>` **(** **)** |const| |
  138. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`int<class_int>` | :ref:`get_main_thread_id<class_OS_method_get_main_thread_id>` **(** **)** |const| |
  140. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`String<class_String>` | :ref:`get_model_name<class_OS_method_get_model_name>` **(** **)** |const| |
  142. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`String<class_String>` | :ref:`get_name<class_OS_method_get_name>` **(** **)** |const| |
  144. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`int<class_int>` | :ref:`get_native_handle<class_OS_method_get_native_handle>` **(** :ref:`HandleType<enum_OS_HandleType>` handle_type **)** |
  146. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`int<class_int>` | :ref:`get_power_percent_left<class_OS_method_get_power_percent_left>` **(** **)** |
  148. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`int<class_int>` | :ref:`get_power_seconds_left<class_OS_method_get_power_seconds_left>` **(** **)** |
  150. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`PowerState<enum_OS_PowerState>` | :ref:`get_power_state<class_OS_method_get_power_state>` **(** **)** |
  152. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`int<class_int>` | :ref:`get_process_id<class_OS_method_get_process_id>` **(** **)** |const| |
  154. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`int<class_int>` | :ref:`get_processor_count<class_OS_method_get_processor_count>` **(** **)** |const| |
  156. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`String<class_String>` | :ref:`get_processor_name<class_OS_method_get_processor_name>` **(** **)** |const| |
  158. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`Vector2<class_Vector2>` | :ref:`get_real_window_size<class_OS_method_get_real_window_size>` **(** **)** |const| |
  160. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_restart_on_exit_arguments<class_OS_method_get_restart_on_exit_arguments>` **(** **)** |const| |
  162. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`String<class_String>` | :ref:`get_scancode_string<class_OS_method_get_scancode_string>` **(** :ref:`int<class_int>` code **)** |const| |
  164. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | :ref:`int<class_int>` | :ref:`get_screen_count<class_OS_method_get_screen_count>` **(** **)** |const| |
  166. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`int<class_int>` | :ref:`get_screen_dpi<class_OS_method_get_screen_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  168. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`float<class_float>` | :ref:`get_screen_max_scale<class_OS_method_get_screen_max_scale>` **(** **)** |const| |
  170. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_position<class_OS_method_get_screen_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  172. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | :ref:`float<class_float>` | :ref:`get_screen_refresh_rate<class_OS_method_get_screen_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  174. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | :ref:`float<class_float>` | :ref:`get_screen_scale<class_OS_method_get_screen_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  176. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`Vector2<class_Vector2>` | :ref:`get_screen_size<class_OS_method_get_screen_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
  178. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | :ref:`int<class_int>` | :ref:`get_splash_tick_msec<class_OS_method_get_splash_tick_msec>` **(** **)** |const| |
  180. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | :ref:`int<class_int>` | :ref:`get_static_memory_peak_usage<class_OS_method_get_static_memory_peak_usage>` **(** **)** |const| |
  182. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | :ref:`int<class_int>` | :ref:`get_static_memory_usage<class_OS_method_get_static_memory_usage>` **(** **)** |const| |
  184. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | :ref:`String<class_String>` | :ref:`get_system_dir<class_OS_method_get_system_dir>` **(** :ref:`SystemDir<enum_OS_SystemDir>` dir, :ref:`bool<class_bool>` shared_storage=true **)** |const| |
  186. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | :ref:`int<class_int>` | :ref:`get_system_time_msecs<class_OS_method_get_system_time_msecs>` **(** **)** |const| |
  188. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | :ref:`int<class_int>` | :ref:`get_system_time_secs<class_OS_method_get_system_time_secs>` **(** **)** |const| |
  190. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | :ref:`int<class_int>` | :ref:`get_tablet_driver_count<class_OS_method_get_tablet_driver_count>` **(** **)** |const| |
  192. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | :ref:`String<class_String>` | :ref:`get_tablet_driver_name<class_OS_method_get_tablet_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  194. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | :ref:`int<class_int>` | :ref:`get_thread_caller_id<class_OS_method_get_thread_caller_id>` **(** **)** |const| |
  196. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | :ref:`int<class_int>` | :ref:`get_ticks_msec<class_OS_method_get_ticks_msec>` **(** **)** |const| |
  198. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | :ref:`int<class_int>` | :ref:`get_ticks_usec<class_OS_method_get_ticks_usec>` **(** **)** |const| |
  200. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_time<class_OS_method_get_time>` **(** :ref:`bool<class_bool>` utc=false **)** |const| |
  202. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_time_zone_info<class_OS_method_get_time_zone_info>` **(** **)** |const| |
  204. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | :ref:`String<class_String>` | :ref:`get_unique_id<class_OS_method_get_unique_id>` **(** **)** |const| |
  206. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | :ref:`int<class_int>` | :ref:`get_unix_time<class_OS_method_get_unix_time>` **(** **)** |const| |
  208. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | :ref:`int<class_int>` | :ref:`get_unix_time_from_datetime<class_OS_method_get_unix_time_from_datetime>` **(** :ref:`Dictionary<class_Dictionary>` datetime **)** |const| |
  210. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | :ref:`String<class_String>` | :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>` **(** **)** |const| |
  212. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | :ref:`int<class_int>` | :ref:`get_video_driver_count<class_OS_method_get_video_driver_count>` **(** **)** |const| |
  214. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | :ref:`String<class_String>` | :ref:`get_video_driver_name<class_OS_method_get_video_driver_name>` **(** :ref:`VideoDriver<enum_OS_VideoDriver>` driver **)** |const| |
  216. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | :ref:`int<class_int>` | :ref:`get_virtual_keyboard_height<class_OS_method_get_virtual_keyboard_height>` **(** **)** |
  218. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | :ref:`Rect2<class_Rect2>` | :ref:`get_window_safe_area<class_OS_method_get_window_safe_area>` **(** **)** |const| |
  220. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`global_menu_add_item<class_OS_method_global_menu_add_item>` **(** :ref:`String<class_String>` menu, :ref:`String<class_String>` label, :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)** |
  222. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | void | :ref:`global_menu_add_separator<class_OS_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu **)** |
  224. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | void | :ref:`global_menu_clear<class_OS_method_global_menu_clear>` **(** :ref:`String<class_String>` menu **)** |
  226. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. | void | :ref:`global_menu_remove_item<class_OS_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu, :ref:`int<class_int>` idx **)** |
  228. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  229. | :ref:`bool<class_bool>` | :ref:`has_clipboard<class_OS_method_has_clipboard>` **(** **)** |const| |
  230. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  231. | :ref:`bool<class_bool>` | :ref:`has_environment<class_OS_method_has_environment>` **(** :ref:`String<class_String>` variable **)** |const| |
  232. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  233. | :ref:`bool<class_bool>` | :ref:`has_feature<class_OS_method_has_feature>` **(** :ref:`String<class_String>` tag_name **)** |const| |
  234. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  235. | :ref:`bool<class_bool>` | :ref:`has_touchscreen_ui_hint<class_OS_method_has_touchscreen_ui_hint>` **(** **)** |const| |
  236. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  237. | :ref:`bool<class_bool>` | :ref:`has_virtual_keyboard<class_OS_method_has_virtual_keyboard>` **(** **)** |const| |
  238. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  239. | void | :ref:`hide_virtual_keyboard<class_OS_method_hide_virtual_keyboard>` **(** **)** |
  240. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  241. | :ref:`bool<class_bool>` | :ref:`is_debug_build<class_OS_method_is_debug_build>` **(** **)** |const| |
  242. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  243. | :ref:`bool<class_bool>` | :ref:`is_ok_left_and_cancel_right<class_OS_method_is_ok_left_and_cancel_right>` **(** **)** |const| |
  244. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  245. | :ref:`bool<class_bool>` | :ref:`is_process_running<class_OS_method_is_process_running>` **(** :ref:`int<class_int>` pid **)** |const| |
  246. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  247. | :ref:`bool<class_bool>` | :ref:`is_restart_on_exit_set<class_OS_method_is_restart_on_exit_set>` **(** **)** |const| |
  248. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  249. | :ref:`bool<class_bool>` | :ref:`is_scancode_unicode<class_OS_method_is_scancode_unicode>` **(** :ref:`int<class_int>` code **)** |const| |
  250. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  251. | :ref:`bool<class_bool>` | :ref:`is_stdout_verbose<class_OS_method_is_stdout_verbose>` **(** **)** |const| |
  252. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  253. | :ref:`bool<class_bool>` | :ref:`is_userfs_persistent<class_OS_method_is_userfs_persistent>` **(** **)** |const| |
  254. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  255. | :ref:`bool<class_bool>` | :ref:`is_window_always_on_top<class_OS_method_is_window_always_on_top>` **(** **)** |const| |
  256. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  257. | :ref:`bool<class_bool>` | :ref:`is_window_focused<class_OS_method_is_window_focused>` **(** **)** |const| |
  258. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  259. | :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_OS_method_keyboard_get_current_layout>` **(** **)** |const| |
  260. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  261. | :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_OS_method_keyboard_get_layout_count>` **(** **)** |const| |
  262. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  263. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_OS_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
  264. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  265. | :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_OS_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
  266. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  267. | :ref:`int<class_int>` | :ref:`keyboard_get_scancode_from_physical<class_OS_method_keyboard_get_scancode_from_physical>` **(** :ref:`int<class_int>` scancode **)** |const| |
  268. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  269. | void | :ref:`keyboard_set_current_layout<class_OS_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
  270. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  271. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`kill<class_OS_method_kill>` **(** :ref:`int<class_int>` pid **)** |
  272. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  273. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`move_to_trash<class_OS_method_move_to_trash>` **(** :ref:`String<class_String>` path **)** |const| |
  274. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  275. | void | :ref:`move_window_to_foreground<class_OS_method_move_window_to_foreground>` **(** **)** |
  276. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  277. | :ref:`bool<class_bool>` | :ref:`native_video_is_playing<class_OS_method_native_video_is_playing>` **(** **)** |
  278. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  279. | void | :ref:`native_video_pause<class_OS_method_native_video_pause>` **(** **)** |
  280. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  281. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`native_video_play<class_OS_method_native_video_play>` **(** :ref:`String<class_String>` path, :ref:`float<class_float>` volume, :ref:`String<class_String>` audio_track, :ref:`String<class_String>` subtitle_track **)** |
  282. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  283. | void | :ref:`native_video_stop<class_OS_method_native_video_stop>` **(** **)** |
  284. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  285. | void | :ref:`native_video_unpause<class_OS_method_native_video_unpause>` **(** **)** |
  286. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  287. | void | :ref:`open_midi_inputs<class_OS_method_open_midi_inputs>` **(** **)** |
  288. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  289. | void | :ref:`print_all_resources<class_OS_method_print_all_resources>` **(** :ref:`String<class_String>` tofile="" **)** |
  290. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  291. | void | :ref:`print_all_textures_by_size<class_OS_method_print_all_textures_by_size>` **(** **)** |
  292. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  293. | void | :ref:`print_resources_by_type<class_OS_method_print_resources_by_type>` **(** :ref:`PoolStringArray<class_PoolStringArray>` types **)** |
  294. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  295. | void | :ref:`print_resources_in_use<class_OS_method_print_resources_in_use>` **(** :ref:`bool<class_bool>` short=false **)** |
  296. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  297. | :ref:`String<class_String>` | :ref:`read_string_from_stdin<class_OS_method_read_string_from_stdin>` **(** **)** |
  298. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  299. | void | :ref:`request_attention<class_OS_method_request_attention>` **(** **)** |
  300. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  301. | :ref:`bool<class_bool>` | :ref:`request_permission<class_OS_method_request_permission>` **(** :ref:`String<class_String>` name **)** |
  302. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  303. | :ref:`bool<class_bool>` | :ref:`request_permissions<class_OS_method_request_permissions>` **(** **)** |
  304. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  305. | :ref:`bool<class_bool>` | :ref:`set_environment<class_OS_method_set_environment>` **(** :ref:`String<class_String>` variable, :ref:`String<class_String>` value **)** |const| |
  306. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  307. | void | :ref:`set_icon<class_OS_method_set_icon>` **(** :ref:`Image<class_Image>` icon **)** |
  308. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  309. | void | :ref:`set_ime_active<class_OS_method_set_ime_active>` **(** :ref:`bool<class_bool>` active **)** |
  310. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  311. | void | :ref:`set_ime_position<class_OS_method_set_ime_position>` **(** :ref:`Vector2<class_Vector2>` position **)** |
  312. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  313. | void | :ref:`set_native_icon<class_OS_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
  314. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  315. | void | :ref:`set_restart_on_exit<class_OS_method_set_restart_on_exit>` **(** :ref:`bool<class_bool>` restart, :ref:`PoolStringArray<class_PoolStringArray>` arguments=PoolStringArray( ) **)** |
  316. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  317. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`set_thread_name<class_OS_method_set_thread_name>` **(** :ref:`String<class_String>` name **)** |
  318. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  319. | void | :ref:`set_use_file_access_save_and_swap<class_OS_method_set_use_file_access_save_and_swap>` **(** :ref:`bool<class_bool>` enabled **)** |
  320. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  321. | void | :ref:`set_window_always_on_top<class_OS_method_set_window_always_on_top>` **(** :ref:`bool<class_bool>` enabled **)** |
  322. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  323. | void | :ref:`set_window_mouse_passthrough<class_OS_method_set_window_mouse_passthrough>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` region **)** |
  324. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  325. | void | :ref:`set_window_title<class_OS_method_set_window_title>` **(** :ref:`String<class_String>` title **)** |
  326. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  327. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`shell_open<class_OS_method_shell_open>` **(** :ref:`String<class_String>` uri **)** |
  328. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  329. | void | :ref:`show_virtual_keyboard<class_OS_method_show_virtual_keyboard>` **(** :ref:`String<class_String>` existing_text="", :ref:`bool<class_bool>` multiline=false **)** |
  330. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  331. | void | :ref:`show_virtual_keyboard_type<class_OS_method_show_virtual_keyboard_type>` **(** :ref:`String<class_String>` existing_text="", :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` type=0 **)** |
  332. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  333. | :ref:`Array<class_Array>` | :ref:`tts_get_voices<class_OS_method_tts_get_voices>` **(** **)** |const| |
  334. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  335. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`tts_get_voices_for_language<class_OS_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
  336. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  337. | :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_OS_method_tts_is_paused>` **(** **)** |const| |
  338. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  339. | :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_OS_method_tts_is_speaking>` **(** **)** |const| |
  340. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  341. | void | :ref:`tts_pause<class_OS_method_tts_pause>` **(** **)** |
  342. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  343. | void | :ref:`tts_resume<class_OS_method_tts_resume>` **(** **)** |
  344. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  345. | void | :ref:`tts_set_utterance_callback<class_OS_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` event, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)** |
  346. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  347. | void | :ref:`tts_speak<class_OS_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 **)** |
  348. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  349. | void | :ref:`tts_stop<class_OS_method_tts_stop>` **(** **)** |
  350. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  351. .. rst-class:: classref-section-separator
  352. ----
  353. .. rst-class:: classref-descriptions-group
  354. Enumerations
  355. ------------
  356. .. _enum_OS_VideoDriver:
  357. .. rst-class:: classref-enumeration
  358. enum **VideoDriver**:
  359. .. _class_OS_constant_VIDEO_DRIVER_GLES2:
  360. .. rst-class:: classref-enumeration-constant
  361. :ref:`VideoDriver<enum_OS_VideoDriver>` **VIDEO_DRIVER_GLES2** = ``1``
  362. The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web.
  363. .. _class_OS_constant_VIDEO_DRIVER_GLES3:
  364. .. rst-class:: classref-enumeration-constant
  365. :ref:`VideoDriver<enum_OS_VideoDriver>` **VIDEO_DRIVER_GLES3** = ``0``
  366. The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _enum_OS_Weekday:
  370. .. rst-class:: classref-enumeration
  371. enum **Weekday**:
  372. .. _class_OS_constant_DAY_SUNDAY:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`Weekday<enum_OS_Weekday>` **DAY_SUNDAY** = ``0``
  375. Sunday.
  376. .. _class_OS_constant_DAY_MONDAY:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`Weekday<enum_OS_Weekday>` **DAY_MONDAY** = ``1``
  379. Monday.
  380. .. _class_OS_constant_DAY_TUESDAY:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`Weekday<enum_OS_Weekday>` **DAY_TUESDAY** = ``2``
  383. Tuesday.
  384. .. _class_OS_constant_DAY_WEDNESDAY:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`Weekday<enum_OS_Weekday>` **DAY_WEDNESDAY** = ``3``
  387. Wednesday.
  388. .. _class_OS_constant_DAY_THURSDAY:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`Weekday<enum_OS_Weekday>` **DAY_THURSDAY** = ``4``
  391. Thursday.
  392. .. _class_OS_constant_DAY_FRIDAY:
  393. .. rst-class:: classref-enumeration-constant
  394. :ref:`Weekday<enum_OS_Weekday>` **DAY_FRIDAY** = ``5``
  395. Friday.
  396. .. _class_OS_constant_DAY_SATURDAY:
  397. .. rst-class:: classref-enumeration-constant
  398. :ref:`Weekday<enum_OS_Weekday>` **DAY_SATURDAY** = ``6``
  399. Saturday.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _enum_OS_Month:
  403. .. rst-class:: classref-enumeration
  404. enum **Month**:
  405. .. _class_OS_constant_MONTH_JANUARY:
  406. .. rst-class:: classref-enumeration-constant
  407. :ref:`Month<enum_OS_Month>` **MONTH_JANUARY** = ``1``
  408. January.
  409. .. _class_OS_constant_MONTH_FEBRUARY:
  410. .. rst-class:: classref-enumeration-constant
  411. :ref:`Month<enum_OS_Month>` **MONTH_FEBRUARY** = ``2``
  412. February.
  413. .. _class_OS_constant_MONTH_MARCH:
  414. .. rst-class:: classref-enumeration-constant
  415. :ref:`Month<enum_OS_Month>` **MONTH_MARCH** = ``3``
  416. March.
  417. .. _class_OS_constant_MONTH_APRIL:
  418. .. rst-class:: classref-enumeration-constant
  419. :ref:`Month<enum_OS_Month>` **MONTH_APRIL** = ``4``
  420. April.
  421. .. _class_OS_constant_MONTH_MAY:
  422. .. rst-class:: classref-enumeration-constant
  423. :ref:`Month<enum_OS_Month>` **MONTH_MAY** = ``5``
  424. May.
  425. .. _class_OS_constant_MONTH_JUNE:
  426. .. rst-class:: classref-enumeration-constant
  427. :ref:`Month<enum_OS_Month>` **MONTH_JUNE** = ``6``
  428. June.
  429. .. _class_OS_constant_MONTH_JULY:
  430. .. rst-class:: classref-enumeration-constant
  431. :ref:`Month<enum_OS_Month>` **MONTH_JULY** = ``7``
  432. July.
  433. .. _class_OS_constant_MONTH_AUGUST:
  434. .. rst-class:: classref-enumeration-constant
  435. :ref:`Month<enum_OS_Month>` **MONTH_AUGUST** = ``8``
  436. August.
  437. .. _class_OS_constant_MONTH_SEPTEMBER:
  438. .. rst-class:: classref-enumeration-constant
  439. :ref:`Month<enum_OS_Month>` **MONTH_SEPTEMBER** = ``9``
  440. September.
  441. .. _class_OS_constant_MONTH_OCTOBER:
  442. .. rst-class:: classref-enumeration-constant
  443. :ref:`Month<enum_OS_Month>` **MONTH_OCTOBER** = ``10``
  444. October.
  445. .. _class_OS_constant_MONTH_NOVEMBER:
  446. .. rst-class:: classref-enumeration-constant
  447. :ref:`Month<enum_OS_Month>` **MONTH_NOVEMBER** = ``11``
  448. November.
  449. .. _class_OS_constant_MONTH_DECEMBER:
  450. .. rst-class:: classref-enumeration-constant
  451. :ref:`Month<enum_OS_Month>` **MONTH_DECEMBER** = ``12``
  452. December.
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _enum_OS_HandleType:
  456. .. rst-class:: classref-enumeration
  457. enum **HandleType**:
  458. .. _class_OS_constant_APPLICATION_HANDLE:
  459. .. rst-class:: classref-enumeration-constant
  460. :ref:`HandleType<enum_OS_HandleType>` **APPLICATION_HANDLE** = ``0``
  461. Application handle:
  462. - Windows: ``HINSTANCE`` of the application
  463. - MacOS: ``NSApplication*`` of the application (not yet implemented)
  464. - Android: ``JNIEnv*`` of the application (not yet implemented)
  465. .. _class_OS_constant_DISPLAY_HANDLE:
  466. .. rst-class:: classref-enumeration-constant
  467. :ref:`HandleType<enum_OS_HandleType>` **DISPLAY_HANDLE** = ``1``
  468. Display handle:
  469. - Linux: ``X11::Display*`` for the display
  470. .. _class_OS_constant_WINDOW_HANDLE:
  471. .. rst-class:: classref-enumeration-constant
  472. :ref:`HandleType<enum_OS_HandleType>` **WINDOW_HANDLE** = ``2``
  473. Window handle:
  474. - Windows: ``HWND`` of the main window
  475. - Linux: ``X11::Window*`` of the main window
  476. - MacOS: ``NSWindow*`` of the main window (not yet implemented)
  477. - Android: ``jObject`` the main android activity (not yet implemented)
  478. .. _class_OS_constant_WINDOW_VIEW:
  479. .. rst-class:: classref-enumeration-constant
  480. :ref:`HandleType<enum_OS_HandleType>` **WINDOW_VIEW** = ``3``
  481. Window view:
  482. - Windows: ``HDC`` of the main window drawing context
  483. - MacOS: ``NSView*`` of the main windows view (not yet implemented)
  484. .. _class_OS_constant_OPENGL_CONTEXT:
  485. .. rst-class:: classref-enumeration-constant
  486. :ref:`HandleType<enum_OS_HandleType>` **OPENGL_CONTEXT** = ``4``
  487. OpenGL Context:
  488. - Windows: ``HGLRC``\
  489. - Linux: ``X11::GLXContext``\
  490. - MacOS: ``NSOpenGLContext*`` (not yet implemented)
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _enum_OS_ScreenOrientation:
  494. .. rst-class:: classref-enumeration
  495. enum **ScreenOrientation**:
  496. .. _class_OS_constant_SCREEN_ORIENTATION_LANDSCAPE:
  497. .. rst-class:: classref-enumeration-constant
  498. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_LANDSCAPE** = ``0``
  499. Landscape screen orientation.
  500. .. _class_OS_constant_SCREEN_ORIENTATION_PORTRAIT:
  501. .. rst-class:: classref-enumeration-constant
  502. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_PORTRAIT** = ``1``
  503. Portrait screen orientation.
  504. .. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
  505. .. rst-class:: classref-enumeration-constant
  506. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_REVERSE_LANDSCAPE** = ``2``
  507. Reverse landscape screen orientation.
  508. .. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_PORTRAIT:
  509. .. rst-class:: classref-enumeration-constant
  510. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_REVERSE_PORTRAIT** = ``3``
  511. Reverse portrait screen orientation.
  512. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
  513. .. rst-class:: classref-enumeration-constant
  514. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR_LANDSCAPE** = ``4``
  515. Uses landscape or reverse landscape based on the hardware sensor.
  516. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_PORTRAIT:
  517. .. rst-class:: classref-enumeration-constant
  518. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR_PORTRAIT** = ``5``
  519. Uses portrait or reverse portrait based on the hardware sensor.
  520. .. _class_OS_constant_SCREEN_ORIENTATION_SENSOR:
  521. .. rst-class:: classref-enumeration-constant
  522. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **SCREEN_ORIENTATION_SENSOR** = ``6``
  523. Uses most suitable orientation based on the hardware sensor.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _enum_OS_VirtualKeyboardType:
  527. .. rst-class:: classref-enumeration
  528. enum **VirtualKeyboardType**:
  529. .. _class_OS_constant_KEYBOARD_TYPE_DEFAULT:
  530. .. rst-class:: classref-enumeration-constant
  531. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  532. Default text virtual keyboard.
  533. .. _class_OS_constant_KEYBOARD_TYPE_MULTILINE:
  534. .. rst-class:: classref-enumeration-constant
  535. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  536. Multiline virtual keyboard.
  537. .. _class_OS_constant_KEYBOARD_TYPE_NUMBER:
  538. .. rst-class:: classref-enumeration-constant
  539. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  540. Virtual number keypad, useful for PIN entry.
  541. .. _class_OS_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  542. .. rst-class:: classref-enumeration-constant
  543. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  544. Virtual number keypad, useful for entering fractional numbers.
  545. .. _class_OS_constant_KEYBOARD_TYPE_PHONE:
  546. .. rst-class:: classref-enumeration-constant
  547. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  548. Virtual phone number keypad.
  549. .. _class_OS_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  550. .. rst-class:: classref-enumeration-constant
  551. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  552. Virtual keyboard with additional keys to assist with typing email addresses.
  553. .. _class_OS_constant_KEYBOARD_TYPE_PASSWORD:
  554. .. rst-class:: classref-enumeration-constant
  555. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  556. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  557. \ **Note:** This is not supported on HTML5 or below iOS version 11.0. Instead, this will behave identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_OS_constant_KEYBOARD_TYPE_DEFAULT>`.
  558. .. _class_OS_constant_KEYBOARD_TYPE_URL:
  559. .. rst-class:: classref-enumeration-constant
  560. :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  561. Virtual keyboard with additional keys to assist with typing URLs.
  562. .. rst-class:: classref-item-separator
  563. ----
  564. .. _enum_OS_SystemDir:
  565. .. rst-class:: classref-enumeration
  566. enum **SystemDir**:
  567. .. _class_OS_constant_SYSTEM_DIR_DESKTOP:
  568. .. rst-class:: classref-enumeration-constant
  569. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DESKTOP** = ``0``
  570. Desktop directory path.
  571. .. _class_OS_constant_SYSTEM_DIR_DCIM:
  572. .. rst-class:: classref-enumeration-constant
  573. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DCIM** = ``1``
  574. DCIM (Digital Camera Images) directory path.
  575. .. _class_OS_constant_SYSTEM_DIR_DOCUMENTS:
  576. .. rst-class:: classref-enumeration-constant
  577. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DOCUMENTS** = ``2``
  578. Documents directory path.
  579. .. _class_OS_constant_SYSTEM_DIR_DOWNLOADS:
  580. .. rst-class:: classref-enumeration-constant
  581. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_DOWNLOADS** = ``3``
  582. Downloads directory path.
  583. .. _class_OS_constant_SYSTEM_DIR_MOVIES:
  584. .. rst-class:: classref-enumeration-constant
  585. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_MOVIES** = ``4``
  586. Movies directory path.
  587. .. _class_OS_constant_SYSTEM_DIR_MUSIC:
  588. .. rst-class:: classref-enumeration-constant
  589. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_MUSIC** = ``5``
  590. Music directory path.
  591. .. _class_OS_constant_SYSTEM_DIR_PICTURES:
  592. .. rst-class:: classref-enumeration-constant
  593. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_PICTURES** = ``6``
  594. Pictures directory path.
  595. .. _class_OS_constant_SYSTEM_DIR_RINGTONES:
  596. .. rst-class:: classref-enumeration-constant
  597. :ref:`SystemDir<enum_OS_SystemDir>` **SYSTEM_DIR_RINGTONES** = ``7``
  598. Ringtones directory path.
  599. .. rst-class:: classref-item-separator
  600. ----
  601. .. _enum_OS_PowerState:
  602. .. rst-class:: classref-enumeration
  603. enum **PowerState**:
  604. .. _class_OS_constant_POWERSTATE_UNKNOWN:
  605. .. rst-class:: classref-enumeration-constant
  606. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_UNKNOWN** = ``0``
  607. Unknown powerstate.
  608. .. _class_OS_constant_POWERSTATE_ON_BATTERY:
  609. .. rst-class:: classref-enumeration-constant
  610. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_ON_BATTERY** = ``1``
  611. Unplugged, running on battery.
  612. .. _class_OS_constant_POWERSTATE_NO_BATTERY:
  613. .. rst-class:: classref-enumeration-constant
  614. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_NO_BATTERY** = ``2``
  615. Plugged in, no battery available.
  616. .. _class_OS_constant_POWERSTATE_CHARGING:
  617. .. rst-class:: classref-enumeration-constant
  618. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_CHARGING** = ``3``
  619. Plugged in, battery charging.
  620. .. _class_OS_constant_POWERSTATE_CHARGED:
  621. .. rst-class:: classref-enumeration-constant
  622. :ref:`PowerState<enum_OS_PowerState>` **POWERSTATE_CHARGED** = ``4``
  623. Plugged in, battery fully charged.
  624. .. rst-class:: classref-item-separator
  625. ----
  626. .. _enum_OS_TTSUtteranceEvent:
  627. .. rst-class:: classref-enumeration
  628. enum **TTSUtteranceEvent**:
  629. .. _class_OS_constant_TTS_UTTERANCE_STARTED:
  630. .. rst-class:: classref-enumeration-constant
  631. :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` **TTS_UTTERANCE_STARTED** = ``0``
  632. Utterance has begun to be spoken.
  633. .. _class_OS_constant_TTS_UTTERANCE_ENDED:
  634. .. rst-class:: classref-enumeration-constant
  635. :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` **TTS_UTTERANCE_ENDED** = ``1``
  636. Utterance was successfully finished.
  637. .. _class_OS_constant_TTS_UTTERANCE_CANCELED:
  638. .. rst-class:: classref-enumeration-constant
  639. :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` **TTS_UTTERANCE_CANCELED** = ``2``
  640. Utterance was canceled, or TTS service was unable to process it.
  641. .. _class_OS_constant_TTS_UTTERANCE_BOUNDARY:
  642. .. rst-class:: classref-enumeration-constant
  643. :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` **TTS_UTTERANCE_BOUNDARY** = ``3``
  644. Utterance reached a word or sentence boundary.
  645. .. rst-class:: classref-section-separator
  646. ----
  647. .. rst-class:: classref-descriptions-group
  648. Property Descriptions
  649. ---------------------
  650. .. _class_OS_property_clipboard:
  651. .. rst-class:: classref-property
  652. :ref:`String<class_String>` **clipboard** = ``""``
  653. .. rst-class:: classref-property-setget
  654. - void **set_clipboard** **(** :ref:`String<class_String>` value **)**
  655. - :ref:`String<class_String>` **get_clipboard** **(** **)**
  656. The clipboard from the host OS. Might be unavailable on some platforms.
  657. .. rst-class:: classref-item-separator
  658. ----
  659. .. _class_OS_property_current_screen:
  660. .. rst-class:: classref-property
  661. :ref:`int<class_int>` **current_screen** = ``0``
  662. .. rst-class:: classref-property-setget
  663. - void **set_current_screen** **(** :ref:`int<class_int>` value **)**
  664. - :ref:`int<class_int>` **get_current_screen** **(** **)**
  665. The current screen index (starting from 0).
  666. .. rst-class:: classref-item-separator
  667. ----
  668. .. _class_OS_property_delta_smoothing:
  669. .. rst-class:: classref-property
  670. :ref:`bool<class_bool>` **delta_smoothing** = ``true``
  671. .. rst-class:: classref-property-setget
  672. - void **set_delta_smoothing** **(** :ref:`bool<class_bool>` value **)**
  673. - :ref:`bool<class_bool>` **is_delta_smoothing_enabled** **(** **)**
  674. If ``true``, the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This will only operate on systems where V-Sync is active.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_OS_property_exit_code:
  678. .. rst-class:: classref-property
  679. :ref:`int<class_int>` **exit_code** = ``0``
  680. .. rst-class:: classref-property-setget
  681. - void **set_exit_code** **(** :ref:`int<class_int>` value **)**
  682. - :ref:`int<class_int>` **get_exit_code** **(** **)**
  683. The exit code passed to the OS when the main loop exits. By convention, an exit code of ``0`` indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive).
  684. \ **Note:** This value will be ignored if using :ref:`SceneTree.quit<class_SceneTree_method_quit>` with an ``exit_code`` argument passed.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _class_OS_property_keep_screen_on:
  688. .. rst-class:: classref-property
  689. :ref:`bool<class_bool>` **keep_screen_on** = ``true``
  690. .. rst-class:: classref-property-setget
  691. - void **set_keep_screen_on** **(** :ref:`bool<class_bool>` value **)**
  692. - :ref:`bool<class_bool>` **is_keep_screen_on** **(** **)**
  693. If ``true``, the engine tries to keep the screen on while the game is running. Useful on mobile.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _class_OS_property_low_processor_usage_mode:
  697. .. rst-class:: classref-property
  698. :ref:`bool<class_bool>` **low_processor_usage_mode** = ``false``
  699. .. rst-class:: classref-property-setget
  700. - void **set_low_processor_usage_mode** **(** :ref:`bool<class_bool>` value **)**
  701. - :ref:`bool<class_bool>` **is_in_low_processor_usage_mode** **(** **)**
  702. If ``true``, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
  703. .. rst-class:: classref-item-separator
  704. ----
  705. .. _class_OS_property_low_processor_usage_mode_sleep_usec:
  706. .. rst-class:: classref-property
  707. :ref:`int<class_int>` **low_processor_usage_mode_sleep_usec** = ``6900``
  708. .. rst-class:: classref-property-setget
  709. - void **set_low_processor_usage_mode_sleep_usec** **(** :ref:`int<class_int>` value **)**
  710. - :ref:`int<class_int>` **get_low_processor_usage_mode_sleep_usec** **(** **)**
  711. The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
  712. .. rst-class:: classref-item-separator
  713. ----
  714. .. _class_OS_property_max_window_size:
  715. .. rst-class:: classref-property
  716. :ref:`Vector2<class_Vector2>` **max_window_size** = ``Vector2( 0, 0 )``
  717. .. rst-class:: classref-property-setget
  718. - void **set_max_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  719. - :ref:`Vector2<class_Vector2>` **get_max_window_size** **(** **)**
  720. The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system default value.
  721. .. rst-class:: classref-item-separator
  722. ----
  723. .. _class_OS_property_min_window_size:
  724. .. rst-class:: classref-property
  725. :ref:`Vector2<class_Vector2>` **min_window_size** = ``Vector2( 0, 0 )``
  726. .. rst-class:: classref-property-setget
  727. - void **set_min_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  728. - :ref:`Vector2<class_Vector2>` **get_min_window_size** **(** **)**
  729. The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system's default value.
  730. \ **Note:** By default, the project window has a minimum size of ``Vector2(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_OS_property_screen_orientation:
  734. .. rst-class:: classref-property
  735. :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **screen_orientation** = ``0``
  736. .. rst-class:: classref-property-setget
  737. - void **set_screen_orientation** **(** :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` value **)**
  738. - :ref:`ScreenOrientation<enum_OS_ScreenOrientation>` **get_screen_orientation** **(** **)**
  739. The current screen orientation.
  740. .. rst-class:: classref-item-separator
  741. ----
  742. .. _class_OS_property_tablet_driver:
  743. .. rst-class:: classref-property
  744. :ref:`String<class_String>` **tablet_driver** = ``""``
  745. .. rst-class:: classref-property-setget
  746. - void **set_current_tablet_driver** **(** :ref:`String<class_String>` value **)**
  747. - :ref:`String<class_String>` **get_current_tablet_driver** **(** **)**
  748. The current tablet driver in use.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_OS_property_vsync_enabled:
  752. .. rst-class:: classref-property
  753. :ref:`bool<class_bool>` **vsync_enabled** = ``true``
  754. .. rst-class:: classref-property-setget
  755. - void **set_use_vsync** **(** :ref:`bool<class_bool>` value **)**
  756. - :ref:`bool<class_bool>` **is_vsync_enabled** **(** **)**
  757. If ``true``, vertical synchronization (Vsync) is enabled.
  758. .. rst-class:: classref-item-separator
  759. ----
  760. .. _class_OS_property_vsync_via_compositor:
  761. .. rst-class:: classref-property
  762. :ref:`bool<class_bool>` **vsync_via_compositor** = ``false``
  763. .. rst-class:: classref-property-setget
  764. - void **set_vsync_via_compositor** **(** :ref:`bool<class_bool>` value **)**
  765. - :ref:`bool<class_bool>` **is_vsync_via_compositor_enabled** **(** **)**
  766. If ``true`` and ``vsync_enabled`` is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode.
  767. \ **Note:** This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it.
  768. \ **Note:** This property is only implemented on Windows.
  769. .. rst-class:: classref-item-separator
  770. ----
  771. .. _class_OS_property_window_borderless:
  772. .. rst-class:: classref-property
  773. :ref:`bool<class_bool>` **window_borderless** = ``false``
  774. .. rst-class:: classref-property-setget
  775. - void **set_borderless_window** **(** :ref:`bool<class_bool>` value **)**
  776. - :ref:`bool<class_bool>` **get_borderless_window** **(** **)**
  777. If ``true``, removes the window frame.
  778. \ **Note:** Setting ``window_borderless`` to ``false`` disables per-pixel transparency.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_OS_property_window_fullscreen:
  782. .. rst-class:: classref-property
  783. :ref:`bool<class_bool>` **window_fullscreen** = ``false``
  784. .. rst-class:: classref-property-setget
  785. - void **set_window_fullscreen** **(** :ref:`bool<class_bool>` value **)**
  786. - :ref:`bool<class_bool>` **is_window_fullscreen** **(** **)**
  787. If ``true``, the window is fullscreen.
  788. .. rst-class:: classref-item-separator
  789. ----
  790. .. _class_OS_property_window_maximized:
  791. .. rst-class:: classref-property
  792. :ref:`bool<class_bool>` **window_maximized** = ``false``
  793. .. rst-class:: classref-property-setget
  794. - void **set_window_maximized** **(** :ref:`bool<class_bool>` value **)**
  795. - :ref:`bool<class_bool>` **is_window_maximized** **(** **)**
  796. If ``true``, the window is maximized.
  797. .. rst-class:: classref-item-separator
  798. ----
  799. .. _class_OS_property_window_minimized:
  800. .. rst-class:: classref-property
  801. :ref:`bool<class_bool>` **window_minimized** = ``false``
  802. .. rst-class:: classref-property-setget
  803. - void **set_window_minimized** **(** :ref:`bool<class_bool>` value **)**
  804. - :ref:`bool<class_bool>` **is_window_minimized** **(** **)**
  805. If ``true``, the window is minimized.
  806. .. rst-class:: classref-item-separator
  807. ----
  808. .. _class_OS_property_window_per_pixel_transparency_enabled:
  809. .. rst-class:: classref-property
  810. :ref:`bool<class_bool>` **window_per_pixel_transparency_enabled** = ``false``
  811. .. rst-class:: classref-property-setget
  812. - void **set_window_per_pixel_transparency_enabled** **(** :ref:`bool<class_bool>` value **)**
  813. - :ref:`bool<class_bool>` **get_window_per_pixel_transparency_enabled** **(** **)**
  814. If ``true``, the window background is transparent and the window frame is removed.
  815. Enable :ref:`ProjectSettings.rendering/viewport/transparent_background<class_ProjectSettings_property_rendering/viewport/transparent_background>` or call ``get_tree().get_root().set_transparent_background(true)`` to disable background rendering on the root :ref:`Viewport<class_Viewport>`.
  816. \ **Note:** This property has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` setting is disabled.
  817. \ **Note:** This property is implemented on HTML5, Linux, macOS, Windows, and Android. It can't be changed at runtime for Android. Use :ref:`ProjectSettings.display/window/per_pixel_transparency/enabled<class_ProjectSettings_property_display/window/per_pixel_transparency/enabled>` to set it at startup instead.
  818. .. rst-class:: classref-item-separator
  819. ----
  820. .. _class_OS_property_window_position:
  821. .. rst-class:: classref-property
  822. :ref:`Vector2<class_Vector2>` **window_position** = ``Vector2( 0, 0 )``
  823. .. rst-class:: classref-property-setget
  824. - void **set_window_position** **(** :ref:`Vector2<class_Vector2>` value **)**
  825. - :ref:`Vector2<class_Vector2>` **get_window_position** **(** **)**
  826. The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right.
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_OS_property_window_resizable:
  830. .. rst-class:: classref-property
  831. :ref:`bool<class_bool>` **window_resizable** = ``true``
  832. .. rst-class:: classref-property-setget
  833. - void **set_window_resizable** **(** :ref:`bool<class_bool>` value **)**
  834. - :ref:`bool<class_bool>` **is_window_resizable** **(** **)**
  835. If ``true``, the window is resizable by the user.
  836. .. rst-class:: classref-item-separator
  837. ----
  838. .. _class_OS_property_window_size:
  839. .. rst-class:: classref-property
  840. :ref:`Vector2<class_Vector2>` **window_size** = ``Vector2( 0, 0 )``
  841. .. rst-class:: classref-property-setget
  842. - void **set_window_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  843. - :ref:`Vector2<class_Vector2>` **get_window_size** **(** **)**
  844. The size of the window (without counting window manager decorations).
  845. .. rst-class:: classref-section-separator
  846. ----
  847. .. rst-class:: classref-descriptions-group
  848. Method Descriptions
  849. -------------------
  850. .. _class_OS_method_alert:
  851. .. rst-class:: classref-method
  852. void **alert** **(** :ref:`String<class_String>` text, :ref:`String<class_String>` title="Alert!" **)**
  853. Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed.
  854. .. rst-class:: classref-item-separator
  855. ----
  856. .. _class_OS_method_can_draw:
  857. .. rst-class:: classref-method
  858. :ref:`bool<class_bool>` **can_draw** **(** **)** |const|
  859. Returns ``true`` if the host OS allows drawing.
  860. .. rst-class:: classref-item-separator
  861. ----
  862. .. _class_OS_method_can_use_threads:
  863. .. rst-class:: classref-method
  864. :ref:`bool<class_bool>` **can_use_threads** **(** **)** |const|
  865. Returns ``true`` if the current host platform is using multiple threads.
  866. .. rst-class:: classref-item-separator
  867. ----
  868. .. _class_OS_method_center_window:
  869. .. rst-class:: classref-method
  870. void **center_window** **(** **)**
  871. Centers the window on the screen if in windowed mode.
  872. .. rst-class:: classref-item-separator
  873. ----
  874. .. _class_OS_method_close_midi_inputs:
  875. .. rst-class:: classref-method
  876. void **close_midi_inputs** **(** **)**
  877. Shuts down system MIDI driver.
  878. \ **Note:** This method is implemented on Linux, macOS and Windows.
  879. .. rst-class:: classref-item-separator
  880. ----
  881. .. _class_OS_method_crash:
  882. .. rst-class:: classref-method
  883. void **crash** **(** :ref:`String<class_String>` message **)**
  884. Crashes the engine (or the editor if called within a ``tool`` script). This should *only* be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) :ref:`@GDScript.assert<class_@GDScript_method_assert>`, :ref:`@GDScript.push_error<class_@GDScript_method_push_error>` or :ref:`alert<class_OS_method_alert>`. See also :ref:`kill<class_OS_method_kill>`.
  885. .. rst-class:: classref-item-separator
  886. ----
  887. .. _class_OS_method_delay_msec:
  888. .. rst-class:: classref-method
  889. void **delay_msec** **(** :ref:`int<class_int>` msec **)** |const|
  890. Delays execution of the current thread by ``msec`` milliseconds. ``msec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_msec<class_OS_method_delay_msec>` will do nothing and will print an error message.
  891. \ **Note:** :ref:`delay_msec<class_OS_method_delay_msec>` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>`. Yielding with :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin<class_EditorPlugin>`\ s and :ref:`EditorScript<class_EditorScript>`\ s).
  892. \ **Note:** When :ref:`delay_msec<class_OS_method_delay_msec>` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_msec<class_OS_method_delay_msec>` as part of an :ref:`EditorPlugin<class_EditorPlugin>` or :ref:`EditorScript<class_EditorScript>`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_OS_method_delay_usec:
  896. .. rst-class:: classref-method
  897. void **delay_usec** **(** :ref:`int<class_int>` usec **)** |const|
  898. Delays execution of the current thread by ``usec`` microseconds. ``usec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_usec<class_OS_method_delay_usec>` will do nothing and will print an error message.
  899. \ **Note:** :ref:`delay_usec<class_OS_method_delay_usec>` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>`. Yielding with :ref:`SceneTree.create_timer<class_SceneTree_method_create_timer>` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin<class_EditorPlugin>`\ s and :ref:`EditorScript<class_EditorScript>`\ s).
  900. \ **Note:** When :ref:`delay_usec<class_OS_method_delay_usec>` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_usec<class_OS_method_delay_usec>` as part of an :ref:`EditorPlugin<class_EditorPlugin>` or :ref:`EditorScript<class_EditorScript>`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
  901. .. rst-class:: classref-item-separator
  902. ----
  903. .. _class_OS_method_dump_memory_to_file:
  904. .. rst-class:: classref-method
  905. void **dump_memory_to_file** **(** :ref:`String<class_String>` file **)**
  906. Dumps the memory allocation ringlist to a file (only works in debug).
  907. Entry format per line: "Address - Size - Description".
  908. .. rst-class:: classref-item-separator
  909. ----
  910. .. _class_OS_method_dump_resources_to_file:
  911. .. rst-class:: classref-method
  912. void **dump_resources_to_file** **(** :ref:`String<class_String>` file **)**
  913. Dumps all used resources to file (only works in debug).
  914. Entry format per line: "Resource Type : Resource Location".
  915. At the end of the file is a statistic of all used Resource Types.
  916. .. rst-class:: classref-item-separator
  917. ----
  918. .. _class_OS_method_execute:
  919. .. rst-class:: classref-method
  920. :ref:`int<class_int>` **execute** **(** :ref:`String<class_String>` path, :ref:`PoolStringArray<class_PoolStringArray>` arguments, :ref:`bool<class_bool>` blocking=true, :ref:`Array<class_Array>` output=[ ], :ref:`bool<class_bool>` read_stderr=false, :ref:`bool<class_bool>` open_console=false **)**
  921. Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable.
  922. The arguments are used in the given order and separated by a space, so ``OS.execute("ping", ["-w", "3", "godotengine.org"], false)`` will resolve to ``ping -w 3 godotengine.org`` in the system's shell.
  923. This method has slightly different behavior based on whether the ``blocking`` mode is enabled.
  924. If ``blocking`` is ``true``, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the ``output`` array as a single string. When the process terminates, the Godot thread will resume execution.
  925. If ``blocking`` is ``false``, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so ``output`` will be empty.
  926. On Windows, if ``open_console`` is ``true`` and process is console app, new terminal window will be opened, it's ignored on other platforms.
  927. The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill<class_OS_method_kill>`). If the process forking (non-blocking) or opening (blocking) fails, the method will return ``-1`` or another exit code.
  928. Example of blocking mode and retrieving the shell output:
  929. ::
  930. var output = []
  931. var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
  932. Example of non-blocking mode, running another instance of the project and storing its process ID:
  933. ::
  934. var pid = OS.execute(OS.get_executable_path(), [], false)
  935. If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example:
  936. ::
  937. OS.execute("CMD.exe", ["/C", "cd %TEMP% && dir"], true, output)
  938. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  939. \ **Note:** To execute a Windows command interpreter built-in command, specify ``cmd.exe`` in ``path``, ``/c`` as the first argument, and the desired command as the second argument.
  940. \ **Note:** To execute a PowerShell built-in command, specify ``powershell.exe`` in ``path``, ``-Command`` as the first argument, and the desired command as the second argument.
  941. \ **Note:** To execute a Unix shell built-in command, specify shell executable name in ``path``, ``-c`` as the first argument, and the desired command as the second argument.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_OS_method_find_scancode_from_string:
  945. .. rst-class:: classref-method
  946. :ref:`int<class_int>` **find_scancode_from_string** **(** :ref:`String<class_String>` string **)** |const|
  947. Returns the scancode of the given string (e.g. "Escape").
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_OS_method_get_audio_driver_count:
  951. .. rst-class:: classref-method
  952. :ref:`int<class_int>` **get_audio_driver_count** **(** **)** |const|
  953. Returns the total number of available audio drivers.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_OS_method_get_audio_driver_name:
  957. .. rst-class:: classref-method
  958. :ref:`String<class_String>` **get_audio_driver_name** **(** :ref:`int<class_int>` driver **)** |const|
  959. Returns the audio driver name for the given index.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_OS_method_get_cache_dir:
  963. .. rst-class:: classref-method
  964. :ref:`String<class_String>` **get_cache_dir** **(** **)** |const|
  965. Returns the *global* cache data directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_config_dir<class_OS_method_get_config_dir>` and :ref:`get_data_dir<class_OS_method_get_data_dir>`.
  966. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  967. .. rst-class:: classref-item-separator
  968. ----
  969. .. _class_OS_method_get_cmdline_args:
  970. .. rst-class:: classref-method
  971. :ref:`PoolStringArray<class_PoolStringArray>` **get_cmdline_args** **(** **)**
  972. Returns the command-line arguments passed to the engine.
  973. Command-line arguments can be written in any form, including both ``--key value`` and ``--key=value`` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
  974. You can also incorporate environment variables using the :ref:`get_environment<class_OS_method_get_environment>` method.
  975. You can set :ref:`ProjectSettings.editor/main_run_args<class_ProjectSettings_property_editor/main_run_args>` to define command-line arguments to be passed by the editor when running the project.
  976. Here's a minimal example on how to parse command-line arguments into a dictionary using the ``--key=value`` form for arguments:
  977. ::
  978. var arguments = {}
  979. for argument in OS.get_cmdline_args():
  980. if argument.find("=") > -1:
  981. var key_value = argument.split("=")
  982. arguments[key_value[0].lstrip("--")] = key_value[1]
  983. else:
  984. # Options without an argument will be present in the dictionary,
  985. # with the value set to an empty string.
  986. arguments[argument.lstrip("--")] = ""
  987. .. rst-class:: classref-item-separator
  988. ----
  989. .. _class_OS_method_get_config_dir:
  990. .. rst-class:: classref-method
  991. :ref:`String<class_String>` **get_config_dir** **(** **)** |const|
  992. Returns the *global* user configuration directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir<class_OS_method_get_cache_dir>` and :ref:`get_data_dir<class_OS_method_get_data_dir>`.
  993. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  994. .. rst-class:: classref-item-separator
  995. ----
  996. .. _class_OS_method_get_connected_midi_inputs:
  997. .. rst-class:: classref-method
  998. :ref:`PoolStringArray<class_PoolStringArray>` **get_connected_midi_inputs** **(** **)**
  999. Returns an array of MIDI device names.
  1000. The returned array will be empty if the system MIDI driver has not previously been initialised with :ref:`open_midi_inputs<class_OS_method_open_midi_inputs>`.
  1001. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_OS_method_get_current_video_driver:
  1005. .. rst-class:: classref-method
  1006. :ref:`VideoDriver<enum_OS_VideoDriver>` **get_current_video_driver** **(** **)** |const|
  1007. Returns the currently used video driver, using one of the values from :ref:`VideoDriver<enum_OS_VideoDriver>`.
  1008. .. rst-class:: classref-item-separator
  1009. ----
  1010. .. _class_OS_method_get_data_dir:
  1011. .. rst-class:: classref-method
  1012. :ref:`String<class_String>` **get_data_dir** **(** **)** |const|
  1013. Returns the *global* user data directory according to the operating system's standards. On Linux, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See :doc:`File paths in Godot projects <../tutorials/io/data_paths>` in the documentation for more information. See also :ref:`get_cache_dir<class_OS_method_get_cache_dir>` and :ref:`get_config_dir<class_OS_method_get_config_dir>`.
  1014. Not to be confused with :ref:`get_user_data_dir<class_OS_method_get_user_data_dir>`, which returns the *project-specific* user data path.
  1015. .. rst-class:: classref-item-separator
  1016. ----
  1017. .. _class_OS_method_get_date:
  1018. .. rst-class:: classref-method
  1019. :ref:`Dictionary<class_Dictionary>` **get_date** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  1020. Deprecated, use :ref:`Time.get_date_dict_from_system<class_Time_method_get_date_dict_from_system>` instead.
  1021. Returns current date as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time).
  1022. .. rst-class:: classref-item-separator
  1023. ----
  1024. .. _class_OS_method_get_datetime:
  1025. .. rst-class:: classref-method
  1026. :ref:`Dictionary<class_Dictionary>` **get_datetime** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  1027. Deprecated, use :ref:`Time.get_datetime_dict_from_system<class_Time_method_get_datetime_dict_from_system>` instead.
  1028. Returns current datetime as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time), ``hour``, ``minute``, ``second``.
  1029. .. rst-class:: classref-item-separator
  1030. ----
  1031. .. _class_OS_method_get_datetime_from_unix_time:
  1032. .. rst-class:: classref-method
  1033. :ref:`Dictionary<class_Dictionary>` **get_datetime_from_unix_time** **(** :ref:`int<class_int>` unix_time_val **)** |const|
  1034. Deprecated, use :ref:`Time.get_datetime_dict_from_unix_time<class_Time_method_get_datetime_dict_from_unix_time>` instead.
  1035. Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds).
  1036. The returned Dictionary's values will be the same as :ref:`get_datetime<class_OS_method_get_datetime>`, with the exception of Daylight Savings Time as it cannot be determined from the epoch.
  1037. .. rst-class:: classref-item-separator
  1038. ----
  1039. .. _class_OS_method_get_display_cutouts:
  1040. .. rst-class:: classref-method
  1041. :ref:`Array<class_Array>` **get_display_cutouts** **(** **)** |const|
  1042. 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_window_safe_area<class_OS_method_get_window_safe_area>`.
  1043. \ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
  1044. .. rst-class:: classref-item-separator
  1045. ----
  1046. .. _class_OS_method_get_dynamic_memory_usage:
  1047. .. rst-class:: classref-method
  1048. :ref:`int<class_int>` **get_dynamic_memory_usage** **(** **)** |const|
  1049. Returns the total amount of dynamic memory used (only works in debug).
  1050. .. rst-class:: classref-item-separator
  1051. ----
  1052. .. _class_OS_method_get_environment:
  1053. .. rst-class:: classref-method
  1054. :ref:`String<class_String>` **get_environment** **(** :ref:`String<class_String>` variable **)** |const|
  1055. Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist.
  1056. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  1057. .. rst-class:: classref-item-separator
  1058. ----
  1059. .. _class_OS_method_get_executable_path:
  1060. .. rst-class:: classref-method
  1061. :ref:`String<class_String>` **get_executable_path** **(** **)** |const|
  1062. Returns the path to the current engine executable.
  1063. .. rst-class:: classref-item-separator
  1064. ----
  1065. .. _class_OS_method_get_granted_permissions:
  1066. .. rst-class:: classref-method
  1067. :ref:`PoolStringArray<class_PoolStringArray>` **get_granted_permissions** **(** **)** |const|
  1068. With this function, you can get the list of dangerous permissions that have been granted to the Android application.
  1069. \ **Note:** This method is implemented on Android.
  1070. .. rst-class:: classref-item-separator
  1071. ----
  1072. .. _class_OS_method_get_ime_selection:
  1073. .. rst-class:: classref-method
  1074. :ref:`Vector2<class_Vector2>` **get_ime_selection** **(** **)** |const|
  1075. Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string.
  1076. \ :ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE<class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE>` is sent to the application to notify it of changes to the IME cursor position.
  1077. \ **Note:** This method is implemented on macOS.
  1078. .. rst-class:: classref-item-separator
  1079. ----
  1080. .. _class_OS_method_get_ime_text:
  1081. .. rst-class:: classref-method
  1082. :ref:`String<class_String>` **get_ime_text** **(** **)** |const|
  1083. Returns the IME intermediate composition string.
  1084. \ :ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE<class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE>` is sent to the application to notify it of changes to the IME composition string.
  1085. \ **Note:** This method is implemented on macOS.
  1086. .. rst-class:: classref-item-separator
  1087. ----
  1088. .. _class_OS_method_get_latin_keyboard_variant:
  1089. .. rst-class:: classref-method
  1090. :ref:`String<class_String>` **get_latin_keyboard_variant** **(** **)** |const|
  1091. Returns the current latin keyboard variant as a String.
  1092. Possible return values are: ``"QWERTY"``, ``"AZERTY"``, ``"QZERTY"``, ``"DVORAK"``, ``"NEO"``, ``"COLEMAK"`` or ``"ERROR"``.
  1093. \ **Note:** This method is implemented on Linux, macOS and Windows. Returns ``"QWERTY"`` on unsupported platforms.
  1094. .. rst-class:: classref-item-separator
  1095. ----
  1096. .. _class_OS_method_get_locale:
  1097. .. rst-class:: classref-method
  1098. :ref:`String<class_String>` **get_locale** **(** **)** |const|
  1099. Returns the host OS locale as a string of the form ``language_Script_COUNTRY_VARIANT@extra``. If you want only the language code and not the fully specified locale from the OS, you can use :ref:`get_locale_language<class_OS_method_get_locale_language>`.
  1100. \ ``language`` - 2 or 3-letter `language code <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__, in lower case.
  1101. \ ``Script`` - optional, 4-letter `script code <https://en.wikipedia.org/wiki/ISO_15924>`__, in title case.
  1102. \ ``COUNTRY`` - optional, 2 or 3-letter `country code <https://en.wikipedia.org/wiki/ISO_3166-1>`__, in upper case.
  1103. \ ``VARIANT`` - optional, language variant, region and sort order. Variant can have any number of underscored keywords.
  1104. \ ``extra`` - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_OS_method_get_locale_language:
  1108. .. rst-class:: classref-method
  1109. :ref:`String<class_String>` **get_locale_language** **(** **)** |const|
  1110. Returns the host OS locale's 2 or 3-letter `language code <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__ as a string which should be consistent on all platforms. This is equivalent to extracting the ``language`` part of the :ref:`get_locale<class_OS_method_get_locale>` string.
  1111. This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with ``fr_CA`` locale, this would return ``fr``.
  1112. .. rst-class:: classref-item-separator
  1113. ----
  1114. .. _class_OS_method_get_main_thread_id:
  1115. .. rst-class:: classref-method
  1116. :ref:`int<class_int>` **get_main_thread_id** **(** **)** |const|
  1117. Returns the ID of the main thread. See :ref:`get_thread_caller_id<class_OS_method_get_thread_caller_id>`.
  1118. \ **Note:** Thread IDs are not deterministic and may be reused across application restarts.
  1119. .. rst-class:: classref-item-separator
  1120. ----
  1121. .. _class_OS_method_get_model_name:
  1122. .. rst-class:: classref-method
  1123. :ref:`String<class_String>` **get_model_name** **(** **)** |const|
  1124. Returns the model name of the current device.
  1125. \ **Note:** This method is implemented on Android and iOS. Returns ``"GenericDevice"`` on unsupported platforms.
  1126. .. rst-class:: classref-item-separator
  1127. ----
  1128. .. _class_OS_method_get_name:
  1129. .. rst-class:: classref-method
  1130. :ref:`String<class_String>` **get_name** **(** **)** |const|
  1131. Returns the name of the host OS. Possible values are: ``"Android"``, ``"iOS"``, ``"HTML5"``, ``"OSX"``, ``"Server"``, ``"Windows"``, ``"UWP"``, ``"X11"``.
  1132. .. rst-class:: classref-item-separator
  1133. ----
  1134. .. _class_OS_method_get_native_handle:
  1135. .. rst-class:: classref-method
  1136. :ref:`int<class_int>` **get_native_handle** **(** :ref:`HandleType<enum_OS_HandleType>` handle_type **)**
  1137. Returns internal structure pointers for use in GDNative plugins.
  1138. \ **Note:** This method is implemented on Linux and Windows (other OSs will soon be supported).
  1139. .. rst-class:: classref-item-separator
  1140. ----
  1141. .. _class_OS_method_get_power_percent_left:
  1142. .. rst-class:: classref-method
  1143. :ref:`int<class_int>` **get_power_percent_left** **(** **)**
  1144. Returns the amount of battery left in the device as a percentage. Returns ``-1`` if power state is unknown.
  1145. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1146. .. rst-class:: classref-item-separator
  1147. ----
  1148. .. _class_OS_method_get_power_seconds_left:
  1149. .. rst-class:: classref-method
  1150. :ref:`int<class_int>` **get_power_seconds_left** **(** **)**
  1151. Returns an estimate of the time left in seconds before the device runs out of battery. Returns ``-1`` if power state is unknown.
  1152. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1153. .. rst-class:: classref-item-separator
  1154. ----
  1155. .. _class_OS_method_get_power_state:
  1156. .. rst-class:: classref-method
  1157. :ref:`PowerState<enum_OS_PowerState>` **get_power_state** **(** **)**
  1158. Returns the current state of the device regarding battery and power. See :ref:`PowerState<enum_OS_PowerState>` constants.
  1159. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1160. .. rst-class:: classref-item-separator
  1161. ----
  1162. .. _class_OS_method_get_process_id:
  1163. .. rst-class:: classref-method
  1164. :ref:`int<class_int>` **get_process_id** **(** **)** |const|
  1165. Returns the project's process ID.
  1166. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1167. .. rst-class:: classref-item-separator
  1168. ----
  1169. .. _class_OS_method_get_processor_count:
  1170. .. rst-class:: classref-method
  1171. :ref:`int<class_int>` **get_processor_count** **(** **)** |const|
  1172. Returns the number of *logical* CPU cores available on the host machine. On CPUs with HyperThreading enabled, this number will be greater than the number of *physical* CPU cores.
  1173. .. rst-class:: classref-item-separator
  1174. ----
  1175. .. _class_OS_method_get_processor_name:
  1176. .. rst-class:: classref-method
  1177. :ref:`String<class_String>` **get_processor_name** **(** **)** |const|
  1178. Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz").
  1179. \ **Note:** This method is only implemented on Windows, macOS, Linux and iOS. On Android, HTML5 and UWP, :ref:`get_processor_name<class_OS_method_get_processor_name>` returns an empty string.
  1180. .. rst-class:: classref-item-separator
  1181. ----
  1182. .. _class_OS_method_get_real_window_size:
  1183. .. rst-class:: classref-method
  1184. :ref:`Vector2<class_Vector2>` **get_real_window_size** **(** **)** |const|
  1185. Returns the window size including decorations like window borders.
  1186. .. rst-class:: classref-item-separator
  1187. ----
  1188. .. _class_OS_method_get_restart_on_exit_arguments:
  1189. .. rst-class:: classref-method
  1190. :ref:`PoolStringArray<class_PoolStringArray>` **get_restart_on_exit_arguments** **(** **)** |const|
  1191. Returns the list of command line arguments that will be used when the project automatically restarts using :ref:`set_restart_on_exit<class_OS_method_set_restart_on_exit>`. See also :ref:`is_restart_on_exit_set<class_OS_method_is_restart_on_exit_set>`.
  1192. .. rst-class:: classref-item-separator
  1193. ----
  1194. .. _class_OS_method_get_scancode_string:
  1195. .. rst-class:: classref-method
  1196. :ref:`String<class_String>` **get_scancode_string** **(** :ref:`int<class_int>` code **)** |const|
  1197. Returns the given scancode as a string (e.g. Return values: ``"Escape"``, ``"Shift+Escape"``).
  1198. See also :ref:`InputEventKey.scancode<class_InputEventKey_property_scancode>` and :ref:`InputEventKey.get_scancode_with_modifiers<class_InputEventKey_method_get_scancode_with_modifiers>`.
  1199. .. rst-class:: classref-item-separator
  1200. ----
  1201. .. _class_OS_method_get_screen_count:
  1202. .. rst-class:: classref-method
  1203. :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
  1204. Returns the number of displays attached to the host machine.
  1205. .. rst-class:: classref-item-separator
  1206. ----
  1207. .. _class_OS_method_get_screen_dpi:
  1208. .. rst-class:: classref-method
  1209. :ref:`int<class_int>` **get_screen_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1210. Returns the dots per inch density of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1211. \ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
  1212. \ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
  1213. ::
  1214. ldpi - 120 dpi
  1215. mdpi - 160 dpi
  1216. hdpi - 240 dpi
  1217. xhdpi - 320 dpi
  1218. xxhdpi - 480 dpi
  1219. xxxhdpi - 640 dpi
  1220. \ **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
  1221. .. rst-class:: classref-item-separator
  1222. ----
  1223. .. _class_OS_method_get_screen_max_scale:
  1224. .. rst-class:: classref-method
  1225. :ref:`float<class_float>` **get_screen_max_scale** **(** **)** |const|
  1226. Return the greatest scale factor of all screens.
  1227. \ **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.
  1228. \ **Note:** This method is implemented on macOS.
  1229. .. rst-class:: classref-item-separator
  1230. ----
  1231. .. _class_OS_method_get_screen_position:
  1232. .. rst-class:: classref-method
  1233. :ref:`Vector2<class_Vector2>` **get_screen_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1234. Returns the position of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1235. .. rst-class:: classref-item-separator
  1236. ----
  1237. .. _class_OS_method_get_screen_refresh_rate:
  1238. .. rst-class:: classref-method
  1239. :ref:`float<class_float>` **get_screen_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1240. Returns the current refresh rate of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1241. \ **Note:** Returns ``-1.0`` if Godot fails to find the refresh rate for the specified screen. On HTML5, :ref:`get_screen_refresh_rate<class_OS_method_get_screen_refresh_rate>` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform.
  1242. To fallback to a default refresh rate if the method fails, try:
  1243. ::
  1244. var refresh_rate = OS.get_screen_refresh_rate()
  1245. if refresh_rate < 0:
  1246. refresh_rate = 60.0
  1247. .. rst-class:: classref-item-separator
  1248. ----
  1249. .. _class_OS_method_get_screen_scale:
  1250. .. rst-class:: classref-method
  1251. :ref:`float<class_float>` **get_screen_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1252. Return the scale factor of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1253. \ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
  1254. \ **Note:** This method is implemented on macOS.
  1255. .. rst-class:: classref-item-separator
  1256. ----
  1257. .. _class_OS_method_get_screen_size:
  1258. .. rst-class:: classref-method
  1259. :ref:`Vector2<class_Vector2>` **get_screen_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
  1260. Returns the dimensions in pixels of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used.
  1261. .. rst-class:: classref-item-separator
  1262. ----
  1263. .. _class_OS_method_get_splash_tick_msec:
  1264. .. rst-class:: classref-method
  1265. :ref:`int<class_int>` **get_splash_tick_msec** **(** **)** |const|
  1266. Returns the amount of time in milliseconds it took for the boot logo to appear.
  1267. .. rst-class:: classref-item-separator
  1268. ----
  1269. .. _class_OS_method_get_static_memory_peak_usage:
  1270. .. rst-class:: classref-method
  1271. :ref:`int<class_int>` **get_static_memory_peak_usage** **(** **)** |const|
  1272. Returns the maximum amount of static memory used (only works in debug).
  1273. .. rst-class:: classref-item-separator
  1274. ----
  1275. .. _class_OS_method_get_static_memory_usage:
  1276. .. rst-class:: classref-method
  1277. :ref:`int<class_int>` **get_static_memory_usage** **(** **)** |const|
  1278. Returns the amount of static memory being used by the program in bytes (only works in debug).
  1279. .. rst-class:: classref-item-separator
  1280. ----
  1281. .. _class_OS_method_get_system_dir:
  1282. .. rst-class:: classref-method
  1283. :ref:`String<class_String>` **get_system_dir** **(** :ref:`SystemDir<enum_OS_SystemDir>` dir, :ref:`bool<class_bool>` shared_storage=true **)** |const|
  1284. Returns the actual path to commonly used folders across different platforms. Available locations are specified in :ref:`SystemDir<enum_OS_SystemDir>`.
  1285. \ **Note:** This method is implemented on Android, Linux, macOS and Windows.
  1286. \ **Note:** Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android.
  1287. .. rst-class:: classref-item-separator
  1288. ----
  1289. .. _class_OS_method_get_system_time_msecs:
  1290. .. rst-class:: classref-method
  1291. :ref:`int<class_int>` **get_system_time_msecs** **(** **)** |const|
  1292. Returns the epoch time of the operating system in milliseconds.
  1293. .. rst-class:: classref-item-separator
  1294. ----
  1295. .. _class_OS_method_get_system_time_secs:
  1296. .. rst-class:: classref-method
  1297. :ref:`int<class_int>` **get_system_time_secs** **(** **)** |const|
  1298. Returns the epoch time of the operating system in seconds.
  1299. .. rst-class:: classref-item-separator
  1300. ----
  1301. .. _class_OS_method_get_tablet_driver_count:
  1302. .. rst-class:: classref-method
  1303. :ref:`int<class_int>` **get_tablet_driver_count** **(** **)** |const|
  1304. Returns the total number of available tablet drivers.
  1305. \ **Note:** This method is implemented on Windows.
  1306. .. rst-class:: classref-item-separator
  1307. ----
  1308. .. _class_OS_method_get_tablet_driver_name:
  1309. .. rst-class:: classref-method
  1310. :ref:`String<class_String>` **get_tablet_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
  1311. Returns the tablet driver name for the given index.
  1312. \ **Note:** This method is implemented on Windows.
  1313. .. rst-class:: classref-item-separator
  1314. ----
  1315. .. _class_OS_method_get_thread_caller_id:
  1316. .. rst-class:: classref-method
  1317. :ref:`int<class_int>` **get_thread_caller_id** **(** **)** |const|
  1318. Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications.
  1319. \ **Note:** Thread IDs are not deterministic and may be reused across application restarts.
  1320. .. rst-class:: classref-item-separator
  1321. ----
  1322. .. _class_OS_method_get_ticks_msec:
  1323. .. rst-class:: classref-method
  1324. :ref:`int<class_int>` **get_ticks_msec** **(** **)** |const|
  1325. Deprecated, use :ref:`Time.get_ticks_msec<class_Time_method_get_ticks_msec>` instead.
  1326. Returns the amount of time passed in milliseconds since the engine started.
  1327. .. rst-class:: classref-item-separator
  1328. ----
  1329. .. _class_OS_method_get_ticks_usec:
  1330. .. rst-class:: classref-method
  1331. :ref:`int<class_int>` **get_ticks_usec** **(** **)** |const|
  1332. Deprecated, use :ref:`Time.get_ticks_usec<class_Time_method_get_ticks_usec>` instead.
  1333. Returns the amount of time passed in microseconds since the engine started.
  1334. .. rst-class:: classref-item-separator
  1335. ----
  1336. .. _class_OS_method_get_time:
  1337. .. rst-class:: classref-method
  1338. :ref:`Dictionary<class_Dictionary>` **get_time** **(** :ref:`bool<class_bool>` utc=false **)** |const|
  1339. Deprecated, use :ref:`Time.get_time_dict_from_system<class_Time_method_get_time_dict_from_system>` instead.
  1340. Returns current time as a dictionary of keys: hour, minute, second.
  1341. .. rst-class:: classref-item-separator
  1342. ----
  1343. .. _class_OS_method_get_time_zone_info:
  1344. .. rst-class:: classref-method
  1345. :ref:`Dictionary<class_Dictionary>` **get_time_zone_info** **(** **)** |const|
  1346. Returns the current time zone as a dictionary with the keys: bias and name.
  1347. .. rst-class:: classref-item-separator
  1348. ----
  1349. .. _class_OS_method_get_unique_id:
  1350. .. rst-class:: classref-method
  1351. :ref:`String<class_String>` **get_unique_id** **(** **)** |const|
  1352. Returns a string that is unique to the device.
  1353. \ **Note:** This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by :ref:`get_unique_id<class_OS_method_get_unique_id>` for security purposes.
  1354. \ **Note:** Returns an empty string and prints an error on HTML5, as this method cannot be implemented on this platform.
  1355. .. rst-class:: classref-item-separator
  1356. ----
  1357. .. _class_OS_method_get_unix_time:
  1358. .. rst-class:: classref-method
  1359. :ref:`int<class_int>` **get_unix_time** **(** **)** |const|
  1360. Returns the current UNIX epoch timestamp in seconds.
  1361. \ **Important:** This is the system clock that the user can manually set. **Never use** this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. **Always use** :ref:`get_ticks_usec<class_OS_method_get_ticks_usec>` or :ref:`get_ticks_msec<class_OS_method_get_ticks_msec>` for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease).
  1362. \ **Note:** To get a floating point timestamp with sub-second precision, use :ref:`Time.get_unix_time_from_system<class_Time_method_get_unix_time_from_system>`.
  1363. .. rst-class:: classref-item-separator
  1364. ----
  1365. .. _class_OS_method_get_unix_time_from_datetime:
  1366. .. rst-class:: classref-method
  1367. :ref:`int<class_int>` **get_unix_time_from_datetime** **(** :ref:`Dictionary<class_Dictionary>` datetime **)** |const|
  1368. Gets an epoch time value from a dictionary of time values.
  1369. \ ``datetime`` must be populated with the following keys: ``year``, ``month``, ``day``, ``hour``, ``minute``, ``second``.
  1370. If the dictionary is empty ``0`` is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC).
  1371. You can pass the output from :ref:`get_datetime_from_unix_time<class_OS_method_get_datetime_from_unix_time>` directly into this function. Daylight Savings Time (``dst``), if present, is ignored.
  1372. .. rst-class:: classref-item-separator
  1373. ----
  1374. .. _class_OS_method_get_user_data_dir:
  1375. .. rst-class:: classref-method
  1376. :ref:`String<class_String>` **get_user_data_dir** **(** **)** |const|
  1377. Returns the absolute directory path where user data is written (``user://``).
  1378. On Linux, this is ``~/.local/share/godot/app_userdata/[project_name]``, or ``~/.local/share/[custom_name]`` if ``use_custom_user_dir`` is set.
  1379. On macOS, this is ``~/Library/Application Support/Godot/app_userdata/[project_name]``, or ``~/Library/Application Support/[custom_name]`` if ``use_custom_user_dir`` is set.
  1380. On Windows, this is ``%APPDATA%\Godot\app_userdata\[project_name]``, or ``%APPDATA%\[custom_name]`` if ``use_custom_user_dir`` is set. ``%APPDATA%`` expands to ``%USERPROFILE%\AppData\Roaming``.
  1381. If the project name is empty, ``user://`` falls back to ``res://``.
  1382. Not to be confused with :ref:`get_data_dir<class_OS_method_get_data_dir>`, which returns the *global* (non-project-specific) user data directory.
  1383. .. rst-class:: classref-item-separator
  1384. ----
  1385. .. _class_OS_method_get_video_driver_count:
  1386. .. rst-class:: classref-method
  1387. :ref:`int<class_int>` **get_video_driver_count** **(** **)** |const|
  1388. Returns the number of video drivers supported on the current platform.
  1389. .. rst-class:: classref-item-separator
  1390. ----
  1391. .. _class_OS_method_get_video_driver_name:
  1392. .. rst-class:: classref-method
  1393. :ref:`String<class_String>` **get_video_driver_name** **(** :ref:`VideoDriver<enum_OS_VideoDriver>` driver **)** |const|
  1394. Returns the name of the video driver matching the given ``driver`` index. This index is a value from :ref:`VideoDriver<enum_OS_VideoDriver>`, and you can use :ref:`get_current_video_driver<class_OS_method_get_current_video_driver>` to get the current backend's index.
  1395. .. rst-class:: classref-item-separator
  1396. ----
  1397. .. _class_OS_method_get_virtual_keyboard_height:
  1398. .. rst-class:: classref-method
  1399. :ref:`int<class_int>` **get_virtual_keyboard_height** **(** **)**
  1400. Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
  1401. .. rst-class:: classref-item-separator
  1402. ----
  1403. .. _class_OS_method_get_window_safe_area:
  1404. .. rst-class:: classref-method
  1405. :ref:`Rect2<class_Rect2>` **get_window_safe_area** **(** **)** |const|
  1406. Returns unobscured area of the window where interactive controls should be rendered.
  1407. .. rst-class:: classref-item-separator
  1408. ----
  1409. .. _class_OS_method_global_menu_add_item:
  1410. .. rst-class:: classref-method
  1411. void **global_menu_add_item** **(** :ref:`String<class_String>` menu, :ref:`String<class_String>` label, :ref:`Variant<class_Variant>` id, :ref:`Variant<class_Variant>` meta **)**
  1412. Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
  1413. \ **Note:** This method is implemented on macOS.
  1414. .. rst-class:: classref-item-separator
  1415. ----
  1416. .. _class_OS_method_global_menu_add_separator:
  1417. .. rst-class:: classref-method
  1418. void **global_menu_add_separator** **(** :ref:`String<class_String>` menu **)**
  1419. Add a separator between items. Separators also occupy an index.
  1420. \ **Note:** This method is implemented on macOS.
  1421. .. rst-class:: classref-item-separator
  1422. ----
  1423. .. _class_OS_method_global_menu_clear:
  1424. .. rst-class:: classref-method
  1425. void **global_menu_clear** **(** :ref:`String<class_String>` menu **)**
  1426. Clear the global menu, in effect removing all items.
  1427. \ **Note:** This method is implemented on macOS.
  1428. .. rst-class:: classref-item-separator
  1429. ----
  1430. .. _class_OS_method_global_menu_remove_item:
  1431. .. rst-class:: classref-method
  1432. void **global_menu_remove_item** **(** :ref:`String<class_String>` menu, :ref:`int<class_int>` idx **)**
  1433. Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one.
  1434. \ **Note:** This method is implemented on macOS.
  1435. .. rst-class:: classref-item-separator
  1436. ----
  1437. .. _class_OS_method_has_clipboard:
  1438. .. rst-class:: classref-method
  1439. :ref:`bool<class_bool>` **has_clipboard** **(** **)** |const|
  1440. Returns ``true`` if there is content on the clipboard.
  1441. .. rst-class:: classref-item-separator
  1442. ----
  1443. .. _class_OS_method_has_environment:
  1444. .. rst-class:: classref-method
  1445. :ref:`bool<class_bool>` **has_environment** **(** :ref:`String<class_String>` variable **)** |const|
  1446. Returns ``true`` if the environment variable with the name ``variable`` exists.
  1447. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  1448. .. rst-class:: classref-item-separator
  1449. ----
  1450. .. _class_OS_method_has_feature:
  1451. .. rst-class:: classref-method
  1452. :ref:`bool<class_bool>` **has_feature** **(** :ref:`String<class_String>` tag_name **)** |const|
  1453. Returns ``true`` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the :doc:`Feature Tags <../tutorials/export/feature_tags>` documentation for more details.
  1454. \ **Note:** Tag names are case-sensitive.
  1455. .. rst-class:: classref-item-separator
  1456. ----
  1457. .. _class_OS_method_has_touchscreen_ui_hint:
  1458. .. rst-class:: classref-method
  1459. :ref:`bool<class_bool>` **has_touchscreen_ui_hint** **(** **)** |const|
  1460. Returns ``true`` if the device has a touchscreen or emulates one.
  1461. .. rst-class:: classref-item-separator
  1462. ----
  1463. .. _class_OS_method_has_virtual_keyboard:
  1464. .. rst-class:: classref-method
  1465. :ref:`bool<class_bool>` **has_virtual_keyboard** **(** **)** |const|
  1466. Returns ``true`` if the platform has a virtual keyboard, ``false`` otherwise.
  1467. .. rst-class:: classref-item-separator
  1468. ----
  1469. .. _class_OS_method_hide_virtual_keyboard:
  1470. .. rst-class:: classref-method
  1471. void **hide_virtual_keyboard** **(** **)**
  1472. Hides the virtual keyboard if it is shown, does nothing otherwise.
  1473. .. rst-class:: classref-item-separator
  1474. ----
  1475. .. _class_OS_method_is_debug_build:
  1476. .. rst-class:: classref-method
  1477. :ref:`bool<class_bool>` **is_debug_build** **(** **)** |const|
  1478. Returns ``true`` if the Godot binary used to run the project is a *debug* export template, or when running in the editor.
  1479. Returns ``false`` if the Godot binary used to run the project is a *release* export template.
  1480. To check whether the Godot binary used to run the project is an export template (debug or release), use ``OS.has_feature("standalone")`` instead.
  1481. .. rst-class:: classref-item-separator
  1482. ----
  1483. .. _class_OS_method_is_ok_left_and_cancel_right:
  1484. .. rst-class:: classref-method
  1485. :ref:`bool<class_bool>` **is_ok_left_and_cancel_right** **(** **)** |const|
  1486. Returns ``true`` if the **OK** button should appear on the left and **Cancel** on the right.
  1487. .. rst-class:: classref-item-separator
  1488. ----
  1489. .. _class_OS_method_is_process_running:
  1490. .. rst-class:: classref-method
  1491. :ref:`bool<class_bool>` **is_process_running** **(** :ref:`int<class_int>` pid **)** |const|
  1492. Returns ``true`` if the child process ID (``pid``) is still running or ``false`` if it has terminated.
  1493. Must be a valid ID generated from :ref:`execute<class_OS_method_execute>`.
  1494. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1495. .. rst-class:: classref-item-separator
  1496. ----
  1497. .. _class_OS_method_is_restart_on_exit_set:
  1498. .. rst-class:: classref-method
  1499. :ref:`bool<class_bool>` **is_restart_on_exit_set** **(** **)** |const|
  1500. Returns ``true`` if the project will automatically restart when it exits for any reason, ``false`` otherwise. See also :ref:`set_restart_on_exit<class_OS_method_set_restart_on_exit>` and :ref:`get_restart_on_exit_arguments<class_OS_method_get_restart_on_exit_arguments>`.
  1501. .. rst-class:: classref-item-separator
  1502. ----
  1503. .. _class_OS_method_is_scancode_unicode:
  1504. .. rst-class:: classref-method
  1505. :ref:`bool<class_bool>` **is_scancode_unicode** **(** :ref:`int<class_int>` code **)** |const|
  1506. Returns ``true`` if the input scancode corresponds to a Unicode character.
  1507. .. rst-class:: classref-item-separator
  1508. ----
  1509. .. _class_OS_method_is_stdout_verbose:
  1510. .. rst-class:: classref-method
  1511. :ref:`bool<class_bool>` **is_stdout_verbose** **(** **)** |const|
  1512. Returns ``true`` if the engine was executed with ``-v`` (verbose stdout).
  1513. .. rst-class:: classref-item-separator
  1514. ----
  1515. .. _class_OS_method_is_userfs_persistent:
  1516. .. rst-class:: classref-method
  1517. :ref:`bool<class_bool>` **is_userfs_persistent** **(** **)** |const|
  1518. If ``true``, the ``user://`` file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable.
  1519. .. rst-class:: classref-item-separator
  1520. ----
  1521. .. _class_OS_method_is_window_always_on_top:
  1522. .. rst-class:: classref-method
  1523. :ref:`bool<class_bool>` **is_window_always_on_top** **(** **)** |const|
  1524. Returns ``true`` if the window should always be on top of other windows.
  1525. .. rst-class:: classref-item-separator
  1526. ----
  1527. .. _class_OS_method_is_window_focused:
  1528. .. rst-class:: classref-method
  1529. :ref:`bool<class_bool>` **is_window_focused** **(** **)** |const|
  1530. Returns ``true`` if the window is currently focused.
  1531. \ **Note:** Only implemented on desktop platforms. On other platforms, it will always return ``true``.
  1532. .. rst-class:: classref-item-separator
  1533. ----
  1534. .. _class_OS_method_keyboard_get_current_layout:
  1535. .. rst-class:: classref-method
  1536. :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
  1537. Returns active keyboard layout index.
  1538. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1539. .. rst-class:: classref-item-separator
  1540. ----
  1541. .. _class_OS_method_keyboard_get_layout_count:
  1542. .. rst-class:: classref-method
  1543. :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
  1544. Returns the number of keyboard layouts.
  1545. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1546. .. rst-class:: classref-item-separator
  1547. ----
  1548. .. _class_OS_method_keyboard_get_layout_language:
  1549. .. rst-class:: classref-method
  1550. :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
  1551. Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
  1552. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1553. .. rst-class:: classref-item-separator
  1554. ----
  1555. .. _class_OS_method_keyboard_get_layout_name:
  1556. .. rst-class:: classref-method
  1557. :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
  1558. Returns the localized name of the keyboard layout at position ``index``.
  1559. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1560. .. rst-class:: classref-item-separator
  1561. ----
  1562. .. _class_OS_method_keyboard_get_scancode_from_physical:
  1563. .. rst-class:: classref-method
  1564. :ref:`int<class_int>` **keyboard_get_scancode_from_physical** **(** :ref:`int<class_int>` scancode **)** |const|
  1565. Converts a physical (US QWERTY) ``scancode`` to one in the active keyboard layout.
  1566. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1567. .. rst-class:: classref-item-separator
  1568. ----
  1569. .. _class_OS_method_keyboard_set_current_layout:
  1570. .. rst-class:: classref-method
  1571. void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
  1572. Sets active keyboard layout.
  1573. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1574. .. rst-class:: classref-item-separator
  1575. ----
  1576. .. _class_OS_method_kill:
  1577. .. rst-class:: classref-method
  1578. :ref:`Error<enum_@GlobalScope_Error>` **kill** **(** :ref:`int<class_int>` pid **)**
  1579. Kill (terminate) the process identified by the given process ID (``pid``), e.g. the one returned by :ref:`execute<class_OS_method_execute>` in non-blocking mode. See also :ref:`crash<class_OS_method_crash>`.
  1580. \ **Note:** This method can also be used to kill processes that were not spawned by the game.
  1581. \ **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows.
  1582. .. rst-class:: classref-item-separator
  1583. ----
  1584. .. _class_OS_method_move_to_trash:
  1585. .. rst-class:: classref-method
  1586. :ref:`Error<enum_@GlobalScope_Error>` **move_to_trash** **(** :ref:`String<class_String>` path **)** |const|
  1587. Moves the file or directory to the system's recycle bin. See also :ref:`Directory.remove<class_Directory_method_remove>`.
  1588. The method takes only global paths, so you may need to use :ref:`ProjectSettings.globalize_path<class_ProjectSettings_method_globalize_path>`. Do not use it for files in ``res://`` as it will not work in exported project.
  1589. \ **Note:** If the user has disabled the recycle bin on their system, the file will be permanently deleted instead.
  1590. ::
  1591. var file_to_remove = "user://slot1.sav"
  1592. OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove))
  1593. .. rst-class:: classref-item-separator
  1594. ----
  1595. .. _class_OS_method_move_window_to_foreground:
  1596. .. rst-class:: classref-method
  1597. void **move_window_to_foreground** **(** **)**
  1598. Moves the window to the front.
  1599. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1600. .. rst-class:: classref-item-separator
  1601. ----
  1602. .. _class_OS_method_native_video_is_playing:
  1603. .. rst-class:: classref-method
  1604. :ref:`bool<class_bool>` **native_video_is_playing** **(** **)**
  1605. Returns ``true`` if native video is playing.
  1606. \ **Note:** This method is only implemented on iOS.
  1607. .. rst-class:: classref-item-separator
  1608. ----
  1609. .. _class_OS_method_native_video_pause:
  1610. .. rst-class:: classref-method
  1611. void **native_video_pause** **(** **)**
  1612. Pauses native video playback.
  1613. \ **Note:** This method is only implemented on iOS.
  1614. .. rst-class:: classref-item-separator
  1615. ----
  1616. .. _class_OS_method_native_video_play:
  1617. .. rst-class:: classref-method
  1618. :ref:`Error<enum_@GlobalScope_Error>` **native_video_play** **(** :ref:`String<class_String>` path, :ref:`float<class_float>` volume, :ref:`String<class_String>` audio_track, :ref:`String<class_String>` subtitle_track **)**
  1619. Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
  1620. \ **Note:** This method is only implemented on iOS.
  1621. .. rst-class:: classref-item-separator
  1622. ----
  1623. .. _class_OS_method_native_video_stop:
  1624. .. rst-class:: classref-method
  1625. void **native_video_stop** **(** **)**
  1626. Stops native video playback.
  1627. \ **Note:** This method is implemented on iOS.
  1628. .. rst-class:: classref-item-separator
  1629. ----
  1630. .. _class_OS_method_native_video_unpause:
  1631. .. rst-class:: classref-method
  1632. void **native_video_unpause** **(** **)**
  1633. Resumes native video playback.
  1634. \ **Note:** This method is implemented on iOS.
  1635. .. rst-class:: classref-item-separator
  1636. ----
  1637. .. _class_OS_method_open_midi_inputs:
  1638. .. rst-class:: classref-method
  1639. void **open_midi_inputs** **(** **)**
  1640. Initialises the singleton for the system MIDI driver.
  1641. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1642. .. rst-class:: classref-item-separator
  1643. ----
  1644. .. _class_OS_method_print_all_resources:
  1645. .. rst-class:: classref-method
  1646. void **print_all_resources** **(** :ref:`String<class_String>` tofile="" **)**
  1647. Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in ``tofile``.
  1648. .. rst-class:: classref-item-separator
  1649. ----
  1650. .. _class_OS_method_print_all_textures_by_size:
  1651. .. rst-class:: classref-method
  1652. void **print_all_textures_by_size** **(** **)**
  1653. Shows the list of loaded textures sorted by size in memory.
  1654. .. rst-class:: classref-item-separator
  1655. ----
  1656. .. _class_OS_method_print_resources_by_type:
  1657. .. rst-class:: classref-method
  1658. void **print_resources_by_type** **(** :ref:`PoolStringArray<class_PoolStringArray>` types **)**
  1659. Shows the number of resources loaded by the game of the given types.
  1660. .. rst-class:: classref-item-separator
  1661. ----
  1662. .. _class_OS_method_print_resources_in_use:
  1663. .. rst-class:: classref-method
  1664. void **print_resources_in_use** **(** :ref:`bool<class_bool>` short=false **)**
  1665. Shows all resources currently used by the game.
  1666. .. rst-class:: classref-item-separator
  1667. ----
  1668. .. _class_OS_method_read_string_from_stdin:
  1669. .. rst-class:: classref-method
  1670. :ref:`String<class_String>` **read_string_from_stdin** **(** **)**
  1671. Reads a user input string from the standard input (usually the terminal). This operation is *blocking*, which causes the window to freeze if :ref:`read_string_from_stdin<class_OS_method_read_string_from_stdin>` is called on the main thread. The thread calling :ref:`read_string_from_stdin<class_OS_method_read_string_from_stdin>` will block until the program receives a line break in standard input (usually by the user pressing :kbd:`Enter`).
  1672. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1673. .. rst-class:: classref-item-separator
  1674. ----
  1675. .. _class_OS_method_request_attention:
  1676. .. rst-class:: classref-method
  1677. void **request_attention** **(** **)**
  1678. Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
  1679. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1680. .. rst-class:: classref-item-separator
  1681. ----
  1682. .. _class_OS_method_request_permission:
  1683. .. rst-class:: classref-method
  1684. :ref:`bool<class_bool>` **request_permission** **(** :ref:`String<class_String>` name **)**
  1685. At the moment this function is only used by ``AudioDriverOpenSL`` to request permission for ``RECORD_AUDIO`` on Android.
  1686. .. rst-class:: classref-item-separator
  1687. ----
  1688. .. _class_OS_method_request_permissions:
  1689. .. rst-class:: classref-method
  1690. :ref:`bool<class_bool>` **request_permissions** **(** **)**
  1691. With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications.
  1692. \ **Note:** This method is implemented on Android.
  1693. .. rst-class:: classref-item-separator
  1694. ----
  1695. .. _class_OS_method_set_environment:
  1696. .. rst-class:: classref-method
  1697. :ref:`bool<class_bool>` **set_environment** **(** :ref:`String<class_String>` variable, :ref:`String<class_String>` value **)** |const|
  1698. Sets the value of the environment variable ``variable`` to ``value``. The environment variable will be set for the Godot process and any process executed with :ref:`execute<class_OS_method_execute>` after running :ref:`set_environment<class_OS_method_set_environment>`. The environment variable will *not* persist to processes run after the Godot process was terminated.
  1699. \ **Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows.
  1700. .. rst-class:: classref-item-separator
  1701. ----
  1702. .. _class_OS_method_set_icon:
  1703. .. rst-class:: classref-method
  1704. void **set_icon** **(** :ref:`Image<class_Image>` icon **)**
  1705. Sets the game's icon using an :ref:`Image<class_Image>` resource.
  1706. The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed.
  1707. \ **Note:** This method is implemented on HTML5, Linux, macOS and Windows.
  1708. .. rst-class:: classref-item-separator
  1709. ----
  1710. .. _class_OS_method_set_ime_active:
  1711. .. rst-class:: classref-method
  1712. void **set_ime_active** **(** :ref:`bool<class_bool>` active **)**
  1713. Sets whether IME input mode should be enabled.
  1714. If active IME handles key events before the application and creates an composition string and suggestion list.
  1715. Application can retrieve the composition status by using :ref:`get_ime_selection<class_OS_method_get_ime_selection>` and :ref:`get_ime_text<class_OS_method_get_ime_text>` functions.
  1716. Completed composition string is committed when input is finished.
  1717. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1718. .. rst-class:: classref-item-separator
  1719. ----
  1720. .. _class_OS_method_set_ime_position:
  1721. .. rst-class:: classref-method
  1722. void **set_ime_position** **(** :ref:`Vector2<class_Vector2>` position **)**
  1723. Sets position of IME suggestion list popup (in window coordinates).
  1724. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1725. .. rst-class:: classref-item-separator
  1726. ----
  1727. .. _class_OS_method_set_native_icon:
  1728. .. rst-class:: classref-method
  1729. void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
  1730. Sets the game's icon using a multi-size platform-specific icon file (``*.ico`` on Windows and ``*.icns`` on macOS).
  1731. Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog.
  1732. \ **Note:** This method is implemented on macOS and Windows.
  1733. .. rst-class:: classref-item-separator
  1734. ----
  1735. .. _class_OS_method_set_restart_on_exit:
  1736. .. rst-class:: classref-method
  1737. void **set_restart_on_exit** **(** :ref:`bool<class_bool>` restart, :ref:`PoolStringArray<class_PoolStringArray>` arguments=PoolStringArray( ) **)**
  1738. If ``restart`` is ``true``, restarts the project automatically when it is exited with :ref:`SceneTree.quit<class_SceneTree_method_quit>` or :ref:`Node.NOTIFICATION_WM_QUIT_REQUEST<class_Node_constant_NOTIFICATION_WM_QUIT_REQUEST>`. Command line ``arguments`` can be supplied. To restart the project with the same command line arguments as originally used to run the project, pass :ref:`get_cmdline_args<class_OS_method_get_cmdline_args>` as the value for ``arguments``.
  1739. \ :ref:`set_restart_on_exit<class_OS_method_set_restart_on_exit>` can be used to apply setting changes that require a restart. See also :ref:`is_restart_on_exit_set<class_OS_method_is_restart_on_exit_set>` and :ref:`get_restart_on_exit_arguments<class_OS_method_get_restart_on_exit_arguments>`.
  1740. \ **Note:** This method is only effective on desktop platforms, and only when the project isn't started from the editor. It will have no effect on mobile and Web platforms, or when the project is started from the editor.
  1741. \ **Note:** If the project process crashes or is *killed* by the user (by sending ``SIGKILL`` instead of the usual ``SIGTERM``), the project won't restart automatically.
  1742. .. rst-class:: classref-item-separator
  1743. ----
  1744. .. _class_OS_method_set_thread_name:
  1745. .. rst-class:: classref-method
  1746. :ref:`Error<enum_@GlobalScope_Error>` **set_thread_name** **(** :ref:`String<class_String>` name **)**
  1747. Sets the name of the current thread.
  1748. .. rst-class:: classref-item-separator
  1749. ----
  1750. .. _class_OS_method_set_use_file_access_save_and_swap:
  1751. .. rst-class:: classref-method
  1752. void **set_use_file_access_save_and_swap** **(** :ref:`bool<class_bool>` enabled **)**
  1753. Enables backup saves if ``enabled`` is ``true``.
  1754. .. rst-class:: classref-item-separator
  1755. ----
  1756. .. _class_OS_method_set_window_always_on_top:
  1757. .. rst-class:: classref-method
  1758. void **set_window_always_on_top** **(** :ref:`bool<class_bool>` enabled **)**
  1759. Sets whether the window should always be on top.
  1760. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1761. .. rst-class:: classref-item-separator
  1762. ----
  1763. .. _class_OS_method_set_window_mouse_passthrough:
  1764. .. rst-class:: classref-method
  1765. void **set_window_mouse_passthrough** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` region **)**
  1766. Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
  1767. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
  1768. ::
  1769. # Set region, using Path2D node.
  1770. OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points())
  1771. # Set region, using Polygon2D node.
  1772. OS.set_window_mouse_passthrough($Polygon2D.polygon)
  1773. # Reset region to default.
  1774. OS.set_window_mouse_passthrough([])
  1775. \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
  1776. \ **Note:** This method is implemented on Linux, macOS and Windows.
  1777. .. rst-class:: classref-item-separator
  1778. ----
  1779. .. _class_OS_method_set_window_title:
  1780. .. rst-class:: classref-method
  1781. void **set_window_title** **(** :ref:`String<class_String>` title **)**
  1782. Sets the window title to the specified string.
  1783. \ **Note:** This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers.
  1784. \ **Note:** This method is implemented on HTML5, Linux, macOS and Windows.
  1785. .. rst-class:: classref-item-separator
  1786. ----
  1787. .. _class_OS_method_shell_open:
  1788. .. rst-class:: classref-method
  1789. :ref:`Error<enum_@GlobalScope_Error>` **shell_open** **(** :ref:`String<class_String>` uri **)**
  1790. Requests the OS to open a resource with the most appropriate program. For example:
  1791. - ``OS.shell_open("C:\\Users\name\Downloads")`` on Windows opens the file explorer at the user's Downloads folder.
  1792. - ``OS.shell_open("https://godotengine.org")`` opens the default web browser on the official Godot website.
  1793. - ``OS.shell_open("mailto:[email protected]")`` opens the default email client with the "To" field set to ``[email protected]``. See `RFC 2368 - The [code]mailto[/code] URL scheme <https://datatracker.ietf.org/doc/html/rfc2368>`__ for a list of fields that can be added.
  1794. Use :ref:`ProjectSettings.globalize_path<class_ProjectSettings_method_globalize_path>` to convert a ``res://`` or ``user://`` path into a system path for use with this method.
  1795. \ **Note:** Use :ref:`String.percent_encode<class_String_method_percent_encode>` to encode characters within URLs in a URL-safe, portable way. This is especially required for line breaks. Otherwise, :ref:`shell_open<class_OS_method_shell_open>` may not work correctly in a project exported to the Web platform.
  1796. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
  1797. .. rst-class:: classref-item-separator
  1798. ----
  1799. .. _class_OS_method_show_virtual_keyboard:
  1800. .. rst-class:: classref-method
  1801. void **show_virtual_keyboard** **(** :ref:`String<class_String>` existing_text="", :ref:`bool<class_bool>` multiline=false **)**
  1802. Shows the virtual keyboard if the platform has one.
  1803. The ``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).
  1804. The ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
  1805. \ **Note:** This method is equivalent to calling :ref:`show_virtual_keyboard_type<class_OS_method_show_virtual_keyboard_type>` with either default or multiline keyboard type. It is kept for compatibility with previous Godot releases and should be considered *deprecated* and replaced by :ref:`show_virtual_keyboard_type<class_OS_method_show_virtual_keyboard_type>`.
  1806. \ **Note:** This method is implemented on Android, iOS, UWP, and HTML5.
  1807. .. rst-class:: classref-item-separator
  1808. ----
  1809. .. _class_OS_method_show_virtual_keyboard_type:
  1810. .. rst-class:: classref-method
  1811. void **show_virtual_keyboard_type** **(** :ref:`String<class_String>` existing_text="", :ref:`VirtualKeyboardType<enum_OS_VirtualKeyboardType>` type=0 **)**
  1812. Shows the virtual keyboard if the platform has one.
  1813. The ``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).
  1814. The ``type`` parameter allows selecting which virtual keyboard to show.
  1815. \ **Note:** This method is implemented on Android, iOS, UWP, and HTML5.
  1816. .. rst-class:: classref-item-separator
  1817. ----
  1818. .. _class_OS_method_tts_get_voices:
  1819. .. rst-class:: classref-method
  1820. :ref:`Array<class_Array>` **tts_get_voices** **(** **)** |const|
  1821. Returns an :ref:`Array<class_Array>` of voice information dictionaries.
  1822. Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
  1823. - ``name`` is voice name.
  1824. - ``id`` is voice identifier.
  1825. - ``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.
  1826. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1827. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1828. .. rst-class:: classref-item-separator
  1829. ----
  1830. .. _class_OS_method_tts_get_voices_for_language:
  1831. .. rst-class:: classref-method
  1832. :ref:`PoolStringArray<class_PoolStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
  1833. Returns an :ref:`PoolStringArray<class_PoolStringArray>` of voice identifiers for the ``language``.
  1834. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1835. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1836. .. rst-class:: classref-item-separator
  1837. ----
  1838. .. _class_OS_method_tts_is_paused:
  1839. .. rst-class:: classref-method
  1840. :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
  1841. Returns ``true`` if the synthesizer is in a paused state.
  1842. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1843. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1844. .. rst-class:: classref-item-separator
  1845. ----
  1846. .. _class_OS_method_tts_is_speaking:
  1847. .. rst-class:: classref-method
  1848. :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
  1849. Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
  1850. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1851. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1852. .. rst-class:: classref-item-separator
  1853. ----
  1854. .. _class_OS_method_tts_pause:
  1855. .. rst-class:: classref-method
  1856. void **tts_pause** **(** **)**
  1857. Puts the synthesizer into a paused state.
  1858. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1859. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1860. .. rst-class:: classref-item-separator
  1861. ----
  1862. .. _class_OS_method_tts_resume:
  1863. .. rst-class:: classref-method
  1864. void **tts_resume** **(** **)**
  1865. Resumes the synthesizer if it was paused.
  1866. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1867. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1868. .. rst-class:: classref-item-separator
  1869. ----
  1870. .. _class_OS_method_tts_set_utterance_callback:
  1871. .. rst-class:: classref-method
  1872. void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_OS_TTSUtteranceEvent>` event, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)**
  1873. Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
  1874. - ``TTS_UTTERANCE_STARTED``, ``TTS_UTTERANCE_ENDED``, and ``TTS_UTTERANCE_CANCELED`` callable's method should take one :ref:`int<class_int>` parameter, the utterance id.
  1875. - ``TTS_UTTERANCE_BOUNDARY`` callable's method should take two :ref:`int<class_int>` parameters, the index of the character and the utterance id.
  1876. \ **Note:** The granularity of the boundary callbacks is engine dependent.
  1877. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1878. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1879. .. rst-class:: classref-item-separator
  1880. ----
  1881. .. _class_OS_method_tts_speak:
  1882. .. rst-class:: classref-method
  1883. 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 **)**
  1884. Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
  1885. - ``voice`` identifier is one of the ``"id"`` values returned by :ref:`tts_get_voices<class_OS_method_tts_get_voices>` or one of the values returned by :ref:`tts_get_voices_for_language<class_OS_method_tts_get_voices_for_language>`.
  1886. - ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
  1887. - ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
  1888. - ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
  1889. - ``utterance_id`` is passed as a parameter to the callback functions.
  1890. \ **Note:** On Windows and Linux, 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_OS_method_tts_speak>`.
  1891. \ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
  1892. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1893. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1894. .. rst-class:: classref-item-separator
  1895. ----
  1896. .. _class_OS_method_tts_stop:
  1897. .. rst-class:: classref-method
  1898. void **tts_stop** **(** **)**
  1899. Stops synthesis in progress and removes all utterances from the queue.
  1900. \ **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows.
  1901. \ **Note:** :ref:`ProjectSettings.audio/general/text_to_speech<class_ProjectSettings_property_audio/general/text_to_speech>` should be ``true`` to use text-to-speech.
  1902. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1903. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1904. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1905. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`