Engine.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Engine" inherits="Object" category="Core" version="3.2">
  3. <brief_description>
  4. Access to basic engine properties.
  5. </brief_description>
  6. <description>
  7. The [Engine] class allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_author_info" qualifiers="const">
  13. <return type="Dictionary">
  14. </return>
  15. <description>
  16. Returns engine author information in a Dictionary.
  17. [code]lead_developers[/code] - Array of Strings, lead developer names
  18. [code]founders[/code] - Array of Strings, founder names
  19. [code]project_managers[/code] - Array of Strings, project manager names
  20. [code]developers[/code] - Array of Strings, developer names
  21. </description>
  22. </method>
  23. <method name="get_copyright_info" qualifiers="const">
  24. <return type="Array">
  25. </return>
  26. <description>
  27. Returns an Array of copyright information Dictionaries.
  28. [code]name[/code] - String, component name
  29. [code]parts[/code] - Array of Dictionaries {[code]files[/code], [code]copyright[/code], [code]license[/code]} describing subsections of the component
  30. </description>
  31. </method>
  32. <method name="get_donor_info" qualifiers="const">
  33. <return type="Dictionary">
  34. </return>
  35. <description>
  36. Returns a Dictionary of Arrays of donor names.
  37. {[code]platinum_sponsors[/code], [code]gold_sponsors[/code], [code]mini_sponsors[/code], [code]gold_donors[/code], [code]silver_donors[/code], [code]bronze_donors[/code]}
  38. </description>
  39. </method>
  40. <method name="get_frames_drawn">
  41. <return type="int">
  42. </return>
  43. <description>
  44. Returns the total number of frames drawn.
  45. </description>
  46. </method>
  47. <method name="get_frames_per_second" qualifiers="const">
  48. <return type="float">
  49. </return>
  50. <description>
  51. Returns the frames per second of the running game.
  52. </description>
  53. </method>
  54. <method name="get_license_info" qualifiers="const">
  55. <return type="Dictionary">
  56. </return>
  57. <description>
  58. Returns Dictionary of licenses used by Godot and included third party components.
  59. </description>
  60. </method>
  61. <method name="get_license_text" qualifiers="const">
  62. <return type="String">
  63. </return>
  64. <description>
  65. Returns Godot license text.
  66. </description>
  67. </method>
  68. <method name="get_main_loop" qualifiers="const">
  69. <return type="MainLoop">
  70. </return>
  71. <description>
  72. Returns the main loop object (see [MainLoop] and [SceneTree]).
  73. </description>
  74. </method>
  75. <method name="get_physics_interpolation_fraction" qualifiers="const">
  76. <return type="float">
  77. </return>
  78. <description>
  79. Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation.
  80. </description>
  81. </method>
  82. <method name="get_singleton" qualifiers="const">
  83. <return type="Object">
  84. </return>
  85. <argument index="0" name="name" type="String">
  86. </argument>
  87. <description>
  88. </description>
  89. </method>
  90. <method name="get_version_info" qualifiers="const">
  91. <return type="Dictionary">
  92. </return>
  93. <description>
  94. Returns the current engine version information in a Dictionary.
  95. [code]major[/code] - Holds the major version number as an int
  96. [code]minor[/code] - Holds the minor version number as an int
  97. [code]patch[/code] - Holds the patch version number as an int
  98. [code]hex[/code] - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below)
  99. [code]status[/code] - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
  100. [code]build[/code] - Holds the build name (e.g. "custom_build") as a String
  101. [code]hash[/code] - Holds the full Git commit hash as a String
  102. [code]year[/code] - Holds the year the version was released in as an int
  103. [code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String
  104. The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code:
  105. [codeblock]
  106. if Engine.get_version_info().hex &gt;= 0x030200:
  107. # Do things specific to version 3.2 or later
  108. else:
  109. # Do things specific to versions before 3.2
  110. [/codeblock]
  111. </description>
  112. </method>
  113. <method name="has_singleton" qualifiers="const">
  114. <return type="bool">
  115. </return>
  116. <argument index="0" name="name" type="String">
  117. </argument>
  118. <description>
  119. </description>
  120. </method>
  121. <method name="is_in_physics_frame" qualifiers="const">
  122. <return type="bool">
  123. </return>
  124. <description>
  125. Returns [code]true[/code] if the game is inside the fixed process and physics phase of the game loop.
  126. </description>
  127. </method>
  128. </methods>
  129. <members>
  130. <member name="editor_hint" type="bool" setter="set_editor_hint" getter="is_editor_hint" default="true">
  131. If [code]true[/code], it is running inside the editor. Useful for tool scripts.
  132. </member>
  133. <member name="iterations_per_second" type="int" setter="set_iterations_per_second" getter="get_iterations_per_second" default="60">
  134. The number of fixed iterations per second (for fixed process and physics).
  135. </member>
  136. <member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5">
  137. </member>
  138. <member name="target_fps" type="int" setter="set_target_fps" getter="get_target_fps" default="0">
  139. The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit.
  140. </member>
  141. <member name="time_scale" type="float" setter="set_time_scale" getter="get_time_scale" default="1.0">
  142. 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.
  143. </member>
  144. </members>
  145. <constants>
  146. </constants>
  147. </class>