class_engine.rst 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Engine.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Engine:
  5. Engine
  6. ======
  7. **Inherits:** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Access to basic engine properties.
  12. Properties
  13. ----------
  14. +---------------------------+------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`editor_hint<class_Engine_editor_hint>` |
  16. +---------------------------+------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`iterations_per_second<class_Engine_iterations_per_second>` |
  18. +---------------------------+------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`physics_jitter_fix<class_Engine_physics_jitter_fix>` |
  20. +---------------------------+------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`target_fps<class_Engine_target_fps>` |
  22. +---------------------------+------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`time_scale<class_Engine_time_scale>` |
  24. +---------------------------+------------------------------------------------------------------+
  25. Methods
  26. -------
  27. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  28. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_author_info<class_Engine_get_author_info>` **(** **)** const |
  29. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  30. | :ref:`Array<class_Array>` | :ref:`get_copyright_info<class_Engine_get_copyright_info>` **(** **)** const |
  31. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  32. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_donor_info<class_Engine_get_donor_info>` **(** **)** const |
  33. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  34. | :ref:`int<class_int>` | :ref:`get_frames_drawn<class_Engine_get_frames_drawn>` **(** **)** |
  35. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`get_frames_per_second<class_Engine_get_frames_per_second>` **(** **)** const |
  37. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  38. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_license_info<class_Engine_get_license_info>` **(** **)** const |
  39. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  40. | :ref:`String<class_String>` | :ref:`get_license_text<class_Engine_get_license_text>` **(** **)** const |
  41. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  42. | :ref:`MainLoop<class_MainLoop>` | :ref:`get_main_loop<class_Engine_get_main_loop>` **(** **)** const |
  43. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  44. | :ref:`Object<class_Object>` | :ref:`get_singleton<class_Engine_get_singleton>` **(** :ref:`String<class_String>` name **)** const |
  45. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  46. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_version_info<class_Engine_get_version_info>` **(** **)** const |
  47. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`has_singleton<class_Engine_has_singleton>` **(** :ref:`String<class_String>` name **)** const |
  49. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`is_in_physics_frame<class_Engine_is_in_physics_frame>` **(** **)** const |
  51. +--------------------------------------+-----------------------------------------------------------------------------------------------------+
  52. Description
  53. -----------
  54. The ``Engine`` class allows you to query and modify the game's run-time parameters, such as frames per second, time scale, and others.
  55. Property Descriptions
  56. ---------------------
  57. .. _class_Engine_editor_hint:
  58. - :ref:`bool<class_bool>` **editor_hint**
  59. +----------+------------------------+
  60. | *Setter* | set_editor_hint(value) |
  61. +----------+------------------------+
  62. | *Getter* | is_editor_hint() |
  63. +----------+------------------------+
  64. If ``true``, it is running inside the editor. Useful for tool scripts.
  65. .. _class_Engine_iterations_per_second:
  66. - :ref:`int<class_int>` **iterations_per_second**
  67. +----------+----------------------------------+
  68. | *Setter* | set_iterations_per_second(value) |
  69. +----------+----------------------------------+
  70. | *Getter* | get_iterations_per_second() |
  71. +----------+----------------------------------+
  72. The number of fixed iterations per second (for fixed process and physics).
  73. .. _class_Engine_physics_jitter_fix:
  74. - :ref:`float<class_float>` **physics_jitter_fix**
  75. +----------+-------------------------------+
  76. | *Setter* | set_physics_jitter_fix(value) |
  77. +----------+-------------------------------+
  78. | *Getter* | get_physics_jitter_fix() |
  79. +----------+-------------------------------+
  80. .. _class_Engine_target_fps:
  81. - :ref:`int<class_int>` **target_fps**
  82. +----------+-----------------------+
  83. | *Setter* | set_target_fps(value) |
  84. +----------+-----------------------+
  85. | *Getter* | get_target_fps() |
  86. +----------+-----------------------+
  87. The desired frames per second. If the hardware cannot keep up, this setting may not be respected. Defaults to 0, which indicates no limit.
  88. .. _class_Engine_time_scale:
  89. - :ref:`float<class_float>` **time_scale**
  90. +----------+-----------------------+
  91. | *Setter* | set_time_scale(value) |
  92. +----------+-----------------------+
  93. | *Getter* | get_time_scale() |
  94. +----------+-----------------------+
  95. Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed.
  96. Method Descriptions
  97. -------------------
  98. .. _class_Engine_get_author_info:
  99. - :ref:`Dictionary<class_Dictionary>` **get_author_info** **(** **)** const
  100. Returns engine author information in a Dictionary.
  101. "lead_developers" - Array of Strings, lead developer names
  102. "founders" - Array of Strings, founder names
  103. "project_managers" - Array of Strings, project manager names
  104. "developers" - Array of Strings, developer names
  105. .. _class_Engine_get_copyright_info:
  106. - :ref:`Array<class_Array>` **get_copyright_info** **(** **)** const
  107. Returns an Array of copyright information Dictionaries.
  108. "name" - String, component name
  109. "parts" - Array of Dictionaries {"files", "copyright", "license"} describing subsections of the component
  110. .. _class_Engine_get_donor_info:
  111. - :ref:`Dictionary<class_Dictionary>` **get_donor_info** **(** **)** const
  112. Returns a Dictionary of Arrays of donor names.
  113. {"platinum_sponsors", "gold_sponsors", "mini_sponsors", "gold_donors", "silver_donors", "bronze_donors"}
  114. .. _class_Engine_get_frames_drawn:
  115. - :ref:`int<class_int>` **get_frames_drawn** **(** **)**
  116. Returns the total number of frames drawn.
  117. .. _class_Engine_get_frames_per_second:
  118. - :ref:`float<class_float>` **get_frames_per_second** **(** **)** const
  119. Returns the frames per second of the running game.
  120. .. _class_Engine_get_license_info:
  121. - :ref:`Dictionary<class_Dictionary>` **get_license_info** **(** **)** const
  122. Returns Dictionary of licenses used by Godot and included third party components.
  123. .. _class_Engine_get_license_text:
  124. - :ref:`String<class_String>` **get_license_text** **(** **)** const
  125. Returns Godot license text.
  126. .. _class_Engine_get_main_loop:
  127. - :ref:`MainLoop<class_MainLoop>` **get_main_loop** **(** **)** const
  128. Returns the main loop object (see :ref:`MainLoop<class_MainLoop>` and :ref:`SceneTree<class_SceneTree>`).
  129. .. _class_Engine_get_singleton:
  130. - :ref:`Object<class_Object>` **get_singleton** **(** :ref:`String<class_String>` name **)** const
  131. .. _class_Engine_get_version_info:
  132. - :ref:`Dictionary<class_Dictionary>` **get_version_info** **(** **)** const
  133. Returns the current engine version information in a Dictionary.
  134. "major" - Holds the major version number as an int
  135. "minor" - Holds the minor version number as an int
  136. "patch" - Holds the patch version number as an int
  137. "status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
  138. "build" - Holds the build name (e.g. "custom-build") as a String
  139. "string" - major + minor + patch + status + build in a single String
  140. .. _class_Engine_has_singleton:
  141. - :ref:`bool<class_bool>` **has_singleton** **(** :ref:`String<class_String>` name **)** const
  142. .. _class_Engine_is_in_physics_frame:
  143. - :ref:`bool<class_bool>` **is_in_physics_frame** **(** **)** const
  144. Returns ``true`` if the game is inside the fixed process and physics phase of the game loop.