classref: Sync with current 3.4 branch

This commit is contained in:
Rémi Verschelde
2021-11-19 10:05:42 +01:00
parent 2864ab4f65
commit 9060c28080
683 changed files with 8789 additions and 2973 deletions

View File

@@ -1,6 +1,6 @@
:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the Engine.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
@@ -94,7 +94,7 @@ If ``true``, the script is currently running inside the editor. This is useful f
else:
simulate_physics()
See `Running code in the editor <https://docs.godotengine.org/en/3.3/tutorials/misc/running_code_in_the_editor.html>`_ in the documentation for more information.
See `Running code in the editor <https://docs.godotengine.org/en/3.4/tutorials/misc/running_code_in_the_editor.html>`__ in the documentation for more information.
**Note:** To detect whether the script is run from an editor *build* (e.g. when pressing ``F5``), use :ref:`OS.has_feature<class_OS_method_has_feature>` with the ``"editor"`` argument instead. ``OS.has_feature("editor")`` will evaluate to ``true`` both when the code is running in the editor and when running the project from the editor, but it will evaluate to ``false`` when the code is run from an exported project.
@@ -229,7 +229,7 @@ Returns a Dictionary of Arrays of donor names.
- :ref:`int<class_int>` **get_frames_drawn** **(** **)**
Returns the total number of frames drawn. If the render loop is disabled with ``--disable-render-loop`` via command line, this returns ``0``. See also :ref:`get_idle_frames<class_Engine_method_get_idle_frames>`.
Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with ``--disable-render-loop`` via command line, :ref:`get_frames_drawn<class_Engine_method_get_frames_drawn>` always returns ``0``. See :ref:`get_idle_frames<class_Engine_method_get_idle_frames>`.
----
@@ -245,7 +245,15 @@ Returns the frames per second of the running game.
- :ref:`int<class_int>` **get_idle_frames** **(** **)** |const|
Returns the total number of frames passed since engine initialization which is advanced on each **idle frame**, regardless of whether the render loop is enabled. See also :ref:`get_frames_drawn<class_Engine_method_get_frames_drawn>`.
Returns the total number of frames passed since engine initialization which is advanced on each **idle frame**, regardless of whether the render loop is enabled. See also :ref:`get_frames_drawn<class_Engine_method_get_frames_drawn>` and :ref:`get_physics_frames<class_Engine_method_get_physics_frames>`.
:ref:`get_idle_frames<class_Engine_method_get_idle_frames>` can be used to run expensive logic less often without relying on a :ref:`Timer<class_Timer>`:
::
func _process(_delta):
if Engine.get_idle_frames() % 2 == 0:
pass # Run expensive logic only once every 2 idle (render) frames here.
----
@@ -277,7 +285,15 @@ Returns the main loop object (see :ref:`MainLoop<class_MainLoop>` and :ref:`Scen
- :ref:`int<class_int>` **get_physics_frames** **(** **)** |const|
Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**.
Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**. See also :ref:`get_idle_frames<class_Engine_method_get_idle_frames>`.
:ref:`get_physics_frames<class_Engine_method_get_physics_frames>` can be used to run expensive logic less often without relying on a :ref:`Timer<class_Timer>`:
::
func _physics_process(_delta):
if Engine.get_physics_frames() % 2 == 0:
pass # Run expensive logic only once every 2 physics frames here.
----