OS.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="OS" inherits="Object" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Operating System functions.
  5. </brief_description>
  6. <description>
  7. Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as: mouse grabbing, mouse cursors, clipboard, video mode, date and time, timers, environment variables, execution of binaries, command line, etc.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="alert">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="text" type="String">
  18. </argument>
  19. <argument index="1" name="title" type="String" default="&quot;Alert!&quot;">
  20. </argument>
  21. <description>
  22. Displays a modal dialog box utilizing the host OS.
  23. </description>
  24. </method>
  25. <method name="can_draw" qualifiers="const">
  26. <return type="bool">
  27. </return>
  28. <description>
  29. Returns [code]true[/code] if the host OS allows drawing.
  30. </description>
  31. </method>
  32. <method name="can_use_threads" qualifiers="const">
  33. <return type="bool">
  34. </return>
  35. <description>
  36. Returns [code]true[/code] if the current host platform is using multiple threads.
  37. </description>
  38. </method>
  39. <method name="delay_msec" qualifiers="const">
  40. <return type="void">
  41. </return>
  42. <argument index="0" name="msec" type="int">
  43. </argument>
  44. <description>
  45. Delay executing of the current thread by given milliseconds.
  46. </description>
  47. </method>
  48. <method name="delay_usec" qualifiers="const">
  49. <return type="void">
  50. </return>
  51. <argument index="0" name="usec" type="int">
  52. </argument>
  53. <description>
  54. Delay executing of the current thread by given microseconds.
  55. </description>
  56. </method>
  57. <method name="dump_memory_to_file">
  58. <return type="void">
  59. </return>
  60. <argument index="0" name="file" type="String">
  61. </argument>
  62. <description>
  63. Dumps the memory allocation ringlist to a file (only works in debug).
  64. Entry format per line: "Address - Size - Description"
  65. </description>
  66. </method>
  67. <method name="dump_resources_to_file">
  68. <return type="void">
  69. </return>
  70. <argument index="0" name="file" type="String">
  71. </argument>
  72. <description>
  73. Dumps all used resources to file (only works in debug).
  74. Entry format per line: "Resource Type : Resource Location"
  75. At the end of the file is a statistic of all used Resource Types.
  76. </description>
  77. </method>
  78. <method name="execute">
  79. <return type="int">
  80. </return>
  81. <argument index="0" name="path" type="String">
  82. </argument>
  83. <argument index="1" name="arguments" type="PoolStringArray">
  84. </argument>
  85. <argument index="2" name="blocking" type="bool">
  86. </argument>
  87. <argument index="3" name="output" type="Array" default="[ ]">
  88. </argument>
  89. <description>
  90. Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
  91. </description>
  92. </method>
  93. <method name="find_scancode_from_string" qualifiers="const">
  94. <return type="int">
  95. </return>
  96. <argument index="0" name="string" type="String">
  97. </argument>
  98. <description>
  99. Returns the scancode of the given string (e.g. "Escape")
  100. </description>
  101. </method>
  102. <method name="get_borderless_window" qualifiers="const">
  103. <return type="bool">
  104. </return>
  105. <description>
  106. Returns true if the current window is borderless.
  107. </description>
  108. </method>
  109. <method name="get_clipboard" qualifiers="const">
  110. <return type="String">
  111. </return>
  112. <description>
  113. Get clipboard from the host OS.
  114. </description>
  115. </method>
  116. <method name="get_cmdline_args">
  117. <return type="PoolStringArray">
  118. </return>
  119. <description>
  120. Returns the command line arguments passed to the engine.
  121. </description>
  122. </method>
  123. <method name="get_current_screen" qualifiers="const">
  124. <return type="int">
  125. </return>
  126. <description>
  127. Returns the current screen index (0 padded).
  128. </description>
  129. </method>
  130. <method name="get_data_dir" qualifiers="const">
  131. <return type="String">
  132. </return>
  133. <description>
  134. Returns the absolute directory path of user data path([user://]).
  135. </description>
  136. </method>
  137. <method name="get_date" qualifiers="const">
  138. <return type="Dictionary">
  139. </return>
  140. <argument index="0" name="utc" type="bool" default="false">
  141. </argument>
  142. <description>
  143. Returns current date as a dictionary of keys: year, month, day, weekday, dst (daylight savings time).
  144. </description>
  145. </method>
  146. <method name="get_datetime" qualifiers="const">
  147. <return type="Dictionary">
  148. </return>
  149. <argument index="0" name="utc" type="bool" default="false">
  150. </argument>
  151. <description>
  152. Returns current datetime as a dictionary of keys: year, month, day, weekday, dst (daylight savings time), hour, minute, second.
  153. </description>
  154. </method>
  155. <method name="get_datetime_from_unix_time" qualifiers="const">
  156. <return type="Dictionary">
  157. </return>
  158. <argument index="0" name="unix_time_val" type="int">
  159. </argument>
  160. <description>
  161. Get a dictionary of time values when given epoch time.
  162. Dictionary Time values will be a union of values from [method get_time] and [method get_date] dictionaries (with the exception of dst = day light standard time, as it cannot be determined from epoch).
  163. </description>
  164. </method>
  165. <method name="get_dynamic_memory_usage" qualifiers="const">
  166. <return type="int">
  167. </return>
  168. <description>
  169. Returns the total amount of dynamic memory used (only works in debug).
  170. </description>
  171. </method>
  172. <method name="get_environment" qualifiers="const">
  173. <return type="String">
  174. </return>
  175. <argument index="0" name="environment" type="String">
  176. </argument>
  177. <description>
  178. Returns an environment variable.
  179. </description>
  180. </method>
  181. <method name="get_executable_path" qualifiers="const">
  182. <return type="String">
  183. </return>
  184. <description>
  185. Returns the path to the current engine executable.
  186. </description>
  187. </method>
  188. <method name="get_exit_code" qualifiers="const">
  189. <return type="int">
  190. </return>
  191. <description>
  192. </description>
  193. </method>
  194. <method name="get_latin_keyboard_variant" qualifiers="const">
  195. <return type="String">
  196. </return>
  197. <description>
  198. Returns the current latin keyboard variant as a String.
  199. Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO", "COLEMAK" or "ERROR".
  200. </description>
  201. </method>
  202. <method name="get_locale" qualifiers="const">
  203. <return type="String">
  204. </return>
  205. <description>
  206. Returns the host OS locale.
  207. </description>
  208. </method>
  209. <method name="get_model_name" qualifiers="const">
  210. <return type="String">
  211. </return>
  212. <description>
  213. Returns the model name of the current device.
  214. </description>
  215. </method>
  216. <method name="get_name" qualifiers="const">
  217. <return type="String">
  218. </return>
  219. <description>
  220. Returns the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
  221. </description>
  222. </method>
  223. <method name="get_power_percent_left">
  224. <return type="int">
  225. </return>
  226. <description>
  227. Returns the amount of battery left in the device as a percentage.
  228. </description>
  229. </method>
  230. <method name="get_power_seconds_left">
  231. <return type="int">
  232. </return>
  233. <description>
  234. Returns the time in seconds before the device runs out of battery.
  235. </description>
  236. </method>
  237. <method name="get_power_state">
  238. <return type="int" enum="OS.PowerState">
  239. </return>
  240. <description>
  241. Returns the current state of the device regarding battery and power. See [code]POWERSTATE_*[/code] constants.
  242. </description>
  243. </method>
  244. <method name="get_process_id" qualifiers="const">
  245. <return type="int">
  246. </return>
  247. <description>
  248. Returns the game process ID
  249. </description>
  250. </method>
  251. <method name="get_processor_count" qualifiers="const">
  252. <return type="int">
  253. </return>
  254. <description>
  255. Returns the number of cores available in the host machine.
  256. </description>
  257. </method>
  258. <method name="get_scancode_string" qualifiers="const">
  259. <return type="String">
  260. </return>
  261. <argument index="0" name="code" type="int">
  262. </argument>
  263. <description>
  264. Returns the given scancode as a string (e.g. Return values: "Escape", "Shift+Escape").
  265. </description>
  266. </method>
  267. <method name="get_screen_count" qualifiers="const">
  268. <return type="int">
  269. </return>
  270. <description>
  271. Returns the number of displays attached to the host machine.
  272. </description>
  273. </method>
  274. <method name="get_screen_dpi" qualifiers="const">
  275. <return type="int">
  276. </return>
  277. <argument index="0" name="screen" type="int" default="-1">
  278. </argument>
  279. <description>
  280. Returns the dots per inch density of the specified screen.
  281. On Android Devices, the actual screen densities are grouped into six generalized densities:
  282. ldpi - 120 dpi
  283. mdpi - 160 dpi
  284. hdpi - 240 dpi
  285. xhdpi - 320 dpi
  286. xxhdpi - 480 dpi
  287. xxxhdpi - 640 dpi
  288. </description>
  289. </method>
  290. <method name="get_screen_orientation" qualifiers="const">
  291. <return type="int" enum="OS.ScreenOrientation">
  292. </return>
  293. <description>
  294. Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class.
  295. </description>
  296. </method>
  297. <method name="get_screen_position" qualifiers="const">
  298. <return type="Vector2">
  299. </return>
  300. <argument index="0" name="screen" type="int" default="-1">
  301. </argument>
  302. <description>
  303. Returns the position of the specified screen by index. If no screen index is provided, the current screen will be used.
  304. </description>
  305. </method>
  306. <method name="get_screen_size" qualifiers="const">
  307. <return type="Vector2">
  308. </return>
  309. <argument index="0" name="screen" type="int" default="-1">
  310. </argument>
  311. <description>
  312. Returns the dimensions in pixels of the specified screen.
  313. </description>
  314. </method>
  315. <method name="get_splash_tick_msec" qualifiers="const">
  316. <return type="int">
  317. </return>
  318. <description>
  319. </description>
  320. </method>
  321. <method name="get_static_memory_peak_usage" qualifiers="const">
  322. <return type="int">
  323. </return>
  324. <description>
  325. Returns the max amount of static memory used (only works in debug).
  326. </description>
  327. </method>
  328. <method name="get_static_memory_usage" qualifiers="const">
  329. <return type="int">
  330. </return>
  331. <description>
  332. Returns the amount of static memory being used by the program in bytes.
  333. </description>
  334. </method>
  335. <method name="get_system_dir" qualifiers="const">
  336. <return type="String">
  337. </return>
  338. <argument index="0" name="dir" type="int" enum="OS.SystemDir">
  339. </argument>
  340. <description>
  341. Returns the actual path to commonly used folders across different platforms. Available locations are specified in [OS.SystemDir].
  342. </description>
  343. </method>
  344. <method name="get_system_time_secs" qualifiers="const">
  345. <return type="int">
  346. </return>
  347. <description>
  348. Returns the epoch time of the operating system in seconds.
  349. </description>
  350. </method>
  351. <method name="get_ticks_msec" qualifiers="const">
  352. <return type="int">
  353. </return>
  354. <description>
  355. Returns the amount of time passed in milliseconds since the engine started.
  356. </description>
  357. </method>
  358. <method name="get_time" qualifiers="const">
  359. <return type="Dictionary">
  360. </return>
  361. <argument index="0" name="utc" type="bool" default="false">
  362. </argument>
  363. <description>
  364. Returns current time as a dictionary of keys: hour, minute, second.
  365. </description>
  366. </method>
  367. <method name="get_time_zone_info" qualifiers="const">
  368. <return type="Dictionary">
  369. </return>
  370. <description>
  371. Returns the current time zone as a dictionary with the keys: bias and name.
  372. </description>
  373. </method>
  374. <method name="get_unique_id" qualifiers="const">
  375. <return type="String">
  376. </return>
  377. <description>
  378. Returns a string that is unique to the device. Currently only works on Android and iOS. Returns empty string on other platforms.
  379. </description>
  380. </method>
  381. <method name="get_unix_time" qualifiers="const">
  382. <return type="int">
  383. </return>
  384. <description>
  385. Return the current unix timestamp.
  386. </description>
  387. </method>
  388. <method name="get_unix_time_from_datetime" qualifiers="const">
  389. <return type="int">
  390. </return>
  391. <argument index="0" name="datetime" type="Dictionary">
  392. </argument>
  393. <description>
  394. Get an epoch time value from a dictionary of time values.
  395. [code]datetime[/code] must be populated with the following keys: year, month, day, hour, minute, second.
  396. You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight savings time (dst), if present, is ignored.
  397. </description>
  398. </method>
  399. <method name="get_virtual_keyboard_height">
  400. <return type="int">
  401. </return>
  402. <description>
  403. </description>
  404. </method>
  405. <method name="get_window_position" qualifiers="const">
  406. <return type="Vector2">
  407. </return>
  408. <description>
  409. Returns 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.
  410. </description>
  411. </method>
  412. <method name="get_window_size" qualifiers="const">
  413. <return type="Vector2">
  414. </return>
  415. <description>
  416. Returns the size of the window (without counting window manager decorations).
  417. </description>
  418. </method>
  419. <method name="has_environment" qualifiers="const">
  420. <return type="bool">
  421. </return>
  422. <argument index="0" name="environment" type="String">
  423. </argument>
  424. <description>
  425. Returns [code]true[/code] if an environment variable exists.
  426. </description>
  427. </method>
  428. <method name="has_feature" qualifiers="const">
  429. <return type="bool">
  430. </return>
  431. <argument index="0" name="tag_name" type="String">
  432. </argument>
  433. <description>
  434. </description>
  435. </method>
  436. <method name="has_touchscreen_ui_hint" qualifiers="const">
  437. <return type="bool">
  438. </return>
  439. <description>
  440. Returns [code]true[/code] if the device has a touchscreen or emulates one.
  441. </description>
  442. </method>
  443. <method name="has_virtual_keyboard" qualifiers="const">
  444. <return type="bool">
  445. </return>
  446. <description>
  447. Returns [code]true[/code] if the platform has a virtual keyboard, [code]false[/code] otherwise.
  448. </description>
  449. </method>
  450. <method name="hide_virtual_keyboard">
  451. <return type="void">
  452. </return>
  453. <description>
  454. Hides the virtual keyboard if it is shown, does nothing otherwise.
  455. </description>
  456. </method>
  457. <method name="is_debug_build" qualifiers="const">
  458. <return type="bool">
  459. </return>
  460. <description>
  461. Returns [code]true[/code] if the build is a debug build.
  462. Returns [code]true[/code] when running in the editor.
  463. Returns [code]false[/code] if the build is a release build.
  464. </description>
  465. </method>
  466. <method name="is_in_low_processor_usage_mode" qualifiers="const">
  467. <return type="bool">
  468. </return>
  469. <description>
  470. Returns [code]true[/code] if low cpu usage mode is enabled.
  471. </description>
  472. </method>
  473. <method name="is_keep_screen_on" qualifiers="const">
  474. <return type="bool">
  475. </return>
  476. <description>
  477. Returns [code]true[/code] if the screen is being kept on.
  478. </description>
  479. </method>
  480. <method name="is_ok_left_and_cancel_right" qualifiers="const">
  481. <return type="bool">
  482. </return>
  483. <description>
  484. Returns [code]true[/code] if the "Okay" button should appear on the left and "Cancel" on the right.
  485. </description>
  486. </method>
  487. <method name="is_scancode_unicode" qualifiers="const">
  488. <return type="bool">
  489. </return>
  490. <argument index="0" name="code" type="int">
  491. </argument>
  492. <description>
  493. Returns [code]true[/code] if the input code has a unicode character.
  494. </description>
  495. </method>
  496. <method name="is_stdout_verbose" qualifiers="const">
  497. <return type="bool">
  498. </return>
  499. <description>
  500. Returns [code]true[/code] if the engine was executed with -v (verbose stdout).
  501. </description>
  502. </method>
  503. <method name="is_userfs_persistent" qualifiers="const">
  504. <return type="bool">
  505. </return>
  506. <description>
  507. If [code]true[/code], the [code]user://[/code] 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.
  508. </description>
  509. </method>
  510. <method name="is_vsync_enabled" qualifiers="const">
  511. <return type="bool">
  512. </return>
  513. <description>
  514. Returns [code]true[/code] if synchronizing the framerate to the monitor's refresh rate is enabled.
  515. </description>
  516. </method>
  517. <method name="is_window_fullscreen" qualifiers="const">
  518. <return type="bool">
  519. </return>
  520. <description>
  521. Returns [code]true[/code] if the window is in fullscreen mode.
  522. </description>
  523. </method>
  524. <method name="is_window_maximized" qualifiers="const">
  525. <return type="bool">
  526. </return>
  527. <description>
  528. Returns [code]true[/code] if the window is maximized.
  529. </description>
  530. </method>
  531. <method name="is_window_minimized" qualifiers="const">
  532. <return type="bool">
  533. </return>
  534. <description>
  535. Returns [code]true[/code] if the window is minimized.
  536. </description>
  537. </method>
  538. <method name="is_window_resizable" qualifiers="const">
  539. <return type="bool">
  540. </return>
  541. <description>
  542. Returns [code]true[/code] if the window is resizable.
  543. </description>
  544. </method>
  545. <method name="kill">
  546. <return type="int" enum="Error">
  547. </return>
  548. <argument index="0" name="pid" type="int">
  549. </argument>
  550. <description>
  551. Kill a process ID (this method can be used to kill processes that were not spawned by the game).
  552. </description>
  553. </method>
  554. <method name="native_video_is_playing">
  555. <return type="bool">
  556. </return>
  557. <description>
  558. Returns [code]true[/code] if native video is playing.
  559. </description>
  560. </method>
  561. <method name="native_video_pause">
  562. <return type="void">
  563. </return>
  564. <description>
  565. Pauses native video playback.
  566. </description>
  567. </method>
  568. <method name="native_video_play">
  569. <return type="int" enum="Error">
  570. </return>
  571. <argument index="0" name="path" type="String">
  572. </argument>
  573. <argument index="1" name="volume" type="float">
  574. </argument>
  575. <argument index="2" name="audio_track" type="String">
  576. </argument>
  577. <argument index="3" name="subtitle_track" type="String">
  578. </argument>
  579. <description>
  580. Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
  581. </description>
  582. </method>
  583. <method name="native_video_stop">
  584. <return type="void">
  585. </return>
  586. <description>
  587. Stops native video playback.
  588. </description>
  589. </method>
  590. <method name="native_video_unpause">
  591. <return type="void">
  592. </return>
  593. <description>
  594. Resumes native video playback.
  595. </description>
  596. </method>
  597. <method name="print_all_resources">
  598. <return type="void">
  599. </return>
  600. <argument index="0" name="tofile" type="String" default="&quot;&quot;">
  601. </argument>
  602. <description>
  603. Shows all resources in the game. Optionally the list can be written to a file.
  604. </description>
  605. </method>
  606. <method name="print_all_textures_by_size">
  607. <return type="void">
  608. </return>
  609. <description>
  610. Shows the list of loaded textures sorted by size in memory.
  611. </description>
  612. </method>
  613. <method name="print_resources_by_type">
  614. <return type="void">
  615. </return>
  616. <argument index="0" name="types" type="PoolStringArray">
  617. </argument>
  618. <description>
  619. Shows the number of resources loaded by the game of the given types.
  620. </description>
  621. </method>
  622. <method name="print_resources_in_use">
  623. <return type="void">
  624. </return>
  625. <argument index="0" name="short" type="bool" default="false">
  626. </argument>
  627. <description>
  628. Shows all resources currently used by the game.
  629. </description>
  630. </method>
  631. <method name="request_attention">
  632. <return type="void">
  633. </return>
  634. <description>
  635. Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
  636. </description>
  637. </method>
  638. <method name="set_borderless_window">
  639. <return type="void">
  640. </return>
  641. <argument index="0" name="borderless" type="bool">
  642. </argument>
  643. <description>
  644. Removes the window frame.
  645. </description>
  646. </method>
  647. <method name="set_clipboard">
  648. <return type="void">
  649. </return>
  650. <argument index="0" name="clipboard" type="String">
  651. </argument>
  652. <description>
  653. Sets clipboard to the OS.
  654. </description>
  655. </method>
  656. <method name="set_current_screen">
  657. <return type="void">
  658. </return>
  659. <argument index="0" name="screen" type="int">
  660. </argument>
  661. <description>
  662. Sets the current screen by index.
  663. </description>
  664. </method>
  665. <method name="set_exit_code">
  666. <return type="void">
  667. </return>
  668. <argument index="0" name="code" type="int">
  669. </argument>
  670. <description>
  671. Sets the exit code that will be returned by the game.
  672. </description>
  673. </method>
  674. <method name="set_icon">
  675. <return type="void">
  676. </return>
  677. <argument index="0" name="icon" type="Image">
  678. </argument>
  679. <description>
  680. Sets the game's icon.
  681. </description>
  682. </method>
  683. <method name="set_ime_position">
  684. <return type="void">
  685. </return>
  686. <argument index="0" name="position" type="Vector2">
  687. </argument>
  688. <description>
  689. </description>
  690. </method>
  691. <method name="set_keep_screen_on">
  692. <return type="void">
  693. </return>
  694. <argument index="0" name="enabled" type="bool">
  695. </argument>
  696. <description>
  697. Sets keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS)
  698. </description>
  699. </method>
  700. <method name="set_low_processor_usage_mode">
  701. <return type="void">
  702. </return>
  703. <argument index="0" name="enable" type="bool">
  704. </argument>
  705. <description>
  706. Set to [code]true[/code] to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. Use this in tool mode to reduce CPU usage.
  707. </description>
  708. </method>
  709. <method name="set_screen_orientation">
  710. <return type="void">
  711. </return>
  712. <argument index="0" name="orientation" type="int" enum="OS.ScreenOrientation">
  713. </argument>
  714. <description>
  715. Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class.
  716. </description>
  717. </method>
  718. <method name="set_thread_name">
  719. <return type="int" enum="Error">
  720. </return>
  721. <argument index="0" name="name" type="String">
  722. </argument>
  723. <description>
  724. Sets the name of the current thread.
  725. </description>
  726. </method>
  727. <method name="set_use_file_access_save_and_swap">
  728. <return type="void">
  729. </return>
  730. <argument index="0" name="enabled" type="bool">
  731. </argument>
  732. <description>
  733. Enables backup saves if [code]enabled[/code] is [code]true[/code].
  734. </description>
  735. </method>
  736. <method name="set_use_vsync">
  737. <return type="void">
  738. </return>
  739. <argument index="0" name="enable" type="bool">
  740. </argument>
  741. <description>
  742. If [code]true[/code] the framerate will synchronize to the monitor's refresh rate.
  743. </description>
  744. </method>
  745. <method name="set_window_fullscreen">
  746. <return type="void">
  747. </return>
  748. <argument index="0" name="enabled" type="bool">
  749. </argument>
  750. <description>
  751. Sets window fullscreen mode to the [i]enabled[/i] argument, [i]enabled[/i] is a toggle for the fullscreen mode, calling the function with [i]enabled[/i] true when the screen is not on fullscreen mode will cause the screen to go to fullscreen mode, calling the function with [i]enabled[/i] false when the screen is in fullscreen mode will cause the window to exit the fullscreen mode.
  752. </description>
  753. </method>
  754. <method name="set_window_maximized">
  755. <return type="void">
  756. </return>
  757. <argument index="0" name="enabled" type="bool">
  758. </argument>
  759. <description>
  760. Set [code]true[/code] to maximize the window.
  761. </description>
  762. </method>
  763. <method name="set_window_minimized">
  764. <return type="void">
  765. </return>
  766. <argument index="0" name="enabled" type="bool">
  767. </argument>
  768. <description>
  769. Set [code]true[/code] to minimize the window.
  770. </description>
  771. </method>
  772. <method name="set_window_position">
  773. <return type="void">
  774. </return>
  775. <argument index="0" name="position" type="Vector2">
  776. </argument>
  777. <description>
  778. Sets the position of the window to the specified position (this function could be restricted by the window manager, meaning that there could be some unreachable areas of the screen).
  779. </description>
  780. </method>
  781. <method name="set_window_resizable">
  782. <return type="void">
  783. </return>
  784. <argument index="0" name="enabled" type="bool">
  785. </argument>
  786. <description>
  787. Sets the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings.
  788. </description>
  789. </method>
  790. <method name="set_window_size">
  791. <return type="void">
  792. </return>
  793. <argument index="0" name="size" type="Vector2">
  794. </argument>
  795. <description>
  796. Sets the window size to the specified size.
  797. </description>
  798. </method>
  799. <method name="set_window_title">
  800. <return type="void">
  801. </return>
  802. <argument index="0" name="title" type="String">
  803. </argument>
  804. <description>
  805. Sets the window title to the specified string.
  806. </description>
  807. </method>
  808. <method name="shell_open">
  809. <return type="int" enum="Error">
  810. </return>
  811. <argument index="0" name="uri" type="String">
  812. </argument>
  813. <description>
  814. Requests the OS to open a resource with the most appropriate program. For example.
  815. [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the downloads folders of the user.
  816. [code]OS.shell_open("http://godotengine.org")[/code] opens the default web browser on the official Godot website.
  817. </description>
  818. </method>
  819. <method name="show_virtual_keyboard">
  820. <return type="void">
  821. </return>
  822. <argument index="0" name="existing_text" type="String" default="&quot;&quot;">
  823. </argument>
  824. <description>
  825. Shows the virtual keyboard if the platform has one. The [i]existing_text[/i] parameter is useful for implementing your own LineEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
  826. </description>
  827. </method>
  828. </methods>
  829. <constants>
  830. <constant name="DAY_SUNDAY" value="0">
  831. </constant>
  832. <constant name="DAY_MONDAY" value="1">
  833. </constant>
  834. <constant name="DAY_TUESDAY" value="2">
  835. </constant>
  836. <constant name="DAY_WEDNESDAY" value="3">
  837. </constant>
  838. <constant name="DAY_THURSDAY" value="4">
  839. </constant>
  840. <constant name="DAY_FRIDAY" value="5">
  841. </constant>
  842. <constant name="DAY_SATURDAY" value="6">
  843. </constant>
  844. <constant name="MONTH_JANUARY" value="1">
  845. </constant>
  846. <constant name="MONTH_FEBRUARY" value="2">
  847. </constant>
  848. <constant name="MONTH_MARCH" value="3">
  849. </constant>
  850. <constant name="MONTH_APRIL" value="4">
  851. </constant>
  852. <constant name="MONTH_MAY" value="5">
  853. </constant>
  854. <constant name="MONTH_JUNE" value="6">
  855. </constant>
  856. <constant name="MONTH_JULY" value="7">
  857. </constant>
  858. <constant name="MONTH_AUGUST" value="8">
  859. </constant>
  860. <constant name="MONTH_SEPTEMBER" value="9">
  861. </constant>
  862. <constant name="MONTH_OCTOBER" value="10">
  863. </constant>
  864. <constant name="MONTH_NOVEMBER" value="11">
  865. </constant>
  866. <constant name="MONTH_DECEMBER" value="12">
  867. </constant>
  868. <constant name="SCREEN_ORIENTATION_LANDSCAPE" value="0">
  869. </constant>
  870. <constant name="SCREEN_ORIENTATION_PORTRAIT" value="1">
  871. </constant>
  872. <constant name="SCREEN_ORIENTATION_REVERSE_LANDSCAPE" value="2">
  873. </constant>
  874. <constant name="SCREEN_ORIENTATION_REVERSE_PORTRAIT" value="3">
  875. </constant>
  876. <constant name="SCREEN_ORIENTATION_SENSOR_LANDSCAPE" value="4">
  877. </constant>
  878. <constant name="SCREEN_ORIENTATION_SENSOR_PORTRAIT" value="5">
  879. </constant>
  880. <constant name="SCREEN_ORIENTATION_SENSOR" value="6">
  881. </constant>
  882. <constant name="SYSTEM_DIR_DESKTOP" value="0">
  883. </constant>
  884. <constant name="SYSTEM_DIR_DCIM" value="1">
  885. </constant>
  886. <constant name="SYSTEM_DIR_DOCUMENTS" value="2">
  887. </constant>
  888. <constant name="SYSTEM_DIR_DOWNLOADS" value="3">
  889. </constant>
  890. <constant name="SYSTEM_DIR_MOVIES" value="4">
  891. </constant>
  892. <constant name="SYSTEM_DIR_MUSIC" value="5">
  893. </constant>
  894. <constant name="SYSTEM_DIR_PICTURES" value="6">
  895. </constant>
  896. <constant name="SYSTEM_DIR_RINGTONES" value="7">
  897. </constant>
  898. <constant name="POWERSTATE_UNKNOWN" value="0">
  899. </constant>
  900. <constant name="POWERSTATE_ON_BATTERY" value="1">
  901. </constant>
  902. <constant name="POWERSTATE_NO_BATTERY" value="2">
  903. </constant>
  904. <constant name="POWERSTATE_CHARGING" value="3">
  905. </constant>
  906. <constant name="POWERSTATE_CHARGED" value="4">
  907. </constant>
  908. </constants>
  909. </class>