Added everything from godot's docs. 3.6 branch, b4bfc5a4b1 .

This commit is contained in:
Relintai 2022-09-10 12:15:58 +02:00
parent 4acaef7d25
commit 1eef2f32d0
1079 changed files with 173217 additions and 796 deletions

View File

@ -1,8 +1,4 @@
# Pandemonium Engine documentation
This is a (not direct) fork of godot's documentation.
The goal is to simplify it as much as possible and to move it to the main engine repository. (Possibly even shipping it built in.)
# Godot Engine documentation
This repository contains the source files of [Godot Engine](https://godotengine.org)'s documentation, in reStructuredText markup language (reST).

View File

@ -209,6 +209,12 @@ legend,
font-weight: 500;
}
/* See <https://github.com/godotengine/godot-docs/pull/5876> for context. */
.rst-content .align-right,
.rst-content .align-left {
clear: both;
}
.rst-content div.figure p.caption {
/* Tweak caption styling to be closer to typical captions */
text-align: center;
@ -237,6 +243,12 @@ article ol,
line-height: 25px;
}
.rst-content section ul li {
/* Increase spacing between list items. */
margin-top: 8px;
margin-bottom: 8px;
}
body,
.rst-content table.docutils thead {
color: var(--body-color);
@ -292,74 +304,83 @@ hr,
}
/* JavaScript documentation directives */
.rst-content dl:not(.docutils) dt {
background-color: var(--admonition-note-background-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt {
background-color: var(--admonition-note-background-color);
border-color: var(--admonition-note-title-background-color);
color: var(--admonition-note-color);
}
.rst-content dl:not(.docutils) dl dt {
background-color: var(--admonition-attention-background-color);
border-color: var(--admonition-attention-title-background-color);
color: var(--admonition-attention-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl dt {
background-color: transparent;
border-color: transparent;
color: var(--footer-color);
}
.rst-content dl:not(.docutils).class dt,
.rst-content dl:not(.docutils).function dt,
.rst-content dl:not(.docutils).method dt,
.rst-content dl:not(.docutils).attribute dt {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute dt {
font-weight: 600;
padding: 0 8px;
margin-bottom: 1px;
width: 100%;
}
.rst-content dl:not(.docutils).class > dt,
.rst-content dl:not(.docutils).function > dt,
.rst-content dl:not(.docutils).method > dt,
.rst-content dl:not(.docutils).attribute > dt {
font-size: 100%;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace;
font-size: 90%;
font-weight: normal;
margin-bottom: 16px;
padding: 6px 8px;
}
.rst-content dl:not(.docutils) tt.descclassname,
.rst-content dl:not(.docutils) code.descclassname {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-prename.descclassname {
color: var(--highlight-type2-color);
font-weight: normal;
}
.rst-content dl:not(.docutils) tt.descname,
.rst-content dl:not(.docutils) code.descname {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name.descname {
color: var(--highlight-function-color);
font-weight: normal;
font-weight: 700;
}
.rst-content dl:not(.docutils) .sig-paren,
.rst-content dl:not(.docutils) .optional {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-paren,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
color: var(--highlight-operator-color) !important;
font-weight: normal;
padding: 0 2px;
}
.rst-content dl:not(.docutils) .optional {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
font-style: italic;
}
.rst-content dl:not(.docutils) .sig-param,
.rst-content dl:not(.docutils).class dt > em,
.rst-content dl:not(.docutils).function dt > em,
.rst-content dl:not(.docutils).method dt > em {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > em {
color: var(--code-literal-color);
font-style: normal;
padding: 0 4px;
}
.rst-content dl:not(.docutils) .sig-param,
.rst-content dl:not(.docutils).class dt > .optional ~ em,
.rst-content dl:not(.docutils).function dt > .optional ~ em,
.rst-content dl:not(.docutils).method dt > .optional ~ em {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k {
font-style: normal;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > .optional ~ em {
color: var(--highlight-number-color);
font-style: italic;
}
.rst-content dl:not(.docutils).class dt > em.property {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em.property {
color: var(--highlight-keyword-color);
}
.rst-content dl:not(.docutils) dt a.headerlink {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink {
color: var(--link-color) !important;
}
.rst-content dl:not(.docutils) dt a.headerlink:visited {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink:visited {
color: var(--link-color-visited);
}
html.writer-html5 .rst-content dl.field-list > dd strong {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace;
}
footer,
#search-results .context {

View File

@ -3,5 +3,22 @@
{% block breadcrumbs_aside %}
{% if not meta or meta.get('github_url') != 'hide' %}
{{ super() }}
<style>
.godot-edit-guidelines {
font-size: 14px;
float: right;
clear: both;
}
@media screen and (max-width: 480px) {
.godot-edit-guidelines {
display: none;
}
}
</style>
<a class="godot-edit-guidelines" href="https://docs.godotengine.org/en/latest/community/contributing/index.html#writing-documentation">
Learn how to contribute!
</a>
{% endif %}
{% endblock %}

View File

@ -1 +1,2 @@
| ro | Romanian |
| te | Telugu |

View File

@ -16,6 +16,14 @@ distribute the software (and derivative projects, including games made with it).
Your game or project can have a different license, but it still needs to comply
with the original one.
.. warning::
In your project's credits screen, remember to also list third-party notices
for assets you're using, such as textures, models, sounds, music and fonts.
Free assets in particular often come with licenses that require attribution.
Double-check their license before using those assets in a project.
Requirements
------------
@ -26,8 +34,8 @@ This text reads as follows:
This game uses Godot Engine, available under the following license:
Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur.
Copyright (c) 2014-2021 Godot Engine contributors.
Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.
Copyright (c) 2014-2022 Godot Engine contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ -81,9 +89,9 @@ If the game includes printed manuals, license text can be included there.
Link to the license
^^^^^^^^^^^^^^^^^^^
The Godot Engine developers consider that a link to godotengine.org/license
The Godot Engine developers consider that a link to ``godotengine.org/license``
in your game documentation or credits would be an acceptable way to satisfy
the license terms.
the license terms.
Third-party licenses
--------------------
@ -105,10 +113,13 @@ requires attribution, so the following text must be included together with the
Godot license:
Portions of this software are copyright © <year> The FreeType Project (www.freetype.org). All rights reserved.
Note that <year> should correspond to the value from the FreeType version
used in your build. This information can be found in the editor by opening
the **Help > About** dialog and going to the **Third-party Licenses** tab.
.. note::
<year> should correspond to the value from the FreeType version used
in your build. This information can be found in the editor by opening
the **Help > About** dialog and going to the **Third-party Licenses**
tab.
ENet
^^^^
@ -125,12 +136,11 @@ high-level multiplayer. ENet has similar licensing terms as Godot:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MBedTLS
^^^^^^^
mbed TLS
^^^^^^^^
If the project is done with Godot 3.1 or above and it utilizes SSL (usually
through HTTP requests), the `MBedTLS <https://tls.mbed.org>`_ Apache license
needs to be complied by including the following text:
If the project is exported with Godot 3.1 or later, it includes `mbed TLS <https://tls.mbed.org>`_.
The Apache license needs to be complied to by including the following text:
Copyright The Mbed TLS Contributors
@ -146,5 +156,12 @@ needs to be complied by including the following text:
See the License for the specific language governing permissions and
limitations under the License.
Keep in mind that Godot 2.x and 3.0 use `OpenSSL <https://www.openssl.org>`_
instead.
Keep in mind that Godot 2.x and 3.0 use `OpenSSL <https://www.openssl.org>`_ 1.x
instead. This old OpenSSL version used the OpenSSL license, not the Apache 2 license
as the latest version of OpenSSL currently uses (as of April 2022).
.. note::
If you exported your project using a
:ref:`custom build with specific modules disabled <doc_optimizing_for_size>`,
you don't need to list the disabled modules' licenses in your exported project.

221
about/docs_changelog.rst Normal file
View File

@ -0,0 +1,221 @@
.. _doc_docs_changelog:
Documentation changelog
=======================
The documentation is continually being improved. The release of version 3.2
includes many new tutorials, many fixes and updates for old tutorials, and many updates
to the :ref:`class reference <toc-class-ref>`. Below is a list of new tutorials
added since version 3.1.
.. note:: This document only contains new tutorials so not all changes are reflected,
many tutorials have been substantially updated but are not reflected in this document.
New tutorials since version 3.1
-------------------------------
Project workflow
^^^^^^^^^^^^^^^^
- :ref:`doc_android_custom_build`
2D
^^
- :ref:`doc_2d_sprite_animation`
Audio
^^^^^
- :ref:`doc_recording_with_microphone`
- :ref:`doc_sync_with_audio`
Math
^^^^
- :ref:`doc_beziers_and_curves`
- :ref:`doc_interpolation`
Inputs
^^^^^^
- :ref:`doc_input_examples`
Internationalization
^^^^^^^^^^^^^^^^^^^^
- :ref:`doc_localization_using_gettext`
Shading
^^^^^^^
- Your First Shader Series:
- :ref:`doc_introduction_to_shaders`
- :ref:`doc_your_first_canvasitem_shader`
- :ref:`doc_your_first_spatial_shader`
- :ref:`doc_your_second_spatial_shader`
- :ref:`doc_visual_shaders`
Networking
^^^^^^^^^^
- :ref:`doc_webrtc`
VR
^^
- :ref:`doc_vr_starter_tutorial_part_one`
- :ref:`doc_vr_starter_tutorial_part_two`
Plugins
^^^^^^^
- :ref:`doc_android_plugin`
- :ref:`doc_inspector_plugins`
- :ref:`doc_visual_shader_plugins`
Multi-threading
^^^^^^^^^^^^^^^
- :ref:`doc_using_multiple_threads`
Creating content
^^^^^^^^^^^^^^^^
Procedural geometry series:
- :ref:`Procedural geometry <toc-procedural_geometry>`
- :ref:`doc_arraymesh`
- :ref:`doc_surfacetool`
- :ref:`doc_meshdatatool`
- :ref:`doc_immediategeometry`
Optimization
^^^^^^^^^^^^
- :ref:`doc_using_multimesh`
- :ref:`doc_using_servers`
Legal
^^^^^
- :ref:`doc_complying_with_licenses`
New tutorials since version 3.0
-------------------------------
Step by step
^^^^^^^^^^^^
- :ref:`doc_signals`
- :ref:`doc_exporting_basics`
Scripting
^^^^^^^^^
- :ref:`doc_gdscript_static_typing`
Project workflow
^^^^^^^^^^^^^^^^
Best Practices:
- :ref:`doc_introduction_best_practices`
- :ref:`doc_what_are_godot_classes`
- :ref:`doc_scene_organization`
- :ref:`doc_scenes_versus_scripts`
- :ref:`doc_autoloads_versus_internal_nodes`
- :ref:`doc_node_alternatives`
- :ref:`doc_godot_interfaces`
- :ref:`doc_godot_notifications`
- :ref:`doc_data_preferences`
- :ref:`doc_logic_preferences`
2D
^^
- :ref:`doc_2d_lights_and_shadows`
- :ref:`doc_2d_meshes`
3D
^^
- :ref:`doc_csg_tools`
- :ref:`doc_animating_thousands_of_fish`
- :ref:`doc_controlling_thousands_of_fish`
Physics
^^^^^^^
- :ref:`doc_ragdoll_system`
- :ref:`doc_soft_body`
Animation
^^^^^^^^^
- :ref:`doc_2d_skeletons`
- :ref:`doc_animation_tree`
GUI
^^^
- :ref:`doc_gui_containers`
Viewports
^^^^^^^^^
- :ref:`doc_viewport_as_texture`
- :ref:`doc_custom_postprocessing`
Shading
^^^^^^^
- :ref:`doc_converting_glsl_to_godot_shaders`
- :ref:`doc_advanced_postprocessing`
Shading Reference:
- :ref:`doc_introduction_to_shaders`
- :ref:`doc_shading_language`
- :ref:`doc_spatial_shader`
- :ref:`doc_canvas_item_shader`
- :ref:`doc_particle_shader`
Plugins
^^^^^^^
- :ref:`doc_making_main_screen_plugins`
- :ref:`doc_spatial_gizmo_plugins`
Platform-specific
^^^^^^^^^^^^^^^^^
- :ref:`doc_customizing_html5_shell`
Multi-threading
^^^^^^^^^^^^^^^
- :ref:`doc_thread_safe_apis`
Creating content
^^^^^^^^^^^^^^^^
- :ref:`doc_making_trees`
Miscellaneous
^^^^^^^^^^^^^
- :ref:`doc_jitter_stutter`
- :ref:`doc_running_code_in_the_editor`
- :ref:`doc_change_scenes_manually`
- :ref:`doc_gles2_gles3_differences`
Compiling
^^^^^^^^^
- :ref:`doc_optimizing_for_size`
- :ref:`doc_compiling_with_script_encryption_key`
Engine development
^^^^^^^^^^^^^^^^^^
- :ref:`doc_binding_to_external_libraries`

View File

@ -38,6 +38,8 @@ Which platforms are supported by Godot?
* Windows
* macOS
* X11 (Linux, \*BSD)
* :ref:`Web <doc_using_the_web_editor>`
* Android (experimental)
**For exporting your games:**
@ -183,6 +185,73 @@ free and open-source integration, consider starting the integration work yoursel
Godot is not owned by one person; it belongs to the community, and it grows along
with ambitious community contributors like you.
How do I install the Godot editor on my system (for desktop integration)?
-------------------------------------------------------------------------
Since you don't need to actually install Godot on your system to run it,
this means desktop integration is not performed automatically.
There are two ways to overcome this. You can install Godot from
`Steam <https://store.steampowered.com/app/404790/Godot_Engine/>`__ (all platforms),
`Scoop <https://scoop.sh/>`__ (Windows), `Homebrew <https://brew.sh/>`__ (macOS)
or `Flathub <https://flathub.org/apps/details/org.godotengine.Godot>`__ (Linux).
This will automatically perform the required steps for desktop integration.
Alternatively, you can manually perform the steps that an installer would do for you:
Windows
^^^^^^^
- Move the Godot executable to a stable location (i.e. outside of your Downloads folder),
so you don't accidentally move it and break the shortcut in the future.
- Right-click the Godot executable and choose **Create Shortcut**.
- Move the created shortcut to ``%LOCALAPPDATA%\Microsoft\Windows\Start Menu\Programs``.
This is the user-wide location for shortcuts that will appear in the Start menu.
You can also pin Godot in the task bar by right-clicking the executable and choosing
**Pin to Task Bar**.
macOS
^^^^^
Drag the extracted Godot application to ``/Applications/Godot.app``, then drag it
to the Dock if desired. Spotlight will be able to find Godot as long as it's in
``/Applications`` or ``~/Applications``.
Linux
^^^^^
- Move the Godot binary to a stable location (i.e. outside of your Downloads folder),
so you don't accidentally move it and break the shortcut in the future.
- Rename and move the Godot binary to a location present in your ``PATH`` environment variable.
This is typically ``/usr/local/bin/godot`` or ``/usr/bin/godot``.
Doing this requires administrator privileges,
but this also allows you to
:ref:`run the Godot editor from a terminal <doc_command_line_tutorial>` by entering ``godot``.
- If you cannot move the Godot editor binary to a protected location, you can
keep the binary somewhere in your home directory, and modify the ``Path=``
line in the ``.desktop`` file linked below to contain the full *absolute* path
to the Godot binary.
- Save `this .desktop file <https://raw.githubusercontent.com/godotengine/godot/3.x/misc/dist/linux/org.godotengine.Godot.desktop>`__
to ``$HOME/.local/share/applications/``. If you have administrator privileges,
you can also save the ``.desktop`` file to ``/usr/local/share/applications``
to make the shortcut available for all users.
Is the Godot editor a portable application?
-------------------------------------------
In its default configuration, Godot is *semi-portable*. Its executable can run
from any location (including non-writable locations) and never requires
administrator privileges.
However, configuration files will be written to the user-wide configuration or
data directory. This is usually a good approach, but this means configuration files
will not carry across machines if you copy the folder containing the Godot executable.
See :ref:`doc_data_paths` for more information.
If *true* portable operation is desired (e.g. for use on an USB stick),
follow the steps in :ref:`doc_data_paths_self_contained_mode`.
Why does Godot use Vulkan or OpenGL instead of Direct3D?
--------------------------------------------------------
@ -238,7 +307,7 @@ There are several reasons for this:
For all the reasons above, we have to be selective of what we can accept as core
functionality in Godot. This is why we are aiming to move some core
functionality to officially supported add-ons in future versions of Godot. In
terms of binary size, this also has the advance of making you pay only for what
terms of binary size, this also has the advantage of making you pay only for what
you actually use in your project. (In the meantime, you can
:ref:`compile custom export templates with unused features disabled <doc_optimizing_for_size>`
to optimize the distribution size of your project.)

View File

@ -9,6 +9,8 @@ About
faq
troubleshooting
list_of_features
docs_changelog
release_policy
complying_with_licenses
.. history

View File

@ -8,7 +8,7 @@ This page aims to list all features currently supported by Godot.
.. note::
This page lists features supported by the current stable version of
Godot (3.3). `More features <https://docs.godotengine.org/en/latest/about/list_of_features.html>`__
Godot (3.5). `More features <https://docs.godotengine.org/en/latest/about/list_of_features.html>`__
are available in the latest development version (4.0).
Features
@ -45,7 +45,7 @@ Editor
**Features:**
- Scene tree editor.
- Script editor.
- Built-in script editor.
- Support for :ref:`external script editors <doc_external_editor>` such as
Visual Studio Code or Vim.
- GDScript :ref:`debugger <doc_debugger_panel>`.
@ -65,14 +65,17 @@ Editor
- Move the in-editor camera and see the result in the running project.
- Built-in offline class reference documentation.
- Use the editor in dozens of languages contributed by the community.
**Plugins:**
- Editor plugins can be downloaded from the
:ref:`asset library <doc_what_is_assetlib>` to extend editor functionality.
- Create your own plugins using GDScript to add new features or speed up your workflow.
- Download projects from the asset library in the project manager and import them directly.
- :ref:`Create your own plugins <doc_making_plugins>` using GDScript to add new
features or speed up your workflow.
- :ref:`Download projects from the asset library <doc_using_assetlib_editor>`
in the project manager and import them directly.
2D graphics
^^^^^^^^^^^
@ -96,7 +99,7 @@ Editor
- AnimatedSprite as a helper for creating animated sprites.
- Parallax layers.
- Pseudo-3D support by automatically duplicating a layer several times.
- Pseudo-3D support including preview in the editor.
- 2D lighting with normal maps.
@ -106,7 +109,7 @@ Editor
- Bitmap fonts can be exported using tools like BMFont.
- DynamicFont supports monochrome fonts as well as colored fonts (e.g. for emoji).
Supported formats are TTF, OTF and WOFF1.
Supported formats are TTF, OTF, WOFF1 and WOFF2.
- DynamicFont supports optional font outlines with adjustable width and color.
- Support for font oversampling to keep fonts sharp at higher resolutions.
@ -149,7 +152,9 @@ Editor
- OpenGL ES 3.0 renderer (uses OpenGL 3.3 on desktop platforms).
- High-end visuals. Recommended on desktop platforms.
- HDR rendering with sRGB.
- Optional HDR rendering with sRGB (enabled by default).
- Uses an optional depth prepass (enabled by default) to reduce the cost of
overdraw, which speeds up complex scene rendering.
- OpenGL ES 2.0 renderer (uses OpenGL 2.1 on desktop platforms).
@ -162,23 +167,35 @@ Editor
- Perspective, orthographic and frustum-offset cameras.
**Physically-based rendering:**
**Physically-based rendering (built-in material features):**
- Follows the Disney PBR model.
- Supports Lambert, Lambert Wrap (half-Lambert), Oren-Nayar and Toon diffuse shading modes.
- Supports Schlick-GGX, Blinn, Phong, Toon and Disabled specular shading modes.
- Uses a roughness-metallic workflow with support for ORM textures.
- Uses horizon specular occlusion (Filament model) to improve material appearance
- Normal mapping.
- *GLES3:* Parallax/relief mapping with automatic level of detail based on distance.
- *GLES3:* Sub-surface scattering and transmittance.
- *GLES3:* Proximity fade (soft particles).
- Detail mapping for the albedo and normal maps.
- Distance fade which can use alpha blending or dithering to avoid going through
the transparent pipeline.
- Dithering can be determined on a per-pixel or per-object basis.
- *GLES3:* Parallax/relief mapping with automatic level of detail based on distance.
- *GLES3:* Sub-surface scattering and transmittance.
- *GLES3:* Refraction with support for material roughness (resulting in blurry refraction).
On GLES2, refraction is still functional but lacks support for material roughness.
- *GLES3:* Proximity fade (soft particles).
**Real-time lighting:**
- Directional lights (sun/moon). Up to 4 per scene.
- Omnidirectional lights.
- Spot lights with adjustable cone angle and attenuation.
- Specular energy can be adjusted on a per-light basis.
- *GLES3:* Lighting is done with a single-pass forward approach.
By default, up to 32 omni light and 32 spot lights can be displayed per mesh resource.
If needed, this limit can be increased at the cost of increased shader compilation times and lower performance.
GLES2 uses a multi-pass forward approach to lighting, which doesn't have a
limit on the number of lights but is slower with many lights.
**Shadow mapping:**
@ -203,11 +220,11 @@ Editor
**Reflections:**
- *GLES3:* Voxel-based reflections (when using GI probes).
- Fast baked reflections or slow real-time reflections using ReflectionProbe.
Parallax correction can optionally be enabled.
- *GLES3:* Screen-space reflections.
Parallax box correction can optionally be enabled.
- Reflection techniques can be mixed together for greater accuracy or scalability.
- *GLES3:* Voxel-based reflections (when using GI probes).
- *GLES3:* Screen-space reflections.
**Sky:**
@ -224,20 +241,20 @@ Editor
**Particles:**
- *GLES3:* GPU-based particles with support for custom particle shaders.
- CPU-based particles.
- *GLES3:* GPU-based particles with support for custom particle shaders.
**Post-processing:**
- Tonemapping (Linear, Reinhard, Filmic, ACES).
- *GLES3:* Automatic exposure adjustments based on viewport brightness.
- *GLES3:* Near and far depth of field.
- *GLES3:* Screen-space ambient occlusion.
- *GLES3:* Optional debanding to avoid color banding (effective when HDR rendering is enabled).
- Glow/bloom with optional bicubic upscaling and several blend modes available:
Screen, Soft Light, Add, Replace.
- Color correction using an one-dimensional ramp.
- Brightness, contrast and saturation adjustments.
- *GLES3:* Automatic exposure adjustments based on viewport brightness.
- *GLES3:* Near and far depth of field.
- *GLES3:* Screen-space ambient occlusion (SSAO).
- *GLES3:* Optional debanding to avoid color banding (effective when HDR rendering is enabled).
**Texture filtering:**
@ -245,18 +262,30 @@ Editor
**Texture compression:**
- Lossless or lossy WebP (does not save VRAM; only reduces storage size).
- S3TC (only supported on desktop platforms).
- ETC1 (recommended when using the GLES2 renderer).
- *GLES3:* BPTC for high-quality compression (not supported on macOS).
- *GLES3:* ETC2 (not supported on macOS).
- ETC1 (recommended when using the GLES2 renderer).
- *GLES3:* S3TC (not supported on mobile/Web platforms).
**Anti-aliasing:**
- Multi-sample antialiasing (MSAA).
- Fast approximate antialiasing (FXAA).
Most of these effects can be adjusted for better performance or to further
improve quality. This can be helpful when using Godot for offline rendering.
**Performance:**
- Occlusion culling with :ref:`rooms and portals <doc_rooms_and_portals>`.
Supports gameplay notifications with primary and secondary visibility to
disable AI/physics processing for nodes that don't need it.
- Real-time occluder shapes (sphere and polygon). Not as effective as rooms and portals
(and doesn't support gameplay notifications), but easier to set up.
.. note::
Most of the effects listed above can be adjusted for better performance or
to further improve quality. This can be helpful when using Godot for
offline rendering.
3D tools
^^^^^^^^
@ -270,6 +299,7 @@ improve quality. This can be helpful when using Godot for offline rendering.
- PathFollow3D node to make nodes follow a Path3D.
- 3D geometry helper class.
- Support for exporting the current scene as a glTF 2.0 file from the editor.
3D physics
^^^^^^^^^^
@ -349,6 +379,16 @@ Scripting
- Maintained D, Kotlin, Python, Nim, and Rust bindings provided by the community.
.. warning::
`Godot 4.0 will remove VisualScript from core entirely. <https://godotengine.org/article/godot-4-will-discontinue-visual-scripting>`__
As a result, creating new projects using visual scripting in Godot is not recommended.
Future Godot 4.x releases may have VisualScript reimplemented as an extension.
While Godot 3.x will keep VisualScript supported, we recommend
:ref:`trying out GDScript <toc-learn-scripting-gdscript>` instead,
especially if you intend to migrate your project to Godot 4.
Audio
^^^^^
@ -361,7 +401,7 @@ Audio
- Support for re-routable :ref:`audio buses <doc_audio_buses>` and effects
with dozens of effects included.
- Listener3D node to listen from a position different than the camera in 3D.
- Listener2D and Listener3D nodes to listen from a position different than the camera.
- Audio input to record microphones with real-time access using the AudioEffectCapture class.
- MIDI input.
@ -396,6 +436,9 @@ Import
- Collada (.dae).
- Wavefront OBJ (static scenes only, can be loaded directly as a mesh).
- 3D meshes use `Mikktspace <http://www.mikktspace.com/>`__ to generate tangents
on import, which ensures consistency with other 3D applications such as Blender.
Input
^^^^^
@ -422,11 +465,8 @@ Navigation
^^^^^^^^^^
- A* algorithm in 2D and 3D.
- Navigation meshes.
- Support for dynamic obstacle avoidance planned in Godot 4.0.
- Generate navigation meshes from the editor.
- Navigation meshes with dynamic obstacle avoidance.
- Generate navigation meshes from the editor or at run-time (including from an exported project).
Networking
^^^^^^^^^^
@ -476,6 +516,10 @@ Windowing and OS integration
- Execute commands in a blocking or non-blocking manner.
- Open file paths and URLs using default or custom protocol handlers (if registered on the system).
- Parse custom command line arguments.
- :ref:`Headless/server binaries <doc_exporting_for_dedicated_servers>` can be
downloaded for Linux and :ref:`compiled for macOS <doc_compiling_for_osx>`.
Any binary can be used without a window using the ``--no-window``
:ref:`command line argument <doc_command_line_tutorial>`.
Mobile
^^^^^^
@ -489,9 +533,9 @@ XR support (AR and VR)
- Support for ARKit on iOS out of the box.
- Support for the OpenXR APIs.
- Includes support for popular headsets like the Meta Quest and the Valve Index.
- Support for the OpenVR APIs.
GUI system
@ -510,7 +554,8 @@ The editor UI can easily be extended in many ways using add-ons.
- Labels.
- RichTextLabel for :ref:`text formatted using BBCode <doc_bbcode_in_richtextlabel>`.
- Trees (can also be used to represent tables).
- Containers (horizontal, vertical, grid, center, margin, draggable splitter, ...).
- Color picker with RGB and HSV modes.
- Containers (horizontal, vertical, grid, flow, center, margin, aspect ratio, draggable splitter, ...).
- Controls can be rotated and scaled.
**Sizing:**
@ -535,7 +580,7 @@ The editor UI can easily be extended in many ways using add-ons.
- Procedural vector-based theming using :ref:`class_StyleBoxFlat`.
- Supports rounded/beveled corners, drop shadows and per-border widths.
- Supports rounded/beveled corners, drop shadows, per-border widths and antialiasing.
- Texture-based theming using :ref:`class_StyleBoxTexture`.
@ -546,6 +591,7 @@ Animation
^^^^^^^^^
- Direct kinematics and inverse kinematics.
- :ref:`Tween <class_Tween>` node to easily perform procedural animations by code.
- Support for animating any property with customizable interpolation.
- Support for calling methods in animation tracks.
- Support for playing sounds in animation tracks.
@ -566,7 +612,7 @@ File formats
- Read and write :ref:`class_JSON` files.
- Read and write INI-style configuration files using :ref:`class_ConfigFile`.
- Can (de)serialize any Godot datatype, including Vector, Color, ...
- Can (de)serialize any Godot datatype, including Vector2/3, Color, ...
- Read XML files using :ref:`class_XMLParser`.
- Pack game data into a PCK file (custom format optimized for fast seeking),
@ -579,10 +625,10 @@ Miscellaneous
- :ref:`Low-level access to servers <doc_using_servers>` which allows bypassing
the scene tree's overhead when needed.
- Command line interface for automation.
- :ref:`Command line interface <doc_command_line_tutorial>` for automation.
- Export and deploy projects using continuous integration platforms.
- `Completion scripts <https://github.com/godotengine/godot/tree/master/misc/dist/shell>`__
- `Shell completion scripts <https://github.com/godotengine/godot/tree/master/misc/dist/shell>`__
are available for Bash, zsh and fish.
- Support for :ref:`C++ modules <doc_custom_modules_in_c++>` statically linked

149
about/release_policy.rst Normal file
View File

@ -0,0 +1,149 @@
.. _doc_release_policy:
Godot release policy
====================
Godot's release policy is in constant evolution. What is described below is
intended to give a general idea of what to expect, but what will actually
happen depends on the choices of core contributors, and the needs of the
community at a given time.
Godot versioning
----------------
Godot loosely follows `Semantic Versioning <https://semver.org/>`__ with a
``major.minor.patch`` versioning system, albeit with an interpretation of each
term adapted to the complexity of a game engine:
- The ``major`` version is incremented when major compatibility breakages happen
which imply significant porting work to move projects from one major version
to another.
For example, porting Godot projects from Godot 2.1 to Godot 3.0 required
running the project through a conversion tool, and then performing a number
of further adjustments manually for what the tool could not do automatically.
- The ``minor`` version is incremented for feature releases which do not break
compatibility in a major way. Minor compatibility breakage in very specific
areas *may* happen in minor versions, but the vast majority of projects
should not be affected or require significant porting work.
The reason for this is that as a game engine, Godot covers many areas such
as rendering, physics, scripting, etc., and fixing bugs or implementing new
features in a given area may sometimes require changing the behavior of a
feature, or modifying the interface of a given class, even if the rest of
the engine API remains backwards compatible.
.. tip::
Upgrading to a new minor version is therefore recommended for all users,
but some testing is necessary to ensure that your project still behaves as
expected in a new minor version.
- The ``patch`` version is incremented for maintenance releases which focus on
fixing bugs and security issues, implementing new requirements for platform
support, and backporting safe usability enhancements. Patch releases are
backwards compatible.
Patch versions may include minor new features which do not impact the
existing API, and thus have no risk of impacting existing projects.
.. tip::
Updating to new patch versions is therefore considered safe and strongly
recommended to all users of a given stable branch.
We call ``major.minor`` combinations *stable branches*. Each stable branch
starts with a ``major.minor`` release (without the ``0`` for ``patch``) and is
further developed for maintenance releases in a Git branch of the same name
(for example patch updates for the 3.3 stable branch are developed in the
``3.3`` Git branch).
.. note::
As mentioned in the introduction, Godot's release policy is evolving, and
earlier Godot releases may not have followed the above rules to the letter.
In particular, the 3.2 stable branch received a number of new features in
3.2.2 which would have warranted a ``minor`` version increment.
Release support timeline
------------------------
Stable branches are supported *at minimum* until the next stable branch is
released and has received its first patch update. In practice, we support
stable branches on a *best effort* basis for as long as they have active users
who need maintenance updates.
Whenever a new major version is released, we make the previous stable branch a
long-term supported release, and do our best to provide fixes for issues
encountered by users of that branch who cannot port complex projects to the new
major version. This was the case for the 2.1 branch, and will be the case for
the latest 3.x stable branch by the time Godot 4.0 is released.
In a given minor release series, only the latest patch release receives support.
If you experience an issue using an older patch release, please upgrade to the
latest patch release of that series and test again before reporting an issue
on GitHub.
+-------------+----------------------+--------------------------------------------------------------------------+
| **Version** | **Release date** | **Support level** |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 4.0 | Q4 2022 | |unstable| *Alpha.* Current focus of development (unstable). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.6 | Q4 2022 | |supported| *Beta.* Receives new features as well as bug fixes while |
| | | under development. |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.5 | August 2022 | |supported| Receives fixes for bugs, security and platform support |
| | | issues, as well as backwards-compatible usability enhancements. |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.4 | November 2021 | |partial| Receives fixes for security and platform support issues only. |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.3 | April 2021 | |eol| No longer supported as fully superseded by the compatible 3.4 |
| | | release (last update: 3.3.4). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.2 | January 2020 | |eol| No longer supported (last update: 3.2.3). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.1 | March 2019 | |eol| No longer supported (last update: 3.1.2). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 3.0 | January 2018 | |eol| No longer supported (last update: 3.0.6). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 2.1 | July 2016 | |eol| No longer supported (last update: 2.1.6). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 2.0 | February 2016 | |eol| No longer supported (last update: 2.0.4.1). |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 1.1 | May 2015 | |eol| No longer supported. |
+-------------+----------------------+--------------------------------------------------------------------------+
| Godot 1.0 | December 2014 | |eol| No longer supported. |
+-------------+----------------------+--------------------------------------------------------------------------+
.. |supported| image:: img/supported.png
.. |partial| image:: img/partial.png
.. |eol| image:: img/eol.png
.. |unstable| image:: img/unstable.png
**Legend:**
|supported| Full support
|partial| Partial support
|eol| No support (end of life)
|unstable| Development version
Pre-release Godot versions aren't intended to be used in production and are
provided for testing purposes only.
.. _doc_release_policy_when_is_next_release_out:
When is the next release out?
-----------------------------
While Godot contributors aren't working under any deadlines, we strive to
publish minor releases relatively frequently, with an average of two 3.x minor
releases per year since Godot 3.3.
Maintenance (patch) releases are released as needed with potentially very
short development cycles, to provide users of the current stable branch with
the latest bug fixes for their production needs.
As for the upcoming Godot 4.0, as of August 2022, we are aiming for a *beta*
release in Q3 2022, and possibly a stable release by Q4 2022 (but experience
has shown time and time again that such estimates tend to be overly optimistic).
`Follow the Godot blog <https://godotengine.org/news>`__ for the latest updates.

1692
classes/class_@gdscript.rst Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

340
classes/class_aabb.rst Normal file
View File

@ -0,0 +1,340 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AABB.xml.
.. _class_AABB:
AABB
====
Axis-Aligned Bounding Box.
Description
-----------
``AABB`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
It uses floating-point coordinates. The 2D counterpart to ``AABB`` is :ref:`Rect2<class_Rect2>`.
\ **Note:** Unlike :ref:`Rect2<class_Rect2>`, ``AABB`` does not have a variant that uses integer coordinates.
Tutorials
---------
- :doc:`Math tutorial index <../tutorials/math/index>`
- :doc:`Vector math <../tutorials/math/vector_math>`
- :doc:`Advanced vector math <../tutorials/math/vectors_advanced>`
Properties
----------
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`end<class_AABB_property_end>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`position<class_AABB_property_position>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_AABB_property_size>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
Methods
-------
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_method_AABB>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`abs<class_AABB_method_abs>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`encloses<class_AABB_method_encloses>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`expand<class_AABB_method_expand>` **(** :ref:`Vector3<class_Vector3>` to_point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_area<class_AABB_method_get_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_center<class_AABB_method_get_center>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_endpoint<class_AABB_method_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_longest_axis<class_AABB_method_get_longest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_AABB_method_get_longest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_AABB_method_get_longest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_AABB_method_get_shortest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>` **(** :ref:`Vector3<class_Vector3>` dir **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`grow<class_AABB_method_grow>` **(** :ref:`float<class_float>` by **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_area<class_AABB_method_has_no_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_surface<class_AABB_method_has_no_surface>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AABB_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`intersection<class_AABB_method_intersection>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects<class_AABB_method_intersects>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_plane<class_AABB_method_intersects_plane>` **(** :ref:`Plane<class_Plane>` plane **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_segment<class_AABB_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` **(** :ref:`AABB<class_AABB>` aabb **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`merge<class_AABB_method_merge>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AABB_property_end:
- :ref:`Vector3<class_Vector3>` **end**
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
Ending corner. This is calculated as ``position + size``. Setting this value will change the size.
----
.. _class_AABB_property_position:
- :ref:`Vector3<class_Vector3>` **position**
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
Beginning corner. Typically has values lower than :ref:`end<class_AABB_property_end>`.
----
.. _class_AABB_property_size:
- :ref:`Vector3<class_Vector3>` **size**
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
Size from :ref:`position<class_AABB_property_position>` to :ref:`end<class_AABB_property_end>`. Typically, all components are positive.
If the size is negative, you can use :ref:`abs<class_AABB_method_abs>` to fix it.
Method Descriptions
-------------------
.. _class_AABB_method_AABB:
- :ref:`AABB<class_AABB>` **AABB** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)**
Constructs an ``AABB`` from a position and size.
----
.. _class_AABB_method_abs:
- :ref:`AABB<class_AABB>` **abs** **(** **)**
Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
----
.. _class_AABB_method_encloses:
- :ref:`bool<class_bool>` **encloses** **(** :ref:`AABB<class_AABB>` with **)**
Returns ``true`` if this ``AABB`` completely encloses another one.
----
.. _class_AABB_method_expand:
- :ref:`AABB<class_AABB>` **expand** **(** :ref:`Vector3<class_Vector3>` to_point **)**
Returns a copy of this ``AABB`` expanded to include a given point.
\ **Example:**\
::
# position (-3, 2, 0), size (1, 1, 1)
var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1))
# position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2)
var box2 = box.expand(Vector3(0, -1, 2))
----
.. _class_AABB_method_get_area:
- :ref:`float<class_float>` **get_area** **(** **)**
Returns the volume of the ``AABB``.
----
.. _class_AABB_method_get_center:
- :ref:`Vector3<class_Vector3>` **get_center** **(** **)**
Returns the center of the ``AABB``, which is equal to :ref:`position<class_AABB_property_position>` + (:ref:`size<class_AABB_property_size>` / 2).
----
.. _class_AABB_method_get_endpoint:
- :ref:`Vector3<class_Vector3>` **get_endpoint** **(** :ref:`int<class_int>` idx **)**
Gets the position of the 8 endpoints of the ``AABB`` in space.
----
.. _class_AABB_method_get_longest_axis:
- :ref:`Vector3<class_Vector3>` **get_longest_axis** **(** **)**
Returns the normalized longest axis of the ``AABB``.
----
.. _class_AABB_method_get_longest_axis_index:
- :ref:`int<class_int>` **get_longest_axis_index** **(** **)**
Returns the index of the longest axis of the ``AABB`` (according to :ref:`Vector3<class_Vector3>`'s ``AXIS_*`` constants).
----
.. _class_AABB_method_get_longest_axis_size:
- :ref:`float<class_float>` **get_longest_axis_size** **(** **)**
Returns the scalar length of the longest axis of the ``AABB``.
----
.. _class_AABB_method_get_shortest_axis:
- :ref:`Vector3<class_Vector3>` **get_shortest_axis** **(** **)**
Returns the normalized shortest axis of the ``AABB``.
----
.. _class_AABB_method_get_shortest_axis_index:
- :ref:`int<class_int>` **get_shortest_axis_index** **(** **)**
Returns the index of the shortest axis of the ``AABB`` (according to :ref:`Vector3<class_Vector3>`::AXIS\* enum).
----
.. _class_AABB_method_get_shortest_axis_size:
- :ref:`float<class_float>` **get_shortest_axis_size** **(** **)**
Returns the scalar length of the shortest axis of the ``AABB``.
----
.. _class_AABB_method_get_support:
- :ref:`Vector3<class_Vector3>` **get_support** **(** :ref:`Vector3<class_Vector3>` dir **)**
Returns the support point in a given direction. This is useful for collision detection algorithms.
----
.. _class_AABB_method_grow:
- :ref:`AABB<class_AABB>` **grow** **(** :ref:`float<class_float>` by **)**
Returns a copy of the ``AABB`` grown a given amount of units towards all the sides.
----
.. _class_AABB_method_has_no_area:
- :ref:`bool<class_bool>` **has_no_area** **(** **)**
Returns ``true`` if the ``AABB`` is flat or empty.
----
.. _class_AABB_method_has_no_surface:
- :ref:`bool<class_bool>` **has_no_surface** **(** **)**
Returns ``true`` if the ``AABB`` is empty.
----
.. _class_AABB_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point **)**
Returns ``true`` if the ``AABB`` contains a point.
----
.. _class_AABB_method_intersection:
- :ref:`AABB<class_AABB>` **intersection** **(** :ref:`AABB<class_AABB>` with **)**
Returns the intersection between two ``AABB``. An empty AABB (size 0,0,0) is returned on failure.
----
.. _class_AABB_method_intersects:
- :ref:`bool<class_bool>` **intersects** **(** :ref:`AABB<class_AABB>` with **)**
Returns ``true`` if the ``AABB`` overlaps with another.
----
.. _class_AABB_method_intersects_plane:
- :ref:`bool<class_bool>` **intersects_plane** **(** :ref:`Plane<class_Plane>` plane **)**
Returns ``true`` if the ``AABB`` is on both sides of a plane.
----
.. _class_AABB_method_intersects_segment:
- :ref:`bool<class_bool>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)**
Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` and ``to``.
----
.. _class_AABB_method_is_equal_approx:
- :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`AABB<class_AABB>` aabb **)**
Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GDScript.is_equal_approx<class_@GDScript_method_is_equal_approx>` on each component.
----
.. _class_AABB_method_merge:
- :ref:`AABB<class_AABB>` **merge** **(** :ref:`AABB<class_AABB>` with **)**
Returns a larger ``AABB`` that contains both this ``AABB`` and ``with``.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,183 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AcceptDialog.xml.
.. _class_AcceptDialog:
AcceptDialog
============
**Inherits:** :ref:`WindowDialog<class_WindowDialog>` **<** :ref:`Popup<class_Popup>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`ConfirmationDialog<class_ConfirmationDialog>`
Base dialog for user notification.
Description
-----------
This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result.
Properties
----------
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_autowrap<class_AcceptDialog_property_dialog_autowrap>` | ``false`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_hide_on_ok<class_AcceptDialog_property_dialog_hide_on_ok>` | ``true`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`dialog_text<class_AcceptDialog_property_dialog_text>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | window_title | ``"Alert!"`` (overrides :ref:`WindowDialog<class_WindowDialog_property_window_title>`) |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
Methods
-------
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_button<class_AcceptDialog_method_add_button>` **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`get_ok<class_AcceptDialog_method_get_ok>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Node<class_Node>` line_edit **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_button<class_AcceptDialog_method_remove_button>` **(** :ref:`Control<class_Control>` button **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AcceptDialog_signal_confirmed:
- **confirmed** **(** **)**
Emitted when the dialog is accepted, i.e. the OK button is pressed.
----
.. _class_AcceptDialog_signal_custom_action:
- **custom_action** **(** :ref:`String<class_String>` action **)**
Emitted when a custom button is pressed. See :ref:`add_button<class_AcceptDialog_method_add_button>`.
Property Descriptions
---------------------
.. _class_AcceptDialog_property_dialog_autowrap:
- :ref:`bool<class_bool>` **dialog_autowrap**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_autowrap(value) |
+-----------+---------------------+
| *Getter* | has_autowrap() |
+-----------+---------------------+
Sets autowrapping for the text in the dialog.
----
.. _class_AcceptDialog_property_dialog_hide_on_ok:
- :ref:`bool<class_bool>` **dialog_hide_on_ok**
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_hide_on_ok(value) |
+-----------+-----------------------+
| *Getter* | get_hide_on_ok() |
+-----------+-----------------------+
If ``true``, the dialog is hidden when the OK button is pressed. You can set it to ``false`` if you want to do e.g. input validation when receiving the :ref:`confirmed<class_AcceptDialog_signal_confirmed>` signal, and handle hiding the dialog in your own logic.
\ **Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example :ref:`FileDialog<class_FileDialog>` defaults to ``false``, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in :ref:`FileDialog<class_FileDialog>` to disable hiding the dialog when pressing OK.
----
.. _class_AcceptDialog_property_dialog_text:
- :ref:`String<class_String>` **dialog_text**
+-----------+-----------------+
| *Default* | ``""`` |
+-----------+-----------------+
| *Setter* | set_text(value) |
+-----------+-----------------+
| *Getter* | get_text() |
+-----------+-----------------+
The text displayed by the dialog.
Method Descriptions
-------------------
.. _class_AcceptDialog_method_add_button:
- :ref:`Button<class_Button>` **add_button** **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)**
Adds a button with label ``text`` and a custom ``action`` to the dialog and returns the created button. ``action`` will be passed to the :ref:`custom_action<class_AcceptDialog_signal_custom_action>` signal when pressed.
If ``true``, ``right`` will place the button to the right of any sibling buttons.
You can use :ref:`remove_button<class_AcceptDialog_method_remove_button>` method to remove a button created with this method from the dialog.
----
.. _class_AcceptDialog_method_add_cancel:
- :ref:`Button<class_Button>` **add_cancel** **(** :ref:`String<class_String>` name **)**
Adds a button with label ``name`` and a cancel action to the dialog and returns the created button.
You can use :ref:`remove_button<class_AcceptDialog_method_remove_button>` method to remove a button created with this method from the dialog.
----
.. _class_AcceptDialog_method_get_label:
- :ref:`Label<class_Label>` **get_label** **(** **)**
Returns the label used for built-in text.
\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
----
.. _class_AcceptDialog_method_get_ok:
- :ref:`Button<class_Button>` **get_ok** **(** **)**
Returns the OK :ref:`Button<class_Button>` instance.
\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
----
.. _class_AcceptDialog_method_register_text_enter:
- void **register_text_enter** **(** :ref:`Node<class_Node>` line_edit **)**
Registers a :ref:`LineEdit<class_LineEdit>` in the dialog. When the enter key is pressed, the dialog will be accepted.
----
.. _class_AcceptDialog_method_remove_button:
- void **remove_button** **(** :ref:`Control<class_Control>` button **)**
Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button<class_Button>` added with :ref:`add_button<class_AcceptDialog_method_add_button>` or :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action<class_AcceptDialog_signal_custom_action>` signal or cancel this dialog.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,133 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AESContext.xml.
.. _class_AESContext:
AESContext
==========
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Interface to low level AES encryption features.
Description
-----------
This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported.
::
extends Node
var aes = AESContext.new()
func _ready():
var key = "My secret key!!!" # Key must be either 16 or 32 bytes.
var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed.
# Encrypt ECB
aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8())
var encrypted = aes.update(data.to_utf8())
aes.finish()
# Decrypt ECB
aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8())
var decrypted = aes.update(encrypted)
aes.finish()
# Check ECB
assert(decrypted == data.to_utf8())
var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes.
# Encrypt CBC
aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8())
encrypted = aes.update(data.to_utf8())
aes.finish()
# Decrypt CBC
aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8())
decrypted = aes.update(encrypted)
aes.finish()
# Check CBC
assert(decrypted == data.to_utf8())
Methods
-------
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`finish<class_AESContext_method_finish>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`get_iv_state<class_AESContext_method_get_iv_state>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`start<class_AESContext_method_start>` **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`update<class_AESContext_method_update>` **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_AESContext_Mode:
.. _class_AESContext_constant_MODE_ECB_ENCRYPT:
.. _class_AESContext_constant_MODE_ECB_DECRYPT:
.. _class_AESContext_constant_MODE_CBC_ENCRYPT:
.. _class_AESContext_constant_MODE_CBC_DECRYPT:
.. _class_AESContext_constant_MODE_MAX:
enum **Mode**:
- **MODE_ECB_ENCRYPT** = **0** --- AES electronic codebook encryption mode.
- **MODE_ECB_DECRYPT** = **1** --- AES electronic codebook decryption mode.
- **MODE_CBC_ENCRYPT** = **2** --- AES cipher blocker chaining encryption mode.
- **MODE_CBC_DECRYPT** = **3** --- AES cipher blocker chaining decryption mode.
- **MODE_MAX** = **4** --- Maximum value for the mode enum.
Method Descriptions
-------------------
.. _class_AESContext_method_finish:
- void **finish** **(** **)**
Close this AES context so it can be started again. See :ref:`start<class_AESContext_method_start>`.
----
.. _class_AESContext_method_get_iv_state:
- :ref:`PoolByteArray<class_PoolByteArray>` **get_iv_state** **(** **)**
Get the current IV state for this context (IV gets updated when calling :ref:`update<class_AESContext_method_update>`). You normally don't need this function.
\ **Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT<class_AESContext_constant_MODE_CBC_ENCRYPT>` or :ref:`MODE_CBC_DECRYPT<class_AESContext_constant_MODE_CBC_DECRYPT>`.
----
.. _class_AESContext_method_start:
- :ref:`Error<enum_@GlobalScope_Error>` **start** **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)**
Start the AES context in the given ``mode``. A ``key`` of either 16 or 32 bytes must always be provided, while an ``iv`` (initialization vector) of exactly 16 bytes, is only needed when ``mode`` is either :ref:`MODE_CBC_ENCRYPT<class_AESContext_constant_MODE_CBC_ENCRYPT>` or :ref:`MODE_CBC_DECRYPT<class_AESContext_constant_MODE_CBC_DECRYPT>`.
----
.. _class_AESContext_method_update:
- :ref:`PoolByteArray<class_PoolByteArray>` **update** **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)**
Run the desired operation for this AES context. Will return a :ref:`PoolByteArray<class_PoolByteArray>` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start<class_AESContext_method_start>` for mode of operation.
\ **Note:** The size of ``src`` must be a multiple of 16. Apply some padding if needed.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,242 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimatedSprite.xml.
.. _class_AnimatedSprite:
AnimatedSprite
==============
**Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Sprite node that contains multiple textures as frames to play for animation.
Description
-----------
``AnimatedSprite`` is similar to the :ref:`Sprite<class_Sprite>` node, except it carries multiple textures as animation frames. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames<class_SpriteFrames>` resource can be configured in the editor via the SpriteFrames bottom panel.
\ **Note:** You can associate a set of normal or specular maps by creating additional :ref:`SpriteFrames<class_SpriteFrames>` resources with a ``_normal`` or ``_specular`` suffix. For example, having 3 :ref:`SpriteFrames<class_SpriteFrames>` resources ``run``, ``run_normal``, and ``run_specular`` will make it so the ``run`` animation uses normal and specular maps.
Tutorials
---------
- :doc:`2D Sprite animation <../tutorials/2d/2d_sprite_animation>`
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
Properties
----------
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite_property_animation>` | ``"default"`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`centered<class_AnimatedSprite_property_centered>` | ``true`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_h<class_AnimatedSprite_property_flip_h>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_v<class_AnimatedSprite_property_flip_v>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite_property_frame>` | ``0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite_property_frames>` | |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AnimatedSprite_property_offset>` | ``Vector2( 0, 0 )`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite_property_playing>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite_property_speed_scale>` | ``1.0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
Methods
-------
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite_method_play>` **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite_method_stop>` **(** **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AnimatedSprite_signal_animation_finished:
- **animation_finished** **(** **)**
Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
----
.. _class_AnimatedSprite_signal_frame_changed:
- **frame_changed** **(** **)**
Emitted when :ref:`frame<class_AnimatedSprite_property_frame>` changed.
Property Descriptions
---------------------
.. _class_AnimatedSprite_property_animation:
- :ref:`String<class_String>` **animation**
+-----------+----------------------+
| *Default* | ``"default"`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
The current animation from the :ref:`frames<class_AnimatedSprite_property_frames>` resource. If this value changes, the ``frame`` counter is reset.
----
.. _class_AnimatedSprite_property_centered:
- :ref:`bool<class_bool>` **centered**
+-----------+---------------------+
| *Default* | ``true`` |
+-----------+---------------------+
| *Setter* | set_centered(value) |
+-----------+---------------------+
| *Getter* | is_centered() |
+-----------+---------------------+
If ``true``, texture will be centered.
----
.. _class_AnimatedSprite_property_flip_h:
- :ref:`bool<class_bool>` **flip_h**
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_flip_h(value) |
+-----------+-------------------+
| *Getter* | is_flipped_h() |
+-----------+-------------------+
If ``true``, texture is flipped horizontally.
----
.. _class_AnimatedSprite_property_flip_v:
- :ref:`bool<class_bool>` **flip_v**
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_flip_v(value) |
+-----------+-------------------+
| *Getter* | is_flipped_v() |
+-----------+-------------------+
If ``true``, texture is flipped vertically.
----
.. _class_AnimatedSprite_property_frame:
- :ref:`int<class_int>` **frame**
+-----------+------------------+
| *Default* | ``0`` |
+-----------+------------------+
| *Setter* | set_frame(value) |
+-----------+------------------+
| *Getter* | get_frame() |
+-----------+------------------+
The displayed animation frame's index.
----
.. _class_AnimatedSprite_property_frames:
- :ref:`SpriteFrames<class_SpriteFrames>` **frames**
+----------+--------------------------+
| *Setter* | set_sprite_frames(value) |
+----------+--------------------------+
| *Getter* | get_sprite_frames() |
+----------+--------------------------+
The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames<class_SpriteFrames>` resource.
----
.. _class_AnimatedSprite_property_offset:
- :ref:`Vector2<class_Vector2>` **offset**
+-----------+---------------------+
| *Default* | ``Vector2( 0, 0 )`` |
+-----------+---------------------+
| *Setter* | set_offset(value) |
+-----------+---------------------+
| *Getter* | get_offset() |
+-----------+---------------------+
The texture's drawing offset.
----
.. _class_AnimatedSprite_property_playing:
- :ref:`bool<class_bool>` **playing**
+-----------+--------------------+
| *Default* | ``false`` |
+-----------+--------------------+
| *Setter* | set_playing(value) |
+-----------+--------------------+
| *Getter* | is_playing() |
+-----------+--------------------+
If ``true``, the :ref:`animation<class_AnimatedSprite_property_animation>` is currently playing.
----
.. _class_AnimatedSprite_property_speed_scale:
- :ref:`float<class_float>` **speed_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_speed_scale(value) |
+-----------+------------------------+
| *Getter* | get_speed_scale() |
+-----------+------------------------+
The animation speed is multiplied by this value.
Method Descriptions
-------------------
.. _class_AnimatedSprite_method_play:
- void **play** **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)**
Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. If ``backwards`` is ``true``, the animation will be played in reverse.
----
.. _class_AnimatedSprite_method_stop:
- void **stop** **(** **)**
Stops the current animation (does not reset the frame counter).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,154 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimatedSprite3D.xml.
.. _class_AnimatedSprite3D:
AnimatedSprite3D
================
**Inherits:** :ref:`SpriteBase3D<class_SpriteBase3D>` **<** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
2D sprite node in 3D world, that can use multiple 2D textures for animation.
Description
-----------
Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
Tutorials
---------
- :doc:`2D Sprite animation (also applies to 3D) <../tutorials/2d/2d_sprite_animation>`
Properties
----------
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
Methods
-------
+-------------------------+-------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AnimatedSprite3D_signal_animation_finished:
- **animation_finished** **(** **)**
Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
----
.. _class_AnimatedSprite3D_signal_frame_changed:
- **frame_changed** **(** **)**
Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
Property Descriptions
---------------------
.. _class_AnimatedSprite3D_property_animation:
- :ref:`String<class_String>` **animation**
+-----------+----------------------+
| *Default* | ``"default"`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
----
.. _class_AnimatedSprite3D_property_frame:
- :ref:`int<class_int>` **frame**
+-----------+------------------+
| *Default* | ``0`` |
+-----------+------------------+
| *Setter* | set_frame(value) |
+-----------+------------------+
| *Getter* | get_frame() |
+-----------+------------------+
The displayed animation frame's index.
----
.. _class_AnimatedSprite3D_property_frames:
- :ref:`SpriteFrames<class_SpriteFrames>` **frames**
+----------+--------------------------+
| *Setter* | set_sprite_frames(value) |
+----------+--------------------------+
| *Getter* | get_sprite_frames() |
+----------+--------------------------+
The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
----
.. _class_AnimatedSprite3D_property_playing:
- :ref:`bool<class_bool>` **playing**
+-----------+-----------+
| *Default* | ``false`` |
+-----------+-----------+
If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
Method Descriptions
-------------------
.. _class_AnimatedSprite3D_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if an animation is currently being played.
----
.. _class_AnimatedSprite3D_method_play:
- void **play** **(** :ref:`String<class_String>` anim="" **)**
Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
----
.. _class_AnimatedSprite3D_method_stop:
- void **stop** **(** **)**
Stops the current animation (does not reset the frame counter).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,192 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimatedTexture.xml.
.. _class_AnimatedTexture:
AnimatedTexture
===============
**Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Proxy texture for simple frame-based animations.
Description
-----------
``AnimatedTexture`` is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture<class_Texture>` resource can be used, e.g. in a :ref:`TileSet<class_TileSet>`.
The playback of the animation is controlled by the :ref:`fps<class_AnimatedTexture_property_fps>` property as well as each frame's optional delay (see :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>`). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame.
\ ``AnimatedTexture`` currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
\ **Note:** AnimatedTexture doesn't support using :ref:`AtlasTexture<class_AtlasTexture>`\ s. Each frame needs to be a separate :ref:`Texture<class_Texture>`.
Properties
----------
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`current_frame<class_AnimatedTexture_property_current_frame>` | |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`fps<class_AnimatedTexture_property_fps>` | ``4.0`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`frames<class_AnimatedTexture_property_frames>` | ``1`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`oneshot<class_AnimatedTexture_property_oneshot>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`pause<class_AnimatedTexture_property_pause>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
Methods
-------
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_frame_delay<class_AnimatedTexture_method_get_frame_delay>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`get_frame_texture<class_AnimatedTexture_method_get_frame_texture>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>` **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>` **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
Constants
---------
.. _class_AnimatedTexture_constant_MAX_FRAMES:
- **MAX_FRAMES** = **256** --- The maximum number of frames supported by ``AnimatedTexture``. If you need more frames in your animation, use :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`.
Property Descriptions
---------------------
.. _class_AnimatedTexture_property_current_frame:
- :ref:`int<class_int>` **current_frame**
+----------+--------------------------+
| *Setter* | set_current_frame(value) |
+----------+--------------------------+
| *Getter* | get_current_frame() |
+----------+--------------------------+
Sets the currently visible frame of the texture.
----
.. _class_AnimatedTexture_property_fps:
- :ref:`float<class_float>` **fps**
+-----------+----------------+
| *Default* | ``4.0`` |
+-----------+----------------+
| *Setter* | set_fps(value) |
+-----------+----------------+
| *Getter* | get_fps() |
+-----------+----------------+
Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the :ref:`frames<class_AnimatedTexture_property_frames>` property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>`).
For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds.
----
.. _class_AnimatedTexture_property_frames:
- :ref:`int<class_int>` **frames**
+-----------+-------------------+
| *Default* | ``1`` |
+-----------+-------------------+
| *Setter* | set_frames(value) |
+-----------+-------------------+
| *Getter* | get_frames() |
+-----------+-------------------+
Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>`.
----
.. _class_AnimatedTexture_property_oneshot:
- :ref:`bool<class_bool>` **oneshot**
+-----------+--------------------+
| *Default* | ``false`` |
+-----------+--------------------+
| *Setter* | set_oneshot(value) |
+-----------+--------------------+
| *Getter* | get_oneshot() |
+-----------+--------------------+
If ``true``, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set :ref:`pause<class_AnimatedTexture_property_pause>` to ``true``.
----
.. _class_AnimatedTexture_property_pause:
- :ref:`bool<class_bool>` **pause**
+-----------+------------------+
| *Default* | ``false`` |
+-----------+------------------+
| *Setter* | set_pause(value) |
+-----------+------------------+
| *Getter* | get_pause() |
+-----------+------------------+
If ``true``, the animation will pause where it currently is (i.e. at :ref:`current_frame<class_AnimatedTexture_property_current_frame>`). The animation will continue from where it was paused when changing this property to ``false``.
Method Descriptions
-------------------
.. _class_AnimatedTexture_method_get_frame_delay:
- :ref:`float<class_float>` **get_frame_delay** **(** :ref:`int<class_int>` frame **)** |const|
Returns the given frame's delay value.
----
.. _class_AnimatedTexture_method_get_frame_texture:
- :ref:`Texture<class_Texture>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** |const|
Returns the given frame's :ref:`Texture<class_Texture>`.
----
.. _class_AnimatedTexture_method_set_frame_delay:
- void **set_frame_delay** **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)**
Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by :ref:`fps<class_AnimatedTexture_property_fps>`. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be ``1.0 / fps + delay``.
For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be:
::
Frame 0: 0.5 s (1 / fps)
Frame 1: 1.7 s (1 / fps + 1.2)
Frame 2: 0.5 s (1 / fps)
Total duration: 2.7 s
----
.. _class_AnimatedTexture_method_set_frame_texture:
- void **set_frame_texture** **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)**
Assigns a :ref:`Texture<class_Texture>` to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID :ref:`frames<class_AnimatedTexture_property_frames>` - 1.
You can define any number of textures up to :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>`, but keep in mind that only frames from 0 to :ref:`frames<class_AnimatedTexture_property_frames>` - 1 will be part of the animation.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

789
classes/class_animation.rst Normal file
View File

@ -0,0 +1,789 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/Animation.xml.
.. _class_Animation:
Animation
=========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Contains data used to animate everything in the engine.
Description
-----------
An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
::
# This creates an animation that makes the node "Enemy" move to the right by
# 100 pixels in 0.5 seconds.
var animation = Animation.new()
var track_index = animation.add_track(Animation.TYPE_VALUE)
animation.track_set_path(track_index, "Enemy:position:x")
animation.track_insert_key(track_index, 0.0, 0)
animation.track_insert_key(track_index, 0.5, 100)
Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimationTreePlayer<class_AnimationTreePlayer>` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType<enum_Animation_TrackType>` to see available types.
Tutorials
---------
- :doc:`../tutorials/animation/index`
Properties
----------
+---------------------------+------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
+---------------------------+------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`loop<class_Animation_property_loop>` | ``false`` |
+---------------------------+------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.1`` |
+---------------------------+------------------------------------------------+-----------+
Methods
-------
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`add_track<class_Animation_method_add_track>` **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`animation_track_get_key_animation<class_Animation_method_animation_track_get_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`animation_track_insert_key<class_Animation_method_animation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`String<class_String>` animation **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_track_set_key_animation<class_Animation_method_animation_track_set_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`String<class_String>` animation **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`audio_track_get_key_end_offset<class_Animation_method_audio_track_get_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`audio_track_get_key_start_offset<class_Animation_method_audio_track_get_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Resource<class_Resource>` | :ref:`audio_track_get_key_stream<class_Animation_method_audio_track_get_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`audio_track_insert_key<class_Animation_method_audio_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`audio_track_set_key_end_offset<class_Animation_method_audio_track_set_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`audio_track_set_key_start_offset<class_Animation_method_audio_track_set_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`audio_track_set_key_stream<class_Animation_method_audio_track_set_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_in_handle<class_Animation_method_bezier_track_get_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_out_handle<class_Animation_method_bezier_track_get_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`bezier_track_get_key_value<class_Animation_method_bezier_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bezier_track_insert_key<class_Animation_method_bezier_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` out_handle=Vector2( 0, 0 ) **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`bezier_track_interpolate<class_Animation_method_bezier_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`bezier_track_set_key_in_handle<class_Animation_method_bezier_track_set_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`bezier_track_set_key_out_handle<class_Animation_method_bezier_track_set_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`bezier_track_set_key_value<class_Animation_method_bezier_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_Animation_method_clear>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`copy_track<class_Animation_method_copy_track>` **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_track<class_Animation_method_find_track>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_track_count<class_Animation_method_get_track_count>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`method_track_get_key_indices<class_Animation_method_method_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`method_track_get_name<class_Animation_method_method_track_get_name>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`method_track_get_params<class_Animation_method_method_track_get_params>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_track<class_Animation_method_remove_track>` **(** :ref:`int<class_int>` track_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`track_find_key<class_Animation_method_track_find_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`track_get_interpolation_loop_wrap<class_Animation_method_track_get_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`InterpolationType<enum_Animation_InterpolationType>` | :ref:`track_get_interpolation_type<class_Animation_method_track_get_interpolation_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`track_get_key_count<class_Animation_method_track_get_key_count>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`track_get_key_time<class_Animation_method_track_get_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`track_get_key_transition<class_Animation_method_track_get_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`track_get_key_value<class_Animation_method_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`track_get_path<class_Animation_method_track_get_path>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackType<enum_Animation_TrackType>` | :ref:`track_get_type<class_Animation_method_track_get_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_insert_key<class_Animation_method_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`track_is_enabled<class_Animation_method_track_is_enabled>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`track_is_imported<class_Animation_method_track_is_imported>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_move_down<class_Animation_method_track_move_down>` **(** :ref:`int<class_int>` track_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_move_to<class_Animation_method_track_move_to>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_move_up<class_Animation_method_track_move_up>` **(** :ref:`int<class_int>` track_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_remove_key<class_Animation_method_track_remove_key>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_remove_key_at_position<class_Animation_method_track_remove_key_at_position>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` position **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_enabled<class_Animation_method_track_set_enabled>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_imported<class_Animation_method_track_set_imported>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_interpolation_type<class_Animation_method_track_set_interpolation_type>` **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_key_time<class_Animation_method_track_set_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_key_transition<class_Animation_method_track_set_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_key_value<class_Animation_method_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_set_path<class_Animation_method_track_set_path>` **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`track_swap<class_Animation_method_track_swap>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`transform_track_insert_key<class_Animation_method_transform_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` location, :ref:`Quat<class_Quat>` rotation, :ref:`Vector3<class_Vector3>` scale **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`transform_track_interpolate<class_Animation_method_transform_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`value_track_get_key_indices<class_Animation_method_value_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`UpdateMode<enum_Animation_UpdateMode>` | :ref:`value_track_get_update_mode<class_Animation_method_value_track_get_update_mode>` **(** :ref:`int<class_int>` track_idx **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`value_track_interpolate<class_Animation_method_value_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`value_track_set_update_mode<class_Animation_method_value_track_set_update_mode>` **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_Animation_signal_tracks_changed:
- **tracks_changed** **(** **)**
Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths.
Enumerations
------------
.. _enum_Animation_TrackType:
.. _class_Animation_constant_TYPE_VALUE:
.. _class_Animation_constant_TYPE_TRANSFORM:
.. _class_Animation_constant_TYPE_METHOD:
.. _class_Animation_constant_TYPE_BEZIER:
.. _class_Animation_constant_TYPE_AUDIO:
.. _class_Animation_constant_TYPE_ANIMATION:
enum **TrackType**:
- **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be Interpolated.
- **TYPE_TRANSFORM** = **1** --- Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated.
- **TYPE_METHOD** = **2** --- Method tracks call functions with given arguments per key.
- **TYPE_BEZIER** = **3** --- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color<class_Color>`).
- **TYPE_AUDIO** = **4** --- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. The stream can be trimmed and previewed in the animation.
- **TYPE_ANIMATION** = **5** --- Animation tracks play animations in other :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
----
.. _enum_Animation_InterpolationType:
.. _class_Animation_constant_INTERPOLATION_NEAREST:
.. _class_Animation_constant_INTERPOLATION_LINEAR:
.. _class_Animation_constant_INTERPOLATION_CUBIC:
enum **InterpolationType**:
- **INTERPOLATION_NEAREST** = **0** --- No interpolation (nearest value).
- **INTERPOLATION_LINEAR** = **1** --- Linear interpolation.
- **INTERPOLATION_CUBIC** = **2** --- Cubic interpolation.
----
.. _enum_Animation_UpdateMode:
.. _class_Animation_constant_UPDATE_CONTINUOUS:
.. _class_Animation_constant_UPDATE_DISCRETE:
.. _class_Animation_constant_UPDATE_TRIGGER:
.. _class_Animation_constant_UPDATE_CAPTURE:
enum **UpdateMode**:
- **UPDATE_CONTINUOUS** = **0** --- Update between keyframes.
- **UPDATE_DISCRETE** = **1** --- Update at the keyframes and hold the value.
- **UPDATE_TRIGGER** = **2** --- Update at the keyframes.
- **UPDATE_CAPTURE** = **3** --- Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
Property Descriptions
---------------------
.. _class_Animation_property_length:
- :ref:`float<class_float>` **length**
+-----------+-------------------+
| *Default* | ``1.0`` |
+-----------+-------------------+
| *Setter* | set_length(value) |
+-----------+-------------------+
| *Getter* | get_length() |
+-----------+-------------------+
The total length of the animation (in seconds).
\ **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
----
.. _class_Animation_property_loop:
- :ref:`bool<class_bool>` **loop**
+-----------+-----------------+
| *Default* | ``false`` |
+-----------+-----------------+
| *Setter* | set_loop(value) |
+-----------+-----------------+
| *Getter* | has_loop() |
+-----------+-----------------+
A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
----
.. _class_Animation_property_step:
- :ref:`float<class_float>` **step**
+-----------+-----------------+
| *Default* | ``0.1`` |
+-----------+-----------------+
| *Setter* | set_step(value) |
+-----------+-----------------+
| *Getter* | get_step() |
+-----------+-----------------+
The animation step value.
Method Descriptions
-------------------
.. _class_Animation_method_add_track:
- :ref:`int<class_int>` **add_track** **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)**
Adds a track to the Animation.
----
.. _class_Animation_method_animation_track_get_key_animation:
- :ref:`String<class_String>` **animation_track_get_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track.
----
.. _class_Animation_method_animation_track_insert_key:
- :ref:`int<class_int>` **animation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`String<class_String>` animation **)**
Inserts a key with value ``animation`` at the given ``time`` (in seconds). The ``track_idx`` must be the index of an Animation Track.
----
.. _class_Animation_method_animation_track_set_key_animation:
- void **animation_track_set_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`String<class_String>` animation **)**
Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` must be the index of an Animation Track.
----
.. _class_Animation_method_audio_track_get_key_end_offset:
- :ref:`float<class_float>` **audio_track_get_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
End offset is the number of seconds cut off at the ending of the audio stream.
----
.. _class_Animation_method_audio_track_get_key_start_offset:
- :ref:`float<class_float>` **audio_track_get_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
Start offset is the number of seconds cut off at the beginning of the audio stream.
----
.. _class_Animation_method_audio_track_get_key_stream:
- :ref:`Resource<class_Resource>` **audio_track_get_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
----
.. _class_Animation_method_audio_track_insert_key:
- :ref:`int<class_int>` **audio_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)**
Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track.
\ ``stream`` is the :ref:`AudioStream<class_AudioStream>` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending.
----
.. _class_Animation_method_audio_track_set_key_end_offset:
- void **audio_track_set_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
Sets the end offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
----
.. _class_Animation_method_audio_track_set_key_start_offset:
- void **audio_track_set_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
Sets the start offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
----
.. _class_Animation_method_audio_track_set_key_stream:
- void **audio_track_set_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)**
Sets the stream of the key identified by ``key_idx`` to value ``stream``. The ``track_idx`` must be the index of an Audio Track.
----
.. _class_Animation_method_bezier_track_get_key_in_handle:
- :ref:`Vector2<class_Vector2>` **bezier_track_get_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_get_key_out_handle:
- :ref:`Vector2<class_Vector2>` **bezier_track_get_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_get_key_value:
- :ref:`float<class_float>` **bezier_track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_insert_key:
- :ref:`int<class_int>` **bezier_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2( 0, 0 ), :ref:`Vector2<class_Vector2>` out_handle=Vector2( 0, 0 ) **)**
Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track.
\ ``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point.
----
.. _class_Animation_method_bezier_track_interpolate:
- :ref:`float<class_float>` **bezier_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const|
Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_set_key_in_handle:
- void **bezier_track_set_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle **)**
Sets the in handle of the key identified by ``key_idx`` to value ``in_handle``. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_set_key_out_handle:
- void **bezier_track_set_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle **)**
Sets the out handle of the key identified by ``key_idx`` to value ``out_handle``. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_bezier_track_set_key_value:
- void **bezier_track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)**
Sets the value of the key identified by ``key_idx`` to the given value. The ``track_idx`` must be the index of a Bezier Track.
----
.. _class_Animation_method_clear:
- void **clear** **(** **)**
Clear the animation (clear all tracks and reset all).
----
.. _class_Animation_method_copy_track:
- void **copy_track** **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)**
Adds a new track that is a copy of the given track from ``to_animation``.
----
.. _class_Animation_method_find_track:
- :ref:`int<class_int>` **find_track** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
Returns the index of the specified track. If the track is not found, return -1.
----
.. _class_Animation_method_get_track_count:
- :ref:`int<class_int>` **get_track_count** **(** **)** |const|
Returns the amount of tracks in the animation.
----
.. _class_Animation_method_method_track_get_key_indices:
- :ref:`PoolIntArray<class_PoolIntArray>` **method_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const|
Returns all the key indices of a method track, given a position and delta time.
----
.. _class_Animation_method_method_track_get_name:
- :ref:`String<class_String>` **method_track_get_name** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the method name of a method track.
----
.. _class_Animation_method_method_track_get_params:
- :ref:`Array<class_Array>` **method_track_get_params** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the arguments values to be called on a method track for a given key in a given track.
----
.. _class_Animation_method_remove_track:
- void **remove_track** **(** :ref:`int<class_int>` track_idx **)**
Removes a track by specifying the track index.
----
.. _class_Animation_method_track_find_key:
- :ref:`int<class_int>` **track_find_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const|
Finds the key index by time in a given track. Optionally, only find it if the exact time is given.
----
.. _class_Animation_method_track_get_interpolation_loop_wrap:
- :ref:`bool<class_bool>` **track_get_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns ``true`` if the track at ``idx`` wraps the interpolation loop. New tracks wrap the interpolation loop by default.
----
.. _class_Animation_method_track_get_interpolation_type:
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **track_get_interpolation_type** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns the interpolation type of a given track.
----
.. _class_Animation_method_track_get_key_count:
- :ref:`int<class_int>` **track_get_key_count** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns the amount of keys in a given track.
----
.. _class_Animation_method_track_get_key_time:
- :ref:`float<class_float>` **track_get_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the time at which the key is located.
----
.. _class_Animation_method_track_get_key_transition:
- :ref:`float<class_float>` **track_get_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease<class_@GDScript_method_ease>`).
----
.. _class_Animation_method_track_get_key_value:
- :ref:`Variant<class_Variant>` **track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
Returns the value of a given key in a given track.
----
.. _class_Animation_method_track_get_path:
- :ref:`NodePath<class_NodePath>` **track_get_path** **(** :ref:`int<class_int>` track_idx **)** |const|
Gets the path of a track. For more information on the path format, see :ref:`track_set_path<class_Animation_method_track_set_path>`.
----
.. _class_Animation_method_track_get_type:
- :ref:`TrackType<enum_Animation_TrackType>` **track_get_type** **(** :ref:`int<class_int>` track_idx **)** |const|
Gets the type of a track.
----
.. _class_Animation_method_track_insert_key:
- void **track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)**
Insert a generic key in a given track.
----
.. _class_Animation_method_track_is_enabled:
- :ref:`bool<class_bool>` **track_is_enabled** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns ``true`` if the track at index ``idx`` is enabled.
----
.. _class_Animation_method_track_is_imported:
- :ref:`bool<class_bool>` **track_is_imported** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns ``true`` if the given track is imported. Else, return ``false``.
----
.. _class_Animation_method_track_move_down:
- void **track_move_down** **(** :ref:`int<class_int>` track_idx **)**
Moves a track down.
----
.. _class_Animation_method_track_move_to:
- void **track_move_to** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)**
Changes the index position of track ``idx`` to the one defined in ``to_idx``.
----
.. _class_Animation_method_track_move_up:
- void **track_move_up** **(** :ref:`int<class_int>` track_idx **)**
Moves a track up.
----
.. _class_Animation_method_track_remove_key:
- void **track_remove_key** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)**
Removes a key by index in a given track.
----
.. _class_Animation_method_track_remove_key_at_position:
- void **track_remove_key_at_position** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` position **)**
Removes a key by position (seconds) in a given track.
----
.. _class_Animation_method_track_set_enabled:
- void **track_set_enabled** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)**
Enables/disables the given track. Tracks are enabled by default.
----
.. _class_Animation_method_track_set_imported:
- void **track_set_imported** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)**
Sets the given track as imported or not.
----
.. _class_Animation_method_track_set_interpolation_loop_wrap:
- void **track_set_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)**
If ``true``, the track at ``idx`` wraps the interpolation loop.
----
.. _class_Animation_method_track_set_interpolation_type:
- void **track_set_interpolation_type** **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)**
Sets the interpolation type of a given track.
----
.. _class_Animation_method_track_set_key_time:
- void **track_set_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)**
Sets the time of an existing key.
----
.. _class_Animation_method_track_set_key_transition:
- void **track_set_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)**
Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease<class_@GDScript_method_ease>`).
----
.. _class_Animation_method_track_set_key_value:
- void **track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)**
Sets the value of an existing key.
----
.. _class_Animation_method_track_set_path:
- void **track_set_path** **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)**
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ``":"``.
For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
----
.. _class_Animation_method_track_swap:
- void **track_swap** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)**
Swaps the track ``idx``'s index position with the track ``with_idx``.
----
.. _class_Animation_method_transform_track_insert_key:
- :ref:`int<class_int>` **transform_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` location, :ref:`Quat<class_Quat>` rotation, :ref:`Vector3<class_Vector3>` scale **)**
Insert a transform key for a transform track.
----
.. _class_Animation_method_transform_track_interpolate:
- :ref:`Array<class_Array>` **transform_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const|
Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position (:ref:`Vector3<class_Vector3>`), rotation (:ref:`Quat<class_Quat>`) and scale (:ref:`Vector3<class_Vector3>`).
----
.. _class_Animation_method_value_track_get_key_indices:
- :ref:`PoolIntArray<class_PoolIntArray>` **value_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const|
Returns all the key indices of a value track, given a position and delta time.
----
.. _class_Animation_method_value_track_get_update_mode:
- :ref:`UpdateMode<enum_Animation_UpdateMode>` **value_track_get_update_mode** **(** :ref:`int<class_int>` track_idx **)** |const|
Returns the update mode of a value track.
----
.. _class_Animation_method_value_track_interpolate:
- :ref:`Variant<class_Variant>` **value_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const|
Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track.
----
.. _class_Animation_method_value_track_set_update_mode:
- void **value_track_set_update_mode** **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)**
Sets the update mode (see :ref:`UpdateMode<enum_Animation_UpdateMode>`) of a value track.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,285 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNode.xml.
.. _class_AnimationNode:
AnimationNode
=============
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AnimationNodeAdd2<class_AnimationNodeAdd2>`, :ref:`AnimationNodeAdd3<class_AnimationNodeAdd3>`, :ref:`AnimationNodeBlend2<class_AnimationNodeBlend2>`, :ref:`AnimationNodeBlend3<class_AnimationNodeBlend3>`, :ref:`AnimationNodeOneShot<class_AnimationNodeOneShot>`, :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`, :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`, :ref:`AnimationNodeTimeSeek<class_AnimationNodeTimeSeek>`, :ref:`AnimationNodeTransition<class_AnimationNodeTransition>`, :ref:`AnimationRootNode<class_AnimationRootNode>`
Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes.
Description
-----------
Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas.
Inherit this when creating nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-------------------------+--------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_enabled<class_AnimationNode_property_filter_enabled>` |
+-------------------------+--------------------------------------------------------------------+
Methods
-------
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_input<class_AnimationNode_method_add_input>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend_animation<class_AnimationNode_method_blend_animation>` **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_input<class_AnimationNode_method_blend_input>` **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_method_blend_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_caption<class_AnimationNode_method_get_caption>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_child_by_name<class_AnimationNode_method_get_child_by_name>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_child_nodes<class_AnimationNode_method_get_child_nodes>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_input_count<class_AnimationNode_method_get_input_count>` **(** **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_name<class_AnimationNode_method_get_input_name>` **(** :ref:`int<class_int>` input **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter<class_AnimationNode_method_get_parameter>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter_default_value<class_AnimationNode_method_get_parameter_default_value>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_parameter_list<class_AnimationNode_method_get_parameter_list>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_filter<class_AnimationNode_method_has_filter>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_method_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`process<class_AnimationNode_method_process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_input<class_AnimationNode_method_remove_input>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_filter_path<class_AnimationNode_method_set_filter_path>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_parameter<class_AnimationNode_method_set_parameter>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AnimationNode_signal_removed_from_graph:
- **removed_from_graph** **(** **)**
Emitted when the node was removed from the graph.
----
.. _class_AnimationNode_signal_tree_changed:
- **tree_changed** **(** **)**
Emitted by nodes that inherit from this class and that have an internal tree when one of their nodes changes. The nodes that emit this signal are :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`, and :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Enumerations
------------
.. _enum_AnimationNode_FilterAction:
.. _class_AnimationNode_constant_FILTER_IGNORE:
.. _class_AnimationNode_constant_FILTER_PASS:
.. _class_AnimationNode_constant_FILTER_STOP:
.. _class_AnimationNode_constant_FILTER_BLEND:
enum **FilterAction**:
- **FILTER_IGNORE** = **0** --- Do not use filtering.
- **FILTER_PASS** = **1** --- Paths matching the filter will be allowed to pass.
- **FILTER_STOP** = **2** --- Paths matching the filter will be discarded.
- **FILTER_BLEND** = **3** --- Paths matching the filter will be blended (by the blend value).
Property Descriptions
---------------------
.. _class_AnimationNode_property_filter_enabled:
- :ref:`bool<class_bool>` **filter_enabled**
+----------+---------------------------+
| *Setter* | set_filter_enabled(value) |
+----------+---------------------------+
| *Getter* | is_filter_enabled() |
+----------+---------------------------+
If ``true``, filtering is enabled.
Method Descriptions
-------------------
.. _class_AnimationNode_method_add_input:
- void **add_input** **(** :ref:`String<class_String>` name **)**
Adds an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
----
.. _class_AnimationNode_method_blend_animation:
- void **blend_animation** **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)**
Blend an animation by ``blend`` amount (name must be valid in the linked :ref:`AnimationPlayer<class_AnimationPlayer>`). A ``time`` and ``delta`` may be passed, as well as whether ``seek`` happened.
----
.. _class_AnimationNode_method_blend_input:
- :ref:`float<class_float>` **blend_input** **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
Blend an input. This is only useful for nodes created for an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. A filter mode may be optionally passed (see :ref:`FilterAction<enum_AnimationNode_FilterAction>` for options).
----
.. _class_AnimationNode_method_blend_node:
- :ref:`float<class_float>` **blend_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from :ref:`AnimationRootNode<class_AnimationRootNode>` instead, else editors will not display your node for addition.
----
.. _class_AnimationNode_method_get_caption:
- :ref:`String<class_String>` **get_caption** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to override the text caption for this node.
----
.. _class_AnimationNode_method_get_child_by_name:
- :ref:`Object<class_Object>` **get_child_by_name** **(** :ref:`String<class_String>` name **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return a child node by its ``name``.
----
.. _class_AnimationNode_method_get_child_nodes:
- :ref:`Dictionary<class_Dictionary>` **get_child_nodes** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return all children nodes in order as a ``name: node`` dictionary.
----
.. _class_AnimationNode_method_get_input_count:
- :ref:`int<class_int>` **get_input_count** **(** **)** |const|
Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
----
.. _class_AnimationNode_method_get_input_name:
- :ref:`String<class_String>` **get_input_name** **(** :ref:`int<class_int>` input **)**
Gets the name of an input by index.
----
.. _class_AnimationNode_method_get_parameter:
- :ref:`Variant<class_Variant>` **get_parameter** **(** :ref:`String<class_String>` name **)** |const|
Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
----
.. _class_AnimationNode_method_get_parameter_default_value:
- :ref:`Variant<class_Variant>` **get_parameter_default_value** **(** :ref:`String<class_String>` name **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return the default value of parameter "``name``". Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
----
.. _class_AnimationNode_method_get_parameter_list:
- :ref:`Array<class_Array>` **get_parameter_list** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return a list of the properties on this node. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list<class_Object_method_get_property_list>`.
----
.. _class_AnimationNode_method_has_filter:
- :ref:`bool<class_bool>` **has_filter** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return whether the blend tree editor should display filter editing on this node.
----
.. _class_AnimationNode_method_is_path_filtered:
- :ref:`bool<class_bool>` **is_path_filtered** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
Returns whether the given path is filtered.
----
.. _class_AnimationNode_method_process:
- void **process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to run some code when this node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute.
Here, call the :ref:`blend_input<class_AnimationNode_method_blend_input>`, :ref:`blend_node<class_AnimationNode_method_blend_node>` or :ref:`blend_animation<class_AnimationNode_method_blend_animation>` functions. You can also use :ref:`get_parameter<class_AnimationNode_method_get_parameter>` and :ref:`set_parameter<class_AnimationNode_method_set_parameter>` to modify local memory.
This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
----
.. _class_AnimationNode_method_remove_input:
- void **remove_input** **(** :ref:`int<class_int>` index **)**
Removes an input, call this only when inactive.
----
.. _class_AnimationNode_method_set_filter_path:
- void **set_filter_path** **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
Adds or removes a path for the filter.
----
.. _class_AnimationNode_method_set_parameter:
- void **set_parameter** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,53 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeAdd2.xml.
.. _class_AnimationNodeAdd2:
AnimationNodeAdd2
=================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends two animations additively inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations additively based on an amount value in the ``[0.0, 1.0]`` range.
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd2_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AnimationNodeAdd2_property_sync:
- :ref:`bool<class_bool>` **sync**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,63 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeAdd3.xml.
.. _class_AnimationNodeAdd3:
AnimationNodeAdd3
=================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends two of three animations additively inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations together additively out of three based on a value in the ``[-1.0, 1.0]`` range.
This node has three inputs:
- The base animation to add to
- A -add animation to blend with when the blend amount is in the ``[-1.0, 0.0]`` range.
- A +add animation to blend with when the blend amount is in the ``[0.0, 1.0]`` range
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd3_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AnimationNodeAdd3_property_sync:
- :ref:`bool<class_bool>` **sync**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,57 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeAnimation.xml.
.. _class_AnimationNodeAnimation:
AnimationNodeAnimation
======================
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Input animation to use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Only features one output set using the :ref:`animation<class_AnimationNodeAnimation_property_animation>` property. Use it as an input for :ref:`AnimationNode<class_AnimationNode>` that blend animations together.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+-----------------------------+-------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------+--------+
Property Descriptions
---------------------
.. _class_AnimationNodeAnimation_property_animation:
- :ref:`String<class_String>` **animation**
+-----------+----------------------+
| *Default* | ``""`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
Animation to use as an output. It is one of the animations provided by :ref:`AnimationTree.anim_player<class_AnimationTree_property_anim_player>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,57 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeBlend2.xml.
.. _class_AnimationNodeBlend2:
AnimationNodeBlend2
===================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends two animations linearly inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations linearly based on an amount value in the ``[0.0, 1.0]`` range.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend2_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AnimationNodeBlend2_property_sync:
- :ref:`bool<class_bool>` **sync**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,61 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeBlend3.xml.
.. _class_AnimationNodeBlend3:
AnimationNodeBlend3
===================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends two of three animations linearly inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations together linearly out of three based on a value in the ``[-1.0, 1.0]`` range.
This node has three inputs:
- The base animation
- A -blend animation to blend with when the blend amount is in the ``[-1.0, 0.0]`` range.
- A +blend animation to blend with when the blend amount is in the ``[0.0, 1.0]`` range
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend3_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AnimationNodeBlend3_property_sync:
- :ref:`bool<class_bool>` **sync**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,189 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeBlendSpace1D.xml.
.. _class_AnimationNodeBlendSpace1D:
AnimationNodeBlendSpace1D
=========================
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends linearly between two of any number of :ref:`AnimationNode<class_AnimationNode>` of any type placed on a virtual axis.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
This is a virtual axis on which you can add any type of :ref:`AnimationNode<class_AnimationNode>` using :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
Outputs the linear blend of the two :ref:`AnimationNode<class_AnimationNode>`\ s closest to the node's current value.
You can set the extents of the axis using the :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` and :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>`.
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` | ``-1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`snap<class_AnimationNodeBlendSpace1D_property_snap>` | ``0.1`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`String<class_String>` | :ref:`value_label<class_AnimationNodeBlendSpace1D_property_value_label>` | ``"value"`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
Methods
-------
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace1D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace1D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace1D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace1D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace1D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace1D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AnimationNodeBlendSpace1D_property_max_space:
- :ref:`float<class_float>` **max_space**
+-----------+----------------------+
| *Default* | ``1.0`` |
+-----------+----------------------+
| *Setter* | set_max_space(value) |
+-----------+----------------------+
| *Getter* | get_max_space() |
+-----------+----------------------+
The blend space's axis's upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
----
.. _class_AnimationNodeBlendSpace1D_property_min_space:
- :ref:`float<class_float>` **min_space**
+-----------+----------------------+
| *Default* | ``-1.0`` |
+-----------+----------------------+
| *Setter* | set_min_space(value) |
+-----------+----------------------+
| *Getter* | get_min_space() |
+-----------+----------------------+
The blend space's axis's lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
----
.. _class_AnimationNodeBlendSpace1D_property_snap:
- :ref:`float<class_float>` **snap**
+-----------+-----------------+
| *Default* | ``0.1`` |
+-----------+-----------------+
| *Setter* | set_snap(value) |
+-----------+-----------------+
| *Getter* | get_snap() |
+-----------+-----------------+
Position increment to snap to when moving a point on the axis.
----
.. _class_AnimationNodeBlendSpace1D_property_value_label:
- :ref:`String<class_String>` **value_label**
+-----------+------------------------+
| *Default* | ``"value"`` |
+-----------+------------------------+
| *Setter* | set_value_label(value) |
+-----------+------------------------+
| *Getter* | get_value_label() |
+-----------+------------------------+
Label of the virtual axis of the blend space.
Method Descriptions
-------------------
.. _class_AnimationNodeBlendSpace1D_method_add_blend_point:
- void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)**
Adds a new point that represents a ``node`` on the virtual axis at a given position set by ``pos``. You can insert it at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_count:
- :ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
Returns the number of points on the blend axis.
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node:
- :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
Returns the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position:
- :ref:`float<class_float>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
Returns the position of the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace1D_method_remove_blend_point:
- void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
Removes the point at index ``point`` from the blend axis.
----
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_node:
- void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_position:
- void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)**
Updates the position of the point at index ``point`` on the blend axis.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,311 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeBlendSpace2D.xml.
.. _class_AnimationNodeBlendSpace2D:
AnimationNodeBlendSpace2D
=========================
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Blends linearly between three :ref:`AnimationNode<class_AnimationNode>` of any type placed in a 2D space.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
This node allows you to blend linearly between three animations using a :ref:`Vector2<class_Vector2>` weight.
You can add vertices to the blend space with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and automatically triangulate it by setting :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` to ``true``. Otherwise, use :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` and :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` to create up the blend space by hand.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` | ``true`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace2D_property_blend_mode>` | ``0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`max_space<class_AnimationNodeBlendSpace2D_property_max_space>` | ``Vector2( 1, 1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`min_space<class_AnimationNodeBlendSpace2D_property_min_space>` | ``Vector2( -1, -1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`snap<class_AnimationNodeBlendSpace2D_property_snap>` | ``Vector2( 0.1, 0.1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`x_label<class_AnimationNodeBlendSpace2D_property_x_label>` | ``"x"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`y_label<class_AnimationNodeBlendSpace2D_property_y_label>` | ``"y"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
Methods
-------
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace2D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace2D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace2D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_count<class_AnimationNodeBlendSpace2D_method_get_triangle_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_point<class_AnimationNodeBlendSpace2D_method_get_triangle_point>` **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` **(** :ref:`int<class_int>` triangle **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace2D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace2D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AnimationNodeBlendSpace2D_signal_triangles_updated:
- **triangles_updated** **(** **)**
Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
Enumerations
------------
.. _enum_AnimationNodeBlendSpace2D_BlendMode:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_INTERPOLATED:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE_CARRY:
enum **BlendMode**:
- **BLEND_MODE_INTERPOLATED** = **0** --- The interpolation between animations is linear.
- **BLEND_MODE_DISCRETE** = **1** --- The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
- **BLEND_MODE_DISCRETE_CARRY** = **2** --- Similar to :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE>`, but starts the new animation at the last animation's playback position.
Property Descriptions
---------------------
.. _class_AnimationNodeBlendSpace2D_property_auto_triangles:
- :ref:`bool<class_bool>` **auto_triangles**
+-----------+---------------------------+
| *Default* | ``true`` |
+-----------+---------------------------+
| *Setter* | set_auto_triangles(value) |
+-----------+---------------------------+
| *Getter* | get_auto_triangles() |
+-----------+---------------------------+
If ``true``, the blend space is triangulated automatically. The mesh updates every time you add or remove points with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>`.
----
.. _class_AnimationNodeBlendSpace2D_property_blend_mode:
- :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **blend_mode**
+-----------+-----------------------+
| *Default* | ``0`` |
+-----------+-----------------------+
| *Setter* | set_blend_mode(value) |
+-----------+-----------------------+
| *Getter* | get_blend_mode() |
+-----------+-----------------------+
Controls the interpolation between animations. See :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` constants.
----
.. _class_AnimationNodeBlendSpace2D_property_max_space:
- :ref:`Vector2<class_Vector2>` **max_space**
+-----------+----------------------+
| *Default* | ``Vector2( 1, 1 )`` |
+-----------+----------------------+
| *Setter* | set_max_space(value) |
+-----------+----------------------+
| *Getter* | get_max_space() |
+-----------+----------------------+
The blend space's X and Y axes' upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
----
.. _class_AnimationNodeBlendSpace2D_property_min_space:
- :ref:`Vector2<class_Vector2>` **min_space**
+-----------+-----------------------+
| *Default* | ``Vector2( -1, -1 )`` |
+-----------+-----------------------+
| *Setter* | set_min_space(value) |
+-----------+-----------------------+
| *Getter* | get_min_space() |
+-----------+-----------------------+
The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
----
.. _class_AnimationNodeBlendSpace2D_property_snap:
- :ref:`Vector2<class_Vector2>` **snap**
+-----------+-------------------------+
| *Default* | ``Vector2( 0.1, 0.1 )`` |
+-----------+-------------------------+
| *Setter* | set_snap(value) |
+-----------+-------------------------+
| *Getter* | get_snap() |
+-----------+-------------------------+
Position increment to snap to when moving a point.
----
.. _class_AnimationNodeBlendSpace2D_property_x_label:
- :ref:`String<class_String>` **x_label**
+-----------+--------------------+
| *Default* | ``"x"`` |
+-----------+--------------------+
| *Setter* | set_x_label(value) |
+-----------+--------------------+
| *Getter* | get_x_label() |
+-----------+--------------------+
Name of the blend space's X axis.
----
.. _class_AnimationNodeBlendSpace2D_property_y_label:
- :ref:`String<class_String>` **y_label**
+-----------+--------------------+
| *Default* | ``"y"`` |
+-----------+--------------------+
| *Setter* | set_y_label(value) |
+-----------+--------------------+
| *Getter* | get_y_label() |
+-----------+--------------------+
Name of the blend space's Y axis.
Method Descriptions
-------------------
.. _class_AnimationNodeBlendSpace2D_method_add_blend_point:
- void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)**
Adds a new point that represents a ``node`` at the position set by ``pos``. You can insert it at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
----
.. _class_AnimationNodeBlendSpace2D_method_add_triangle:
- void **add_triangle** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)**
Creates a new triangle using three points ``x``, ``y``, and ``z``. Triangles can overlap. You can insert the triangle at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_count:
- :ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
Returns the number of points in the blend space.
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node:
- :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
Returns the :ref:`AnimationRootNode<class_AnimationRootNode>` referenced by the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position:
- :ref:`Vector2<class_Vector2>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
Returns the position of the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_count:
- :ref:`int<class_int>` **get_triangle_count** **(** **)** |const|
Returns the number of triangles in the blend space.
----
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_point:
- :ref:`int<class_int>` **get_triangle_point** **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)**
Returns the position of the point at index ``point`` in the triangle of index ``triangle``.
----
.. _class_AnimationNodeBlendSpace2D_method_remove_blend_point:
- void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
Removes the point at index ``point`` from the blend space.
----
.. _class_AnimationNodeBlendSpace2D_method_remove_triangle:
- void **remove_triangle** **(** :ref:`int<class_int>` triangle **)**
Removes the triangle at index ``triangle`` from the blend space.
----
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_node:
- void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
----
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_position:
- void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)**
Updates the position of the point at index ``point`` on the blend axis.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,178 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeBlendTree.xml.
.. _class_AnimationNodeBlendTree:
AnimationNodeBlendTree
======================
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
:ref:`AnimationTree<class_AnimationTree>` node resource that contains many blend type nodes.
Description
-----------
This node may contain a sub-tree of any other blend type nodes, such as :ref:`AnimationNodeTransition<class_AnimationNodeTransition>`, :ref:`AnimationNodeBlend2<class_AnimationNodeBlend2>`, :ref:`AnimationNodeBlend3<class_AnimationNodeBlend3>`, :ref:`AnimationNodeOneShot<class_AnimationNodeOneShot>`, etc. This is one of the most commonly used roots.
An :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` node named ``output`` is created by default.
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-------------------------------+-------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`graph_offset<class_AnimationNodeBlendTree_property_graph_offset>` | ``Vector2( 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------------------+---------------------+
Methods
-------
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Constants
---------
.. _class_AnimationNodeBlendTree_constant_CONNECTION_OK:
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_INPUT:
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_INPUT_INDEX:
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_OUTPUT:
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_SAME_NODE:
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_CONNECTION_EXISTS:
- **CONNECTION_OK** = **0** --- The connection was successful.
- **CONNECTION_ERROR_NO_INPUT** = **1** --- The input node is ``null``.
- **CONNECTION_ERROR_NO_INPUT_INDEX** = **2** --- The specified input port is out of range.
- **CONNECTION_ERROR_NO_OUTPUT** = **3** --- The output node is ``null``.
- **CONNECTION_ERROR_SAME_NODE** = **4** --- Input and output nodes are the same.
- **CONNECTION_ERROR_CONNECTION_EXISTS** = **5** --- The specified connection already exists.
Property Descriptions
---------------------
.. _class_AnimationNodeBlendTree_property_graph_offset:
- :ref:`Vector2<class_Vector2>` **graph_offset**
+-----------+-------------------------+
| *Default* | ``Vector2( 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_graph_offset(value) |
+-----------+-------------------------+
| *Getter* | get_graph_offset() |
+-----------+-------------------------+
The global offset of all sub-nodes.
Method Descriptions
-------------------
.. _class_AnimationNodeBlendTree_method_add_node:
- void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
Adds an :ref:`AnimationNode<class_AnimationNode>` at the given ``position``. The ``name`` is used to identify the created sub-node later.
----
.. _class_AnimationNodeBlendTree_method_connect_node:
- void **connect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)**
Connects the output of an :ref:`AnimationNode<class_AnimationNode>` as input for another :ref:`AnimationNode<class_AnimationNode>`, at the input port specified by ``input_index``.
----
.. _class_AnimationNodeBlendTree_method_disconnect_node:
- void **disconnect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)**
Disconnects the node connected to the specified input.
----
.. _class_AnimationNodeBlendTree_method_get_node:
- :ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
Returns the sub-node with the specified ``name``.
----
.. _class_AnimationNodeBlendTree_method_get_node_position:
- :ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
Returns the position of the sub-node with the specified ``name``.
----
.. _class_AnimationNodeBlendTree_method_has_node:
- :ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if a sub-node with specified ``name`` exists.
----
.. _class_AnimationNodeBlendTree_method_remove_node:
- void **remove_node** **(** :ref:`String<class_String>` name **)**
Removes a sub-node.
----
.. _class_AnimationNodeBlendTree_method_rename_node:
- void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
Changes the name of a sub-node.
----
.. _class_AnimationNodeBlendTree_method_set_node_position:
- void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
Modifies the position of a sub-node.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,170 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeOneShot.xml.
.. _class_AnimationNodeOneShot:
AnimationNodeOneShot
====================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Plays an animation once in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>` | ``1.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_random_delay<class_AnimationNodeOneShot_property_autorestart_random_delay>` | ``0.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeOneShot_property_sync>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
Enumerations
------------
.. _enum_AnimationNodeOneShot_MixMode:
.. _class_AnimationNodeOneShot_constant_MIX_MODE_BLEND:
.. _class_AnimationNodeOneShot_constant_MIX_MODE_ADD:
enum **MixMode**:
- **MIX_MODE_BLEND** = **0**
- **MIX_MODE_ADD** = **1**
Property Descriptions
---------------------
.. _class_AnimationNodeOneShot_property_autorestart:
- :ref:`bool<class_bool>` **autorestart**
+-----------+------------------------+
| *Default* | ``false`` |
+-----------+------------------------+
| *Setter* | set_autorestart(value) |
+-----------+------------------------+
| *Getter* | has_autorestart() |
+-----------+------------------------+
If ``true``, the sub-animation will restart automatically after finishing.
----
.. _class_AnimationNodeOneShot_property_autorestart_delay:
- :ref:`float<class_float>` **autorestart_delay**
+-----------+------------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------------+
| *Setter* | set_autorestart_delay(value) |
+-----------+------------------------------+
| *Getter* | get_autorestart_delay() |
+-----------+------------------------------+
The delay after which the automatic restart is triggered, in seconds.
----
.. _class_AnimationNodeOneShot_property_autorestart_random_delay:
- :ref:`float<class_float>` **autorestart_random_delay**
+-----------+-------------------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------------------+
| *Setter* | set_autorestart_random_delay(value) |
+-----------+-------------------------------------+
| *Getter* | get_autorestart_random_delay() |
+-----------+-------------------------------------+
If :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` is ``true``, a random additional delay (in seconds) between 0 and this value will be added to :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>`.
----
.. _class_AnimationNodeOneShot_property_fadein_time:
- :ref:`float<class_float>` **fadein_time**
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_fadein_time(value) |
+-----------+------------------------+
| *Getter* | get_fadein_time() |
+-----------+------------------------+
----
.. _class_AnimationNodeOneShot_property_fadeout_time:
- :ref:`float<class_float>` **fadeout_time**
+-----------+-------------------------+
| *Default* | ``0.1`` |
+-----------+-------------------------+
| *Setter* | set_fadeout_time(value) |
+-----------+-------------------------+
| *Getter* | get_fadeout_time() |
+-----------+-------------------------+
----
.. _class_AnimationNodeOneShot_property_mix_mode:
- :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **mix_mode**
+-----------+---------------------+
| *Default* | ``0`` |
+-----------+---------------------+
| *Setter* | set_mix_mode(value) |
+-----------+---------------------+
| *Getter* | get_mix_mode() |
+-----------+---------------------+
----
.. _class_AnimationNodeOneShot_property_sync:
- :ref:`bool<class_bool>` **sync**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,28 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeOutput.xml.
.. _class_AnimationNodeOutput:
AnimationNodeOutput
===================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Generic output node to be added to :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,272 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeStateMachine.xml.
.. _class_AnimationNodeStateMachine:
AnimationNodeStateMachine
=========================
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
State machine for control of animations.
Description
-----------
Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the :ref:`AnimationNodeStateMachinePlayback<class_AnimationNodeStateMachinePlayback>` object from the :ref:`AnimationTree<class_AnimationTree>` node to control it programmatically.
\ **Example:**\
::
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Methods
-------
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeStateMachine_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_transition<class_AnimationNodeStateMachine_method_add_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_end_node<class_AnimationNodeStateMachine_method_get_end_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_graph_offset<class_AnimationNodeStateMachine_method_get_graph_offset>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeStateMachine_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_node_name<class_AnimationNodeStateMachine_method_get_node_name>` **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeStateMachine_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_start_node<class_AnimationNodeStateMachine_method_get_start_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` | :ref:`get_transition<class_AnimationNodeStateMachine_method_get_transition>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_transition_count<class_AnimationNodeStateMachine_method_get_transition_count>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_from<class_AnimationNodeStateMachine_method_get_transition_from>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_to<class_AnimationNodeStateMachine_method_get_transition_to>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeStateMachine_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_transition<class_AnimationNodeStateMachine_method_has_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeStateMachine_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition<class_AnimationNodeStateMachine_method_remove_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition_by_index<class_AnimationNodeStateMachine_method_remove_transition_by_index>` **(** :ref:`int<class_int>` idx **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeStateMachine_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`replace_node<class_AnimationNodeStateMachine_method_replace_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_end_node<class_AnimationNodeStateMachine_method_set_end_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_graph_offset<class_AnimationNodeStateMachine_method_set_graph_offset>` **(** :ref:`Vector2<class_Vector2>` offset **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeStateMachine_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_start_node<class_AnimationNodeStateMachine_method_set_start_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AnimationNodeStateMachine_method_add_node:
- void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
Adds a new node to the graph. The ``position`` is used for display in the editor.
----
.. _class_AnimationNodeStateMachine_method_add_transition:
- void **add_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)**
Adds a transition between the given nodes.
----
.. _class_AnimationNodeStateMachine_method_get_end_node:
- :ref:`String<class_String>` **get_end_node** **(** **)** |const|
Returns the graph's end node.
----
.. _class_AnimationNodeStateMachine_method_get_graph_offset:
- :ref:`Vector2<class_Vector2>` **get_graph_offset** **(** **)** |const|
Returns the draw offset of the graph. Used for display in the editor.
----
.. _class_AnimationNodeStateMachine_method_get_node:
- :ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
Returns the animation node with the given name.
----
.. _class_AnimationNodeStateMachine_method_get_node_name:
- :ref:`String<class_String>` **get_node_name** **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const|
Returns the given animation node's name.
----
.. _class_AnimationNodeStateMachine_method_get_node_position:
- :ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
Returns the given node's coordinates. Used for display in the editor.
----
.. _class_AnimationNodeStateMachine_method_get_start_node:
- :ref:`String<class_String>` **get_start_node** **(** **)** |const|
Returns the graph's end node.
----
.. _class_AnimationNodeStateMachine_method_get_transition:
- :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` **get_transition** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition.
----
.. _class_AnimationNodeStateMachine_method_get_transition_count:
- :ref:`int<class_int>` **get_transition_count** **(** **)** |const|
Returns the number of connections in the graph.
----
.. _class_AnimationNodeStateMachine_method_get_transition_from:
- :ref:`String<class_String>` **get_transition_from** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition's start node.
----
.. _class_AnimationNodeStateMachine_method_get_transition_to:
- :ref:`String<class_String>` **get_transition_to** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition's end node.
----
.. _class_AnimationNodeStateMachine_method_has_node:
- :ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if the graph contains the given node.
----
.. _class_AnimationNodeStateMachine_method_has_transition:
- :ref:`bool<class_bool>` **has_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const|
Returns ``true`` if there is a transition between the given nodes.
----
.. _class_AnimationNodeStateMachine_method_remove_node:
- void **remove_node** **(** :ref:`String<class_String>` name **)**
Deletes the given node from the graph.
----
.. _class_AnimationNodeStateMachine_method_remove_transition:
- void **remove_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)**
Deletes the transition between the two specified nodes.
----
.. _class_AnimationNodeStateMachine_method_remove_transition_by_index:
- void **remove_transition_by_index** **(** :ref:`int<class_int>` idx **)**
Deletes the given transition by index.
----
.. _class_AnimationNodeStateMachine_method_rename_node:
- void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
Renames the given node.
----
.. _class_AnimationNodeStateMachine_method_replace_node:
- void **replace_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)**
Replaces the node and keeps its transitions unchanged.
----
.. _class_AnimationNodeStateMachine_method_set_end_node:
- void **set_end_node** **(** :ref:`String<class_String>` name **)**
Sets the given node as the graph end point.
----
.. _class_AnimationNodeStateMachine_method_set_graph_offset:
- void **set_graph_offset** **(** :ref:`Vector2<class_Vector2>` offset **)**
Sets the draw offset of the graph. Used for display in the editor.
----
.. _class_AnimationNodeStateMachine_method_set_node_position:
- void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
Sets the node's coordinates. Used for display in the editor.
----
.. _class_AnimationNodeStateMachine_method_set_start_node:
- void **set_start_node** **(** :ref:`String<class_String>` name **)**
Sets the given node as the graph start point.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,127 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeStateMachinePlayback.xml.
.. _class_AnimationNodeStateMachinePlayback:
AnimationNodeStateMachinePlayback
=================================
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Playback control for :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`.
Description
-----------
Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines created with :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Retrieve with ``$AnimationTree.get("parameters/playback")``.
\ **Example:**\
::
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
Methods
-------
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_play_position<class_AnimationNodeStateMachinePlayback_method_get_current_play_position>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`String<class_String>` node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`String<class_String>` to_node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AnimationNodeStateMachinePlayback_method_get_current_length:
- :ref:`float<class_float>` **get_current_length** **(** **)** |const|
----
.. _class_AnimationNodeStateMachinePlayback_method_get_current_node:
- :ref:`String<class_String>` **get_current_node** **(** **)** |const|
Returns the currently playing animation state.
----
.. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position:
- :ref:`float<class_float>` **get_current_play_position** **(** **)** |const|
Returns the playback position within the current animation state.
----
.. _class_AnimationNodeStateMachinePlayback_method_get_travel_path:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_travel_path** **(** **)** |const|
Returns the current travel path as computed internally by the A\* algorithm.
----
.. _class_AnimationNodeStateMachinePlayback_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if an animation is playing.
----
.. _class_AnimationNodeStateMachinePlayback_method_start:
- void **start** **(** :ref:`String<class_String>` node **)**
Starts playing the given animation.
----
.. _class_AnimationNodeStateMachinePlayback_method_stop:
- void **stop** **(** **)**
Stops the currently playing animation.
----
.. _class_AnimationNodeStateMachinePlayback_method_travel:
- void **travel** **(** :ref:`String<class_String>` to_node **)**
Transitions from the current state to another one, following the shortest path.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,170 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeStateMachineTransition.xml.
.. _class_AnimationNodeStateMachineTransition:
AnimationNodeStateMachineTransition
===================================
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``""`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_AnimationNodeStateMachineTransition_property_disabled>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
Signals
-------
.. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
- **advance_condition_changed** **(** **)**
Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
Enumerations
------------
.. _enum_AnimationNodeStateMachineTransition_SwitchMode:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
enum **SwitchMode**:
- **SWITCH_MODE_IMMEDIATE** = **0** --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
- **SWITCH_MODE_SYNC** = **1** --- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
- **SWITCH_MODE_AT_END** = **2** --- Wait for the current state playback to end, then switch to the beginning of the next state animation.
Property Descriptions
---------------------
.. _class_AnimationNodeStateMachineTransition_property_advance_condition:
- :ref:`String<class_String>` **advance_condition**
+-----------+------------------------------+
| *Default* | ``""`` |
+-----------+------------------------------+
| *Setter* | set_advance_condition(value) |
+-----------+------------------------------+
| *Getter* | get_advance_condition() |
+-----------+------------------------------+
Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree<class_AnimationTree>` that can be controlled from code (see `Using AnimationTree <../tutorials/animation/animation_tree.html#controlling-from-code>`__). For example, if :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>` is an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` and :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is set to ``"idle"``:
::
$animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0)
----
.. _class_AnimationNodeStateMachineTransition_property_auto_advance:
- :ref:`bool<class_bool>` **auto_advance**
+-----------+-------------------------+
| *Default* | ``false`` |
+-----------+-------------------------+
| *Setter* | set_auto_advance(value) |
+-----------+-------------------------+
| *Getter* | has_auto_advance() |
+-----------+-------------------------+
Turn on the transition automatically when this state is reached. This works best with :ref:`SWITCH_MODE_AT_END<class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END>`.
----
.. _class_AnimationNodeStateMachineTransition_property_disabled:
- :ref:`bool<class_bool>` **disabled**
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_disabled(value) |
+-----------+---------------------+
| *Getter* | is_disabled() |
+-----------+---------------------+
Don't use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
----
.. _class_AnimationNodeStateMachineTransition_property_priority:
- :ref:`int<class_int>` **priority**
+-----------+---------------------+
| *Default* | ``1`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
----
.. _class_AnimationNodeStateMachineTransition_property_switch_mode:
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode**
+-----------+------------------------+
| *Default* | ``0`` |
+-----------+------------------------+
| *Setter* | set_switch_mode(value) |
+-----------+------------------------+
| *Getter* | get_switch_mode() |
+-----------+------------------------+
The transition type.
----
.. _class_AnimationNodeStateMachineTransition_property_xfade_time:
- :ref:`float<class_float>` **xfade_time**
+-----------+-----------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------+
| *Setter* | set_xfade_time(value) |
+-----------+-----------------------+
| *Getter* | get_xfade_time() |
+-----------+-----------------------+
The time to cross-fade between this state and the next.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,31 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeTimeScale.xml.
.. _class_AnimationNodeTimeScale:
AnimationNodeTimeScale
======================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
A time-scaling animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
Description
-----------
Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,41 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeTimeSeek.xml.
.. _class_AnimationNodeTimeSeek:
AnimationNodeTimeSeek
=====================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
A time-seeking animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
Description
-----------
This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an :ref:`Animation<class_Animation>` from the start or a certain playback position inside the :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its ``seek_position`` value to ``-1.0``.
::
# Play child animation from the start.
animation_tree.set("parameters/Seek/seek_position", 0.0)
# Alternative syntax (same result as above).
animation_tree["parameters/Seek/seek_position"] = 0.0
# Play child animation from 12 second timestamp.
animation_tree.set("parameters/Seek/seek_position", 12.0)
# Alternative syntax (same result as above).
animation_tree["parameters/Seek/seek_position"] = 12.0
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,113 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationNodeTransition.xml.
.. _class_AnimationNodeTransition:
AnimationNodeTransition
=======================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
A generic animation transition node for :ref:`AnimationTree<class_AnimationTree>`.
Description
-----------
Simple state machine for cases which don't require a more advanced :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Animations can be connected to the inputs and transition times can be specified.
Tutorials
---------
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`input_count<class_AnimationNodeTransition_property_input_count>` | ``0`` |
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------+---------+
Methods
-------
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_caption<class_AnimationNodeTransition_method_get_input_caption>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_input_set_as_auto_advance<class_AnimationNodeTransition_method_is_input_set_as_auto_advance>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_as_auto_advance<class_AnimationNodeTransition_method_set_input_as_auto_advance>` **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_caption<class_AnimationNodeTransition_method_set_input_caption>` **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AnimationNodeTransition_property_input_count:
- :ref:`int<class_int>` **input_count**
+-----------+---------------------------+
| *Default* | ``0`` |
+-----------+---------------------------+
| *Setter* | set_enabled_inputs(value) |
+-----------+---------------------------+
| *Getter* | get_enabled_inputs() |
+-----------+---------------------------+
The number of available input ports for this node.
----
.. _class_AnimationNodeTransition_property_xfade_time:
- :ref:`float<class_float>` **xfade_time**
+-----------+----------------------------+
| *Default* | ``0.0`` |
+-----------+----------------------------+
| *Setter* | set_cross_fade_time(value) |
+-----------+----------------------------+
| *Getter* | get_cross_fade_time() |
+-----------+----------------------------+
Cross-fading time (in seconds) between each animation connected to the inputs.
Method Descriptions
-------------------
.. _class_AnimationNodeTransition_method_get_input_caption:
- :ref:`String<class_String>` **get_input_caption** **(** :ref:`int<class_int>` input **)** |const|
----
.. _class_AnimationNodeTransition_method_is_input_set_as_auto_advance:
- :ref:`bool<class_bool>` **is_input_set_as_auto_advance** **(** :ref:`int<class_int>` input **)** |const|
----
.. _class_AnimationNodeTransition_method_set_input_as_auto_advance:
- void **set_input_as_auto_advance** **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)**
----
.. _class_AnimationNodeTransition_method_set_input_caption:
- void **set_input_caption** **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)**
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,557 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationPlayer.xml.
.. _class_AnimationPlayer:
AnimationPlayer
===============
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Container and player of :ref:`Animation<class_Animation>` resources.
Description
-----------
An animation player is used for general-purpose playback of :ref:`Animation<class_Animation>` resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels.
\ ``AnimationPlayer`` is more suited than :ref:`Tween<class_Tween>` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an ``AnimationPlayer`` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween<class_Tween>` node, but it requires doing everything by code.
Updating the target properties of animations occurs at process time.
Tutorials
---------
- :doc:`Animation tutorial index <../tutorials/animation/index>`
- :doc:`2D Sprite animation <../tutorials/2d/2d_sprite_animation>`
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`method_call_mode<class_AnimationPlayer_property_method_call_mode>` | ``0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`playback_active<class_AnimationPlayer_property_playback_active>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` | :ref:`playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` | ``1`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_speed<class_AnimationPlayer_property_playback_speed>` | ``1.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationPlayer_property_reset_on_save>` | ``true`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationPlayer_property_root_node>` | ``NodePath("..")`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
Methods
-------
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationPlayer_method_add_animation>` **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationPlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>` **(** :ref:`String<class_String>` anim_from **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`find_animation<class_AnimationPlayer_method_find_animation>` **(** :ref:`Animation<class_Animation>` animation **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationPlayer_method_get_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_animation_list<class_AnimationPlayer_method_get_animation_list>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_queue<class_AnimationPlayer_method_get_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationPlayer_method_has_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimationPlayer_method_play>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue<class_AnimationPlayer_method_queue>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_animation<class_AnimationPlayer_method_remove_animation>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_animation<class_AnimationPlayer_method_rename_animation>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AnimationPlayer_method_seek>` **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationPlayer_method_stop>` **(** :ref:`bool<class_bool>` reset=true **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AnimationPlayer_signal_animation_changed:
- **animation_changed** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
Emitted when a queued animation plays after the previous animation was finished. See :ref:`queue<class_AnimationPlayer_method_queue>`.
\ **Note:** The signal is not emitted when the animation is changed via :ref:`play<class_AnimationPlayer_method_play>` or from :ref:`AnimationTree<class_AnimationTree>`.
----
.. _class_AnimationPlayer_signal_animation_finished:
- **animation_finished** **(** :ref:`String<class_String>` anim_name **)**
Notifies when an animation finished playing.
----
.. _class_AnimationPlayer_signal_animation_started:
- **animation_started** **(** :ref:`String<class_String>` anim_name **)**
Notifies when an animation starts playing.
----
.. _class_AnimationPlayer_signal_caches_cleared:
- **caches_cleared** **(** **)**
Notifies when the caches have been cleared, either automatically, or manually via :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>`.
Enumerations
------------
.. _enum_AnimationPlayer_AnimationProcessMode:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
enum **AnimationProcessMode**:
- **ANIMATION_PROCESS_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies.
- **ANIMATION_PROCESS_IDLE** = **1** --- Process animation during the idle process.
- **ANIMATION_PROCESS_MANUAL** = **2** --- Do not process animation. Use :ref:`advance<class_AnimationPlayer_method_advance>` to process the animation manually.
----
.. _enum_AnimationPlayer_AnimationMethodCallMode:
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
enum **AnimationMethodCallMode**:
- **ANIMATION_METHOD_CALL_DEFERRED** = **0** --- Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing.
- **ANIMATION_METHOD_CALL_IMMEDIATE** = **1** --- Make method calls immediately when reached in the animation.
Property Descriptions
---------------------
.. _class_AnimationPlayer_property_assigned_animation:
- :ref:`String<class_String>` **assigned_animation**
+----------+-------------------------------+
| *Setter* | set_assigned_animation(value) |
+----------+-------------------------------+
| *Getter* | get_assigned_animation() |
+----------+-------------------------------+
If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also :ref:`current_animation<class_AnimationPlayer_property_current_animation>`.
----
.. _class_AnimationPlayer_property_autoplay:
- :ref:`String<class_String>` **autoplay**
+-----------+---------------------+
| *Default* | ``""`` |
+-----------+---------------------+
| *Setter* | set_autoplay(value) |
+-----------+---------------------+
| *Getter* | get_autoplay() |
+-----------+---------------------+
The name of the animation to play when the scene loads.
----
.. _class_AnimationPlayer_property_current_animation:
- :ref:`String<class_String>` **current_animation**
+-----------+------------------------------+
| *Default* | ``""`` |
+-----------+------------------------------+
| *Setter* | set_current_animation(value) |
+-----------+------------------------------+
| *Getter* | get_current_animation() |
+-----------+------------------------------+
The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See :ref:`play<class_AnimationPlayer_method_play>` for more information on playing animations.
\ **Note:** While this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see :ref:`Animation<class_Animation>`.
----
.. _class_AnimationPlayer_property_current_animation_length:
- :ref:`float<class_float>` **current_animation_length**
+----------+--------------------------------+
| *Getter* | get_current_animation_length() |
+----------+--------------------------------+
The length (in seconds) of the currently being played animation.
----
.. _class_AnimationPlayer_property_current_animation_position:
- :ref:`float<class_float>` **current_animation_position**
+----------+----------------------------------+
| *Getter* | get_current_animation_position() |
+----------+----------------------------------+
The position (in seconds) of the currently playing animation.
----
.. _class_AnimationPlayer_property_method_call_mode:
- :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **method_call_mode**
+-----------+-----------------------------+
| *Default* | ``0`` |
+-----------+-----------------------------+
| *Setter* | set_method_call_mode(value) |
+-----------+-----------------------------+
| *Getter* | get_method_call_mode() |
+-----------+-----------------------------+
The call mode to use for Call Method tracks.
----
.. _class_AnimationPlayer_property_playback_active:
- :ref:`bool<class_bool>` **playback_active**
+----------+-------------------+
| *Setter* | set_active(value) |
+----------+-------------------+
| *Getter* | is_active() |
+----------+-------------------+
If ``true``, updates animations in response to process-related notifications.
----
.. _class_AnimationPlayer_property_playback_default_blend_time:
- :ref:`float<class_float>` **playback_default_blend_time**
+-----------+-------------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------------+
| *Setter* | set_default_blend_time(value) |
+-----------+-------------------------------+
| *Getter* | get_default_blend_time() |
+-----------+-------------------------------+
The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision.
----
.. _class_AnimationPlayer_property_playback_process_mode:
- :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **playback_process_mode**
+-----------+-----------------------------------+
| *Default* | ``1`` |
+-----------+-----------------------------------+
| *Setter* | set_animation_process_mode(value) |
+-----------+-----------------------------------+
| *Getter* | get_animation_process_mode() |
+-----------+-----------------------------------+
The process notification in which to update animations.
----
.. _class_AnimationPlayer_property_playback_speed:
- :ref:`float<class_float>` **playback_speed**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_speed_scale(value) |
+-----------+------------------------+
| *Getter* | get_speed_scale() |
+-----------+------------------------+
The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed.
----
.. _class_AnimationPlayer_property_reset_on_save:
- :ref:`bool<class_bool>` **reset_on_save**
+-----------+----------------------------------+
| *Default* | ``true`` |
+-----------+----------------------------------+
| *Setter* | set_reset_on_save_enabled(value) |
+-----------+----------------------------------+
| *Getter* | is_reset_on_save_enabled() |
+-----------+----------------------------------+
This is used by the editor. If set to ``true``, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving.
In other words, the saved scene file will contain the "default pose", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving.
----
.. _class_AnimationPlayer_property_root_node:
- :ref:`NodePath<class_NodePath>` **root_node**
+-----------+--------------------+
| *Default* | ``NodePath("..")`` |
+-----------+--------------------+
| *Setter* | set_root(value) |
+-----------+--------------------+
| *Getter* | get_root() |
+-----------+--------------------+
The node from which node path references will travel.
Method Descriptions
-------------------
.. _class_AnimationPlayer_method_add_animation:
- :ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)**
Adds ``animation`` to the player accessible with the key ``name``.
----
.. _class_AnimationPlayer_method_advance:
- void **advance** **(** :ref:`float<class_float>` delta **)**
Shifts position in the animation timeline and immediately updates the animation. ``delta`` is the time in seconds to shift. Events between the current frame and ``delta`` are handled.
----
.. _class_AnimationPlayer_method_animation_get_next:
- :ref:`String<class_String>` **animation_get_next** **(** :ref:`String<class_String>` anim_from **)** |const|
Returns the name of the next animation in the queue.
----
.. _class_AnimationPlayer_method_animation_set_next:
- void **animation_set_next** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)**
Triggers the ``anim_to`` animation when the ``anim_from`` animation completes.
----
.. _class_AnimationPlayer_method_clear_caches:
- void **clear_caches** **(** **)**
``AnimationPlayer`` caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` forces it to update the cache again.
----
.. _class_AnimationPlayer_method_clear_queue:
- void **clear_queue** **(** **)**
Clears all queued, unplayed animations.
----
.. _class_AnimationPlayer_method_find_animation:
- :ref:`String<class_String>` **find_animation** **(** :ref:`Animation<class_Animation>` animation **)** |const|
Returns the name of ``animation`` or an empty string if not found.
----
.. _class_AnimationPlayer_method_get_animation:
- :ref:`Animation<class_Animation>` **get_animation** **(** :ref:`String<class_String>` name **)** |const|
Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the animation does not exist, ``null`` is returned and an error is logged.
----
.. _class_AnimationPlayer_method_get_animation_list:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_animation_list** **(** **)** |const|
Returns the list of stored animation names.
----
.. _class_AnimationPlayer_method_get_blend_time:
- :ref:`float<class_float>` **get_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const|
Gets the blend time (in seconds) between two animations, referenced by their names.
----
.. _class_AnimationPlayer_method_get_playing_speed:
- :ref:`float<class_float>` **get_playing_speed** **(** **)** |const|
Gets the actual playing speed of current animation or 0 if not playing. This speed is the :ref:`playback_speed<class_AnimationPlayer_property_playback_speed>` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play<class_AnimationPlayer_method_play>` method.
----
.. _class_AnimationPlayer_method_get_queue:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_queue** **(** **)**
Returns a list of the animation names that are currently queued to play.
----
.. _class_AnimationPlayer_method_has_animation:
- :ref:`bool<class_bool>` **has_animation** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if the ``AnimationPlayer`` stores an :ref:`Animation<class_Animation>` with key ``name``.
----
.. _class_AnimationPlayer_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if playing an animation.
----
.. _class_AnimationPlayer_method_play:
- void **play** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)**
Plays the animation with key ``name``. Custom blend times and speed can be set. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>`).
The ``AnimationPlayer`` keeps track of its current or last played animation with :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see :ref:`stop<class_AnimationPlayer_method_stop>` for both pause and stop). If the animation was already playing, it will keep playing.
\ **Note:** The animation will be updated the next time the ``AnimationPlayer`` is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``.
----
.. _class_AnimationPlayer_method_play_backwards:
- void **play_backwards** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)**
Plays the animation with key ``name`` in reverse.
This method is a shorthand for :ref:`play<class_AnimationPlayer_method_play>` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information.
----
.. _class_AnimationPlayer_method_queue:
- void **queue** **(** :ref:`String<class_String>` name **)**
Queues an animation for playback once the current one is done.
\ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
----
.. _class_AnimationPlayer_method_remove_animation:
- void **remove_animation** **(** :ref:`String<class_String>` name **)**
Removes the animation with key ``name``.
----
.. _class_AnimationPlayer_method_rename_animation:
- void **rename_animation** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)**
Renames an existing animation with key ``name`` to ``newname``.
----
.. _class_AnimationPlayer_method_seek:
- void **seek** **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)**
Seeks the animation to the ``seconds`` point in time (in seconds). If ``update`` is ``true``, the animation updates too, otherwise it updates at process time. Events between the current frame and ``seconds`` are skipped.
\ **Note:** Seeking to the end of the animation doesn't emit :ref:`animation_finished<class_AnimationPlayer_signal_animation_finished>`. If you want to skip animation and emit the signal, use :ref:`advance<class_AnimationPlayer_method_advance>`.
----
.. _class_AnimationPlayer_method_set_blend_time:
- void **set_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)**
Specifies a blend time (in seconds) between two animations, referenced by their names.
----
.. _class_AnimationPlayer_method_stop:
- void **stop** **(** :ref:`bool<class_bool>` reset=true **)**
Stops or pauses the currently playing animation. If ``reset`` is ``true``, the animation position is reset to ``0`` and the playback speed is reset to ``1.0``.
If ``reset`` is ``false``, the :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` will be kept and calling :ref:`play<class_AnimationPlayer_method_play>` or :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` without arguments or with the same animation name as :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` will resume the animation.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,21 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationRootNode.xml.
.. _class_AnimationRootNode:
AnimationRootNode
=================
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AnimationNodeAnimation<class_AnimationNodeAnimation>`, :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,19 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationTrackEditPlugin.xml.
.. _class_AnimationTrackEditPlugin:
AnimationTrackEditPlugin
========================
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,182 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationTree.xml.
.. _class_AnimationTree:
AnimationTree
=============
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
Description
-----------
A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
\ **Note:** When linked with an :ref:`AnimationPlayer<class_AnimationPlayer>`, several properties and methods of the corresponding :ref:`AnimationPlayer<class_AnimationPlayer>` will not function as expected. Playback and transitions should be handled using only the ``AnimationTree`` and its constituent :ref:`AnimationNode<class_AnimationNode>`\ (s). The :ref:`AnimationPlayer<class_AnimationPlayer>` node should be used solely for adding, deleting, and editing animations.
Tutorials
---------
- :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`bool<class_bool>` | :ref:`active<class_AnimationTree_property_active>` | ``false`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` | :ref:`process_mode<class_AnimationTree_property_process_mode>` | ``1`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`tree_root<class_AnimationTree_property_tree_root>` | |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
Methods
-------
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationTree_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` **(** **)** |const| |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_parameter<class_AnimationTree_method_rename_parameter>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_AnimationTree_AnimationProcessMode:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
enum **AnimationProcessMode**:
- **ANIMATION_PROCESS_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. :ref:`Node._physics_process<class_Node_method__physics_process>`).
- **ANIMATION_PROCESS_IDLE** = **1** --- The animations will progress during the idle frame (i.e. :ref:`Node._process<class_Node_method__process>`).
- **ANIMATION_PROCESS_MANUAL** = **2** --- The animations will only progress manually (see :ref:`advance<class_AnimationTree_method_advance>`).
Property Descriptions
---------------------
.. _class_AnimationTree_property_active:
- :ref:`bool<class_bool>` **active**
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_active(value) |
+-----------+-------------------+
| *Getter* | is_active() |
+-----------+-------------------+
If ``true``, the ``AnimationTree`` will be processing.
----
.. _class_AnimationTree_property_anim_player:
- :ref:`NodePath<class_NodePath>` **anim_player**
+-----------+-----------------------------+
| *Default* | ``NodePath("")`` |
+-----------+-----------------------------+
| *Setter* | set_animation_player(value) |
+-----------+-----------------------------+
| *Getter* | get_animation_player() |
+-----------+-----------------------------+
The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` used for animating.
----
.. _class_AnimationTree_property_process_mode:
- :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **process_mode**
+-----------+-------------------------+
| *Default* | ``1`` |
+-----------+-------------------------+
| *Setter* | set_process_mode(value) |
+-----------+-------------------------+
| *Getter* | get_process_mode() |
+-----------+-------------------------+
The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` for available modes.
----
.. _class_AnimationTree_property_root_motion_track:
- :ref:`NodePath<class_NodePath>` **root_motion_track**
+-----------+------------------------------+
| *Default* | ``NodePath("")`` |
+-----------+------------------------------+
| *Setter* | set_root_motion_track(value) |
+-----------+------------------------------+
| *Getter* | get_root_motion_track() |
+-----------+------------------------------+
The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by ``":"``. For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
If the track has type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` and :ref:`RootMotionView<class_RootMotionView>`.
----
.. _class_AnimationTree_property_tree_root:
- :ref:`AnimationNode<class_AnimationNode>` **tree_root**
+----------+----------------------+
| *Setter* | set_tree_root(value) |
+----------+----------------------+
| *Getter* | get_tree_root() |
+----------+----------------------+
The root animation node of this ``AnimationTree``. See :ref:`AnimationNode<class_AnimationNode>`.
Method Descriptions
-------------------
.. _class_AnimationTree_method_advance:
- void **advance** **(** :ref:`float<class_float>` delta **)**
Manually advance the animations by the specified time (in seconds).
----
.. _class_AnimationTree_method_get_root_motion_transform:
- :ref:`Transform<class_Transform>` **get_root_motion_transform** **(** **)** |const|
Retrieve the motion of the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Transform<class_Transform>` that can be used elsewhere. If :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` is not a path to a track of type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, returns an identity transformation. See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
----
.. _class_AnimationTree_method_rename_parameter:
- void **rename_parameter** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,772 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AnimationTreePlayer.xml.
.. _class_AnimationTreePlayer:
AnimationTreePlayer
===================
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
*Deprecated.* Animation player that uses a node graph for blending animations. Superseded by :ref:`AnimationTree<class_AnimationTree>`.
Description
-----------
*Deprecated.* A node graph tool for blending multiple animations bound to an :ref:`AnimationPlayer<class_AnimationPlayer>`. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose.
It takes :ref:`Animation<class_Animation>`\ s from an :ref:`AnimationPlayer<class_AnimationPlayer>` node and mixes them depending on the graph.
See :ref:`AnimationTree<class_AnimationTree>` for a more full-featured replacement of this node.
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
Properties
----------
+----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`active<class_AnimationTreePlayer_property_active>` | ``false`` |
+----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`base_path<class_AnimationTreePlayer_property_base_path>` | ``NodePath("..")`` |
+----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`master_player<class_AnimationTreePlayer_property_master_player>` | ``NodePath("")`` |
+----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationProcessMode<enum_AnimationTreePlayer_AnimationProcessMode>` | :ref:`playback_process_mode<class_AnimationTreePlayer_property_playback_process_mode>` | ``1`` |
+----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+
Methods
-------
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationTreePlayer_method_add_node>` **(** :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` type, :ref:`String<class_String>` id **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationTreePlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Animation<class_Animation>` | :ref:`animation_node_get_animation<class_AnimationTreePlayer_method_animation_node_get_animation>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`animation_node_get_master_animation<class_AnimationTreePlayer_method_animation_node_get_master_animation>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`animation_node_get_position<class_AnimationTreePlayer_method_animation_node_get_position>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_node_set_animation<class_AnimationTreePlayer_method_animation_node_set_animation>` **(** :ref:`String<class_String>` id, :ref:`Animation<class_Animation>` animation **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_node_set_filter_path<class_AnimationTreePlayer_method_animation_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_node_set_master_animation<class_AnimationTreePlayer_method_animation_node_set_master_animation>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` source **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_nodes_connected<class_AnimationTreePlayer_method_are_nodes_connected>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend2_node_get_amount<class_AnimationTreePlayer_method_blend2_node_get_amount>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend2_node_set_amount<class_AnimationTreePlayer_method_blend2_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend2_node_set_filter_path<class_AnimationTreePlayer_method_blend2_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend3_node_get_amount<class_AnimationTreePlayer_method_blend3_node_get_amount>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend3_node_set_amount<class_AnimationTreePlayer_method_blend3_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`blend4_node_get_amount<class_AnimationTreePlayer_method_blend4_node_get_amount>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend4_node_set_amount<class_AnimationTreePlayer_method_blend4_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` blend **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_nodes<class_AnimationTreePlayer_method_connect_nodes>` **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_nodes<class_AnimationTreePlayer_method_disconnect_nodes>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` dst_input_idx **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_node_list<class_AnimationTreePlayer_method_get_node_list>` **(** **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`mix_node_get_amount<class_AnimationTreePlayer_method_mix_node_get_amount>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`mix_node_set_amount<class_AnimationTreePlayer_method_mix_node_set_amount>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` ratio **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`node_exists<class_AnimationTreePlayer_method_node_exists>` **(** :ref:`String<class_String>` node **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`node_get_input_count<class_AnimationTreePlayer_method_node_get_input_count>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`node_get_input_source<class_AnimationTreePlayer_method_node_get_input_source>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`node_get_position<class_AnimationTreePlayer_method_node_get_position>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` | :ref:`node_get_type<class_AnimationTreePlayer_method_node_get_type>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`node_rename<class_AnimationTreePlayer_method_node_rename>` **(** :ref:`String<class_String>` node, :ref:`String<class_String>` new_name **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`node_set_position<class_AnimationTreePlayer_method_node_set_position>` **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` screen_position **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`oneshot_node_get_autorestart_delay<class_AnimationTreePlayer_method_oneshot_node_get_autorestart_delay>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`oneshot_node_get_autorestart_random_delay<class_AnimationTreePlayer_method_oneshot_node_get_autorestart_random_delay>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`oneshot_node_get_fadein_time<class_AnimationTreePlayer_method_oneshot_node_get_fadein_time>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`oneshot_node_get_fadeout_time<class_AnimationTreePlayer_method_oneshot_node_get_fadeout_time>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`oneshot_node_has_autorestart<class_AnimationTreePlayer_method_oneshot_node_has_autorestart>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`oneshot_node_is_active<class_AnimationTreePlayer_method_oneshot_node_is_active>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_autorestart<class_AnimationTreePlayer_method_oneshot_node_set_autorestart>` **(** :ref:`String<class_String>` id, :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_autorestart_delay<class_AnimationTreePlayer_method_oneshot_node_set_autorestart_delay>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` delay_sec **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_autorestart_random_delay<class_AnimationTreePlayer_method_oneshot_node_set_autorestart_random_delay>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` rand_sec **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_fadein_time<class_AnimationTreePlayer_method_oneshot_node_set_fadein_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_fadeout_time<class_AnimationTreePlayer_method_oneshot_node_set_fadeout_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_set_filter_path<class_AnimationTreePlayer_method_oneshot_node_set_filter_path>` **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_start<class_AnimationTreePlayer_method_oneshot_node_start>` **(** :ref:`String<class_String>` id **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`oneshot_node_stop<class_AnimationTreePlayer_method_oneshot_node_stop>` **(** :ref:`String<class_String>` id **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`recompute_caches<class_AnimationTreePlayer_method_recompute_caches>` **(** **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationTreePlayer_method_remove_node>` **(** :ref:`String<class_String>` id **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reset<class_AnimationTreePlayer_method_reset>` **(** **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`timescale_node_get_scale<class_AnimationTreePlayer_method_timescale_node_get_scale>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`timescale_node_set_scale<class_AnimationTreePlayer_method_timescale_node_set_scale>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` scale **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`timeseek_node_seek<class_AnimationTreePlayer_method_timeseek_node_seek>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` seconds **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`transition_node_delete_input<class_AnimationTreePlayer_method_transition_node_delete_input>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`transition_node_get_current<class_AnimationTreePlayer_method_transition_node_get_current>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`transition_node_get_input_count<class_AnimationTreePlayer_method_transition_node_get_input_count>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`transition_node_get_xfade_time<class_AnimationTreePlayer_method_transition_node_get_xfade_time>` **(** :ref:`String<class_String>` id **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`transition_node_has_input_auto_advance<class_AnimationTreePlayer_method_transition_node_has_input_auto_advance>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |const| |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`transition_node_set_current<class_AnimationTreePlayer_method_transition_node_set_current>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`transition_node_set_input_auto_advance<class_AnimationTreePlayer_method_transition_node_set_input_auto_advance>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx, :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`transition_node_set_input_count<class_AnimationTreePlayer_method_transition_node_set_input_count>` **(** :ref:`String<class_String>` id, :ref:`int<class_int>` count **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`transition_node_set_xfade_time<class_AnimationTreePlayer_method_transition_node_set_xfade_time>` **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)** |
+----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_AnimationTreePlayer_NodeType:
.. _class_AnimationTreePlayer_constant_NODE_OUTPUT:
.. _class_AnimationTreePlayer_constant_NODE_ANIMATION:
.. _class_AnimationTreePlayer_constant_NODE_ONESHOT:
.. _class_AnimationTreePlayer_constant_NODE_MIX:
.. _class_AnimationTreePlayer_constant_NODE_BLEND2:
.. _class_AnimationTreePlayer_constant_NODE_BLEND3:
.. _class_AnimationTreePlayer_constant_NODE_BLEND4:
.. _class_AnimationTreePlayer_constant_NODE_TIMESCALE:
.. _class_AnimationTreePlayer_constant_NODE_TIMESEEK:
.. _class_AnimationTreePlayer_constant_NODE_TRANSITION:
enum **NodeType**:
- **NODE_OUTPUT** = **0** --- Output node.
- **NODE_ANIMATION** = **1** --- Animation node.
- **NODE_ONESHOT** = **2** --- OneShot node.
- **NODE_MIX** = **3** --- Mix node.
- **NODE_BLEND2** = **4** --- Blend2 node.
- **NODE_BLEND3** = **5** --- Blend3 node.
- **NODE_BLEND4** = **6** --- Blend4 node.
- **NODE_TIMESCALE** = **7** --- TimeScale node.
- **NODE_TIMESEEK** = **8** --- TimeSeek node.
- **NODE_TRANSITION** = **9** --- Transition node.
----
.. _enum_AnimationTreePlayer_AnimationProcessMode:
.. _class_AnimationTreePlayer_constant_ANIMATION_PROCESS_PHYSICS:
.. _class_AnimationTreePlayer_constant_ANIMATION_PROCESS_IDLE:
enum **AnimationProcessMode**:
- **ANIMATION_PROCESS_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies.
- **ANIMATION_PROCESS_IDLE** = **1** --- Process animation during the idle process.
Property Descriptions
---------------------
.. _class_AnimationTreePlayer_property_active:
- :ref:`bool<class_bool>` **active**
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_active(value) |
+-----------+-------------------+
| *Getter* | is_active() |
+-----------+-------------------+
If ``true``, the ``AnimationTreePlayer`` is able to play animations.
----
.. _class_AnimationTreePlayer_property_base_path:
- :ref:`NodePath<class_NodePath>` **base_path**
+-----------+----------------------+
| *Default* | ``NodePath("..")`` |
+-----------+----------------------+
| *Setter* | set_base_path(value) |
+-----------+----------------------+
| *Getter* | get_base_path() |
+-----------+----------------------+
The node from which to relatively access other nodes.
It accesses the bones, so it should point to the same node the :ref:`AnimationPlayer<class_AnimationPlayer>` would point its Root Node at.
----
.. _class_AnimationTreePlayer_property_master_player:
- :ref:`NodePath<class_NodePath>` **master_player**
+-----------+--------------------------+
| *Default* | ``NodePath("")`` |
+-----------+--------------------------+
| *Setter* | set_master_player(value) |
+-----------+--------------------------+
| *Getter* | get_master_player() |
+-----------+--------------------------+
The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` from which this ``AnimationTreePlayer`` binds animations to animation nodes.
Once set, :ref:`Animation<class_Animation>` nodes can be added to the ``AnimationTreePlayer``.
----
.. _class_AnimationTreePlayer_property_playback_process_mode:
- :ref:`AnimationProcessMode<enum_AnimationTreePlayer_AnimationProcessMode>` **playback_process_mode**
+-----------+-----------------------------------+
| *Default* | ``1`` |
+-----------+-----------------------------------+
| *Setter* | set_animation_process_mode(value) |
+-----------+-----------------------------------+
| *Getter* | get_animation_process_mode() |
+-----------+-----------------------------------+
The thread in which to update animations.
Method Descriptions
-------------------
.. _class_AnimationTreePlayer_method_add_node:
- void **add_node** **(** :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` type, :ref:`String<class_String>` id **)**
Adds a ``type`` node to the graph with name ``id``.
----
.. _class_AnimationTreePlayer_method_advance:
- void **advance** **(** :ref:`float<class_float>` delta **)**
Shifts position in the animation timeline. ``delta`` is the time in seconds to shift. Events between the current frame and ``delta`` are handled.
----
.. _class_AnimationTreePlayer_method_animation_node_get_animation:
- :ref:`Animation<class_Animation>` **animation_node_get_animation** **(** :ref:`String<class_String>` id **)** |const|
Returns the :ref:`AnimationPlayer<class_AnimationPlayer>`'s :ref:`Animation<class_Animation>` bound to the ``AnimationTreePlayer``'s animation node with name ``id``.
----
.. _class_AnimationTreePlayer_method_animation_node_get_master_animation:
- :ref:`String<class_String>` **animation_node_get_master_animation** **(** :ref:`String<class_String>` id **)** |const|
Returns the name of the :ref:`master_player<class_AnimationTreePlayer_property_master_player>`'s :ref:`Animation<class_Animation>` bound to this animation node.
----
.. _class_AnimationTreePlayer_method_animation_node_get_position:
- :ref:`float<class_float>` **animation_node_get_position** **(** :ref:`String<class_String>` id **)** |const|
Returns the absolute playback timestamp of the animation node with name ``id``.
----
.. _class_AnimationTreePlayer_method_animation_node_set_animation:
- void **animation_node_set_animation** **(** :ref:`String<class_String>` id, :ref:`Animation<class_Animation>` animation **)**
Binds a new :ref:`Animation<class_Animation>` from the :ref:`master_player<class_AnimationTreePlayer_property_master_player>` to the ``AnimationTreePlayer``'s animation node with name ``id``.
----
.. _class_AnimationTreePlayer_method_animation_node_set_filter_path:
- void **animation_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
If ``enable`` is ``true``, the animation node with ID ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
----
.. _class_AnimationTreePlayer_method_animation_node_set_master_animation:
- void **animation_node_set_master_animation** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` source **)**
Binds the :ref:`Animation<class_Animation>` named ``source`` from :ref:`master_player<class_AnimationTreePlayer_property_master_player>` to the animation node ``id``. Recalculates caches.
----
.. _class_AnimationTreePlayer_method_are_nodes_connected:
- :ref:`bool<class_bool>` **are_nodes_connected** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)** |const|
Returns whether node ``id`` and ``dst_id`` are connected at the specified slot.
----
.. _class_AnimationTreePlayer_method_blend2_node_get_amount:
- :ref:`float<class_float>` **blend2_node_get_amount** **(** :ref:`String<class_String>` id **)** |const|
Returns the blend amount of a Blend2 node given its name.
----
.. _class_AnimationTreePlayer_method_blend2_node_set_amount:
- void **blend2_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)**
Sets the blend amount of a Blend2 node given its name and value.
A Blend2 node blends two animations (A and B) with the amount between 0 and 1.
At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B.
----
.. _class_AnimationTreePlayer_method_blend2_node_set_filter_path:
- void **blend2_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
If ``enable`` is ``true``, the Blend2 node with name ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
----
.. _class_AnimationTreePlayer_method_blend3_node_get_amount:
- :ref:`float<class_float>` **blend3_node_get_amount** **(** :ref:`String<class_String>` id **)** |const|
Returns the blend amount of a Blend3 node given its name.
----
.. _class_AnimationTreePlayer_method_blend3_node_set_amount:
- void **blend3_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` blend **)**
Sets the blend amount of a Blend3 node given its name and value.
A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.
At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+.
----
.. _class_AnimationTreePlayer_method_blend4_node_get_amount:
- :ref:`Vector2<class_Vector2>` **blend4_node_get_amount** **(** :ref:`String<class_String>` id **)** |const|
Returns the blend amount of a Blend4 node given its name.
----
.. _class_AnimationTreePlayer_method_blend4_node_set_amount:
- void **blend4_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` blend **)**
Sets the blend amount of a Blend4 node given its name and value.
A Blend4 Node blends two pairs of animations.
The two pairs are blended like Blend2 and then added together.
----
.. _class_AnimationTreePlayer_method_connect_nodes:
- :ref:`Error<enum_@GlobalScope_Error>` **connect_nodes** **(** :ref:`String<class_String>` id, :ref:`String<class_String>` dst_id, :ref:`int<class_int>` dst_input_idx **)**
Connects node ``id`` to ``dst_id`` at the specified input slot.
----
.. _class_AnimationTreePlayer_method_disconnect_nodes:
- void **disconnect_nodes** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` dst_input_idx **)**
Disconnects nodes connected to ``id`` at the specified input slot.
----
.. _class_AnimationTreePlayer_method_get_node_list:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_node_list** **(** **)**
Returns a :ref:`PoolStringArray<class_PoolStringArray>` containing the name of all nodes.
----
.. _class_AnimationTreePlayer_method_mix_node_get_amount:
- :ref:`float<class_float>` **mix_node_get_amount** **(** :ref:`String<class_String>` id **)** |const|
Returns the mix amount of a Mix node given its name.
----
.. _class_AnimationTreePlayer_method_mix_node_set_amount:
- void **mix_node_set_amount** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` ratio **)**
Sets the mix amount of a Mix node given its name and value.
A Mix node adds input b to input a by the amount given by ratio.
----
.. _class_AnimationTreePlayer_method_node_exists:
- :ref:`bool<class_bool>` **node_exists** **(** :ref:`String<class_String>` node **)** |const|
Check if a node exists (by name).
----
.. _class_AnimationTreePlayer_method_node_get_input_count:
- :ref:`int<class_int>` **node_get_input_count** **(** :ref:`String<class_String>` id **)** |const|
Returns the input count for a given node. Different types of nodes have different amount of inputs.
----
.. _class_AnimationTreePlayer_method_node_get_input_source:
- :ref:`String<class_String>` **node_get_input_source** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` idx **)** |const|
Returns the input source for a given node input.
----
.. _class_AnimationTreePlayer_method_node_get_position:
- :ref:`Vector2<class_Vector2>` **node_get_position** **(** :ref:`String<class_String>` id **)** |const|
Returns position of a node in the graph given its name.
----
.. _class_AnimationTreePlayer_method_node_get_type:
- :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` **node_get_type** **(** :ref:`String<class_String>` id **)** |const|
Gets the node type, will return from :ref:`NodeType<enum_AnimationTreePlayer_NodeType>` enum.
----
.. _class_AnimationTreePlayer_method_node_rename:
- :ref:`Error<enum_@GlobalScope_Error>` **node_rename** **(** :ref:`String<class_String>` node, :ref:`String<class_String>` new_name **)**
Renames a node in the graph.
----
.. _class_AnimationTreePlayer_method_node_set_position:
- void **node_set_position** **(** :ref:`String<class_String>` id, :ref:`Vector2<class_Vector2>` screen_position **)**
Sets the position of a node in the graph given its name and position.
----
.. _class_AnimationTreePlayer_method_oneshot_node_get_autorestart_delay:
- :ref:`float<class_float>` **oneshot_node_get_autorestart_delay** **(** :ref:`String<class_String>` id **)** |const|
Returns the autostart delay of a OneShot node given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_get_autorestart_random_delay:
- :ref:`float<class_float>` **oneshot_node_get_autorestart_random_delay** **(** :ref:`String<class_String>` id **)** |const|
Returns the autostart random delay of a OneShot node given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_get_fadein_time:
- :ref:`float<class_float>` **oneshot_node_get_fadein_time** **(** :ref:`String<class_String>` id **)** |const|
Returns the fade in time of a OneShot node given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_get_fadeout_time:
- :ref:`float<class_float>` **oneshot_node_get_fadeout_time** **(** :ref:`String<class_String>` id **)** |const|
Returns the fade out time of a OneShot node given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_has_autorestart:
- :ref:`bool<class_bool>` **oneshot_node_has_autorestart** **(** :ref:`String<class_String>` id **)** |const|
Returns whether a OneShot node will auto restart given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_is_active:
- :ref:`bool<class_bool>` **oneshot_node_is_active** **(** :ref:`String<class_String>` id **)** |const|
Returns whether a OneShot node is active given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart:
- void **oneshot_node_set_autorestart** **(** :ref:`String<class_String>` id, :ref:`bool<class_bool>` enable **)**
Sets the autorestart property of a OneShot node given its name and value.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart_delay:
- void **oneshot_node_set_autorestart_delay** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` delay_sec **)**
Sets the autorestart delay of a OneShot node given its name and value in seconds.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_autorestart_random_delay:
- void **oneshot_node_set_autorestart_random_delay** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` rand_sec **)**
Sets the autorestart random delay of a OneShot node given its name and value in seconds.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_fadein_time:
- void **oneshot_node_set_fadein_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
Sets the fade in time of a OneShot node given its name and value in seconds.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_fadeout_time:
- void **oneshot_node_set_fadeout_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
Sets the fade out time of a OneShot node given its name and value in seconds.
----
.. _class_AnimationTreePlayer_method_oneshot_node_set_filter_path:
- void **oneshot_node_set_filter_path** **(** :ref:`String<class_String>` id, :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
If ``enable`` is ``true``, the OneShot node with ID ``id`` turns off the track modifying the property at ``path``. The modified node's children continue to animate.
----
.. _class_AnimationTreePlayer_method_oneshot_node_start:
- void **oneshot_node_start** **(** :ref:`String<class_String>` id **)**
Starts a OneShot node given its name.
----
.. _class_AnimationTreePlayer_method_oneshot_node_stop:
- void **oneshot_node_stop** **(** :ref:`String<class_String>` id **)**
Stops the OneShot node with name ``id``.
----
.. _class_AnimationTreePlayer_method_recompute_caches:
- void **recompute_caches** **(** **)**
Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state.
----
.. _class_AnimationTreePlayer_method_remove_node:
- void **remove_node** **(** :ref:`String<class_String>` id **)**
Removes the animation node with name ``id``.
----
.. _class_AnimationTreePlayer_method_reset:
- void **reset** **(** **)**
Resets this ``AnimationTreePlayer``.
----
.. _class_AnimationTreePlayer_method_timescale_node_get_scale:
- :ref:`float<class_float>` **timescale_node_get_scale** **(** :ref:`String<class_String>` id **)** |const|
Returns the time scale value of the TimeScale node with name ``id``.
----
.. _class_AnimationTreePlayer_method_timescale_node_set_scale:
- void **timescale_node_set_scale** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` scale **)**
Sets the time scale of the TimeScale node with name ``id`` to ``scale``.
The TimeScale node is used to speed :ref:`Animation<class_Animation>`\ s up if the scale is above 1 or slow them down if it is below 1.
If applied after a blend or mix, affects all input animations to that blend or mix.
----
.. _class_AnimationTreePlayer_method_timeseek_node_seek:
- void **timeseek_node_seek** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` seconds **)**
Sets the time seek value of the TimeSeek node with name ``id`` to ``seconds``.
This functions as a seek in the :ref:`Animation<class_Animation>` or the blend or mix of :ref:`Animation<class_Animation>`\ s input in it.
----
.. _class_AnimationTreePlayer_method_transition_node_delete_input:
- void **transition_node_delete_input** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)**
Deletes the input at ``input_idx`` for the transition node with name ``id``.
----
.. _class_AnimationTreePlayer_method_transition_node_get_current:
- :ref:`int<class_int>` **transition_node_get_current** **(** :ref:`String<class_String>` id **)** |const|
Returns the index of the currently evaluated input for the transition node with name ``id``.
----
.. _class_AnimationTreePlayer_method_transition_node_get_input_count:
- :ref:`int<class_int>` **transition_node_get_input_count** **(** :ref:`String<class_String>` id **)** |const|
Returns the number of inputs for the transition node with name ``id``. You can add inputs by right-clicking on the transition node.
----
.. _class_AnimationTreePlayer_method_transition_node_get_xfade_time:
- :ref:`float<class_float>` **transition_node_get_xfade_time** **(** :ref:`String<class_String>` id **)** |const|
Returns the cross fade time for the transition node with name ``id``.
----
.. _class_AnimationTreePlayer_method_transition_node_has_input_auto_advance:
- :ref:`bool<class_bool>` **transition_node_has_input_auto_advance** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)** |const|
Returns ``true`` if the input at ``input_idx`` on the transition node with name ``id`` is set to automatically advance to the next input upon completion.
----
.. _class_AnimationTreePlayer_method_transition_node_set_current:
- void **transition_node_set_current** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx **)**
The transition node with name ``id`` sets its current input at ``input_idx``.
----
.. _class_AnimationTreePlayer_method_transition_node_set_input_auto_advance:
- void **transition_node_set_input_auto_advance** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` input_idx, :ref:`bool<class_bool>` enable **)**
The transition node with name ``id`` advances to its next input automatically when the input at ``input_idx`` completes.
----
.. _class_AnimationTreePlayer_method_transition_node_set_input_count:
- void **transition_node_set_input_count** **(** :ref:`String<class_String>` id, :ref:`int<class_int>` count **)**
Resizes the number of inputs available for the transition node with name ``id``.
----
.. _class_AnimationTreePlayer_method_transition_node_set_xfade_time:
- void **transition_node_set_xfade_time** **(** :ref:`String<class_String>` id, :ref:`float<class_float>` time_sec **)**
The transition node with name ``id`` sets its cross fade time to ``time_sec``.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

517
classes/class_area.rst Normal file
View File

@ -0,0 +1,517 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/Area.xml.
.. _class_Area:
Area
====
**Inherits:** :ref:`CollisionObject<class_CollisionObject>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
3D area for detection and physics and audio influence.
Description
-----------
3D area that detects :ref:`CollisionObject<class_CollisionObject>` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses.
Tutorials
---------
- `3D Platformer Demo <https://godotengine.org/asset-library/asset/125>`__
- `GUI in 3D Demo <https://godotengine.org/asset-library/asset/127>`__
Properties
----------
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area_property_angular_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area_property_audio_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area_property_audio_bus_override>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area_property_gravity>` | ``9.8`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area_property_gravity_distance_scale>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area_property_gravity_point>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`gravity_vec<class_Area_property_gravity_vec>` | ``Vector3( 0, -1, 0 )`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area_property_linear_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area_property_monitorable>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area_property_monitoring>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area_property_priority>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_amount<class_Area_property_reverb_bus_amount>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`reverb_bus_enable<class_Area_property_reverb_bus_enable>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`reverb_bus_name<class_Area_property_reverb_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_uniformity<class_Area_property_reverb_bus_uniformity>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`SpaceOverride<enum_Area_SpaceOverride>` | :ref:`space_override<class_Area_property_space_override>` | ``0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
Methods
-------
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_Area_signal_area_entered:
- **area_entered** **(** :ref:`Area<class_Area>` area **)**
Emitted when another Area enters this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area.
----
.. _class_Area_signal_area_exited:
- **area_exited** **(** :ref:`Area<class_Area>` area **)**
Emitted when another Area exits this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area.
----
.. _class_Area_signal_area_shape_entered:
- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area_rid`` the :ref:`RID<class_RID>` of the other Area's :ref:`CollisionObject<class_CollisionObject>` used by the :ref:`PhysicsServer<class_PhysicsServer>`.
\ ``area`` the other Area.
\ ``area_shape_index`` the index of the :ref:`Shape<class_Shape>` of the other Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``area.shape_owner_get_owner(area_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area_signal_area_shape_exited:
- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area_rid`` the :ref:`RID<class_RID>` of the other Area's :ref:`CollisionObject<class_CollisionObject>` used by the :ref:`PhysicsServer<class_PhysicsServer>`.
\ ``area`` the other Area.
\ ``area_shape_index`` the index of the :ref:`Shape<class_Shape>` of the other Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``area.shape_owner_get_owner(area_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area_signal_body_entered:
- **body_entered** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` enters this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
----
.. _class_Area_signal_body_exited:
- **body_exited** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` exits this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
----
.. _class_Area_signal_body_shape_entered:
- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`'s :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`MeshLibrary<class_MeshLibrary>`'s :ref:`CollisionObject<class_CollisionObject>` used by the :ref:`PhysicsServer<class_PhysicsServer>`.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
\ ``body_shape_index`` the index of the :ref:`Shape<class_Shape>` of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``body.shape_owner_get_owner(body_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area_signal_body_shape_exited:
- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`'s :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`MeshLibrary<class_MeshLibrary>`'s :ref:`CollisionObject<class_CollisionObject>` used by the :ref:`PhysicsServer<class_PhysicsServer>`.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
\ ``body_shape_index`` the index of the :ref:`Shape<class_Shape>` of the :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``body.shape_owner_get_owner(body_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
Enumerations
------------
.. _enum_Area_SpaceOverride:
.. _class_Area_constant_SPACE_OVERRIDE_DISABLED:
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE:
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE:
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
enum **SpaceOverride**:
- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping.
- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order).
- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order), ignoring any lower priority areas.
- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area_property_priority>` order), but keeps calculating the rest of the areas.
Property Descriptions
---------------------
.. _class_Area_property_angular_damp:
- :ref:`float<class_float>` **angular_damp**
+-----------+-------------------------+
| *Default* | ``0.1`` |
+-----------+-------------------------+
| *Setter* | set_angular_damp(value) |
+-----------+-------------------------+
| *Getter* | get_angular_damp() |
+-----------+-------------------------+
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
See :ref:`ProjectSettings.physics/3d/default_angular_damp<class_ProjectSettings_property_physics/3d/default_angular_damp>` for more details about damping.
----
.. _class_Area_property_audio_bus_name:
- :ref:`String<class_String>` **audio_bus_name**
+-----------+----------------------+
| *Default* | ``"Master"`` |
+-----------+----------------------+
| *Setter* | set_audio_bus(value) |
+-----------+----------------------+
| *Getter* | get_audio_bus() |
+-----------+----------------------+
The name of the area's audio bus.
----
.. _class_Area_property_audio_bus_override:
- :ref:`bool<class_bool>` **audio_bus_override**
+-----------+-------------------------------+
| *Default* | ``false`` |
+-----------+-------------------------------+
| *Setter* | set_audio_bus_override(value) |
+-----------+-------------------------------+
| *Getter* | is_overriding_audio_bus() |
+-----------+-------------------------------+
If ``true``, the area's audio bus overrides the default audio bus.
----
.. _class_Area_property_gravity:
- :ref:`float<class_float>` **gravity**
+-----------+--------------------+
| *Default* | ``9.8`` |
+-----------+--------------------+
| *Setter* | set_gravity(value) |
+-----------+--------------------+
| *Getter* | get_gravity() |
+-----------+--------------------+
The area's gravity intensity (in meters per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
----
.. _class_Area_property_gravity_distance_scale:
- :ref:`float<class_float>` **gravity_distance_scale**
+-----------+-----------------------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------------------+
| *Setter* | set_gravity_distance_scale(value) |
+-----------+-----------------------------------+
| *Getter* | get_gravity_distance_scale() |
+-----------+-----------------------------------+
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
----
.. _class_Area_property_gravity_point:
- :ref:`bool<class_bool>` **gravity_point**
+-----------+-----------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------+
| *Setter* | set_gravity_is_point(value) |
+-----------+-----------------------------+
| *Getter* | is_gravity_a_point() |
+-----------+-----------------------------+
If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec<class_Area_property_gravity_vec>`). See also :ref:`space_override<class_Area_property_space_override>`.
----
.. _class_Area_property_gravity_vec:
- :ref:`Vector3<class_Vector3>` **gravity_vec**
+-----------+---------------------------+
| *Default* | ``Vector3( 0, -1, 0 )`` |
+-----------+---------------------------+
| *Setter* | set_gravity_vector(value) |
+-----------+---------------------------+
| *Getter* | get_gravity_vector() |
+-----------+---------------------------+
The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point<class_Area_property_gravity_point>`), this will be the point of attraction.
----
.. _class_Area_property_linear_damp:
- :ref:`float<class_float>` **linear_damp**
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_linear_damp(value) |
+-----------+------------------------+
| *Getter* | get_linear_damp() |
+-----------+------------------------+
The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
See :ref:`ProjectSettings.physics/3d/default_linear_damp<class_ProjectSettings_property_physics/3d/default_linear_damp>` for more details about damping.
----
.. _class_Area_property_monitorable:
- :ref:`bool<class_bool>` **monitorable**
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_monitorable(value) |
+-----------+------------------------+
| *Getter* | is_monitorable() |
+-----------+------------------------+
If ``true``, other monitoring areas can detect this area.
----
.. _class_Area_property_monitoring:
- :ref:`bool<class_bool>` **monitoring**
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_monitoring(value) |
+-----------+-----------------------+
| *Getter* | is_monitoring() |
+-----------+-----------------------+
If ``true``, the area detects bodies or areas entering and exiting it.
----
.. _class_Area_property_priority:
- :ref:`float<class_float>` **priority**
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
The area's priority. Higher priority areas are processed first.
----
.. _class_Area_property_reverb_bus_amount:
- :ref:`float<class_float>` **reverb_bus_amount**
+-----------+--------------------------+
| *Default* | ``0.0`` |
+-----------+--------------------------+
| *Setter* | set_reverb_amount(value) |
+-----------+--------------------------+
| *Getter* | get_reverb_amount() |
+-----------+--------------------------+
The degree to which this area applies reverb to its associated audio. Ranges from ``0`` to ``1`` with ``0.1`` precision.
----
.. _class_Area_property_reverb_bus_enable:
- :ref:`bool<class_bool>` **reverb_bus_enable**
+-----------+---------------------------+
| *Default* | ``false`` |
+-----------+---------------------------+
| *Setter* | set_use_reverb_bus(value) |
+-----------+---------------------------+
| *Getter* | is_using_reverb_bus() |
+-----------+---------------------------+
If ``true``, the area applies reverb to its associated audio.
----
.. _class_Area_property_reverb_bus_name:
- :ref:`String<class_String>` **reverb_bus_name**
+-----------+-----------------------+
| *Default* | ``"Master"`` |
+-----------+-----------------------+
| *Setter* | set_reverb_bus(value) |
+-----------+-----------------------+
| *Getter* | get_reverb_bus() |
+-----------+-----------------------+
The reverb bus name to use for this area's associated audio.
----
.. _class_Area_property_reverb_bus_uniformity:
- :ref:`float<class_float>` **reverb_bus_uniformity**
+-----------+------------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------------+
| *Setter* | set_reverb_uniformity(value) |
+-----------+------------------------------+
| *Getter* | get_reverb_uniformity() |
+-----------+------------------------------+
The degree to which this area's reverb is a uniform effect. Ranges from ``0`` to ``1`` with ``0.1`` precision.
----
.. _class_Area_property_space_override:
- :ref:`SpaceOverride<enum_Area_SpaceOverride>` **space_override**
+-----------+--------------------------------+
| *Default* | ``0`` |
+-----------+--------------------------------+
| *Setter* | set_space_override_mode(value) |
+-----------+--------------------------------+
| *Getter* | get_space_override_mode() |
+-----------+--------------------------------+
Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride<enum_Area_SpaceOverride>` for possible values.
Method Descriptions
-------------------
.. _class_Area_method_get_overlapping_areas:
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
Returns a list of intersecting ``Area``\ s. The overlapping area's :ref:`CollisionObject.collision_layer<class_CollisionObject_property_collision_layer>` must be part of this area's :ref:`CollisionObject.collision_mask<class_CollisionObject_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
----
.. _class_Area_method_get_overlapping_bodies:
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
Returns a list of intersecting :ref:`PhysicsBody<class_PhysicsBody>`\ s. The overlapping body's :ref:`CollisionObject.collision_layer<class_CollisionObject_property_collision_layer>` must be part of this area's :ref:`CollisionObject.collision_mask<class_CollisionObject_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
----
.. _class_Area_method_overlaps_area:
- :ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
If ``true``, the given area overlaps the Area.
\ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
----
.. _class_Area_method_overlaps_body:
- :ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
If ``true``, the given physics body overlaps the Area.
\ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
The ``body`` argument can either be a :ref:`PhysicsBody<class_PhysicsBody>` or a :ref:`GridMap<class_GridMap>` instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

449
classes/class_area2d.rst Normal file
View File

@ -0,0 +1,449 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/Area2D.xml.
.. _class_Area2D:
Area2D
======
**Inherits:** :ref:`CollisionObject2D<class_CollisionObject2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
2D area for detection and physics and audio influence.
Description
-----------
2D area that detects :ref:`CollisionObject2D<class_CollisionObject2D>` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus.
Tutorials
---------
- :doc:`Using Area2D <../tutorials/physics/using_area_2d>`
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
- `2D Pong Demo <https://godotengine.org/asset-library/asset/121>`__
- `2D Platformer Demo <https://godotengine.org/asset-library/asset/120>`__
Properties
----------
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area2D_property_angular_damp>` | ``1.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area2D_property_audio_bus_name>` | ``"Master"`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area2D_property_audio_bus_override>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area2D_property_gravity>` | ``98.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area2D_property_gravity_distance_scale>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area2D_property_gravity_point>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_vec<class_Area2D_property_gravity_vec>` | ``Vector2( 0, 1 )`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area2D_property_linear_damp>` | ``0.1`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area2D_property_monitorable>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area2D_property_monitoring>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area2D_property_priority>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`space_override<class_Area2D_property_space_override>` | ``0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
Methods
-------
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area2D_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area2D_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area2D_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area2D_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_Area2D_signal_area_entered:
- **area_entered** **(** :ref:`Area2D<class_Area2D>` area **)**
Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area2D.
----
.. _class_Area2D_signal_area_exited:
- **area_exited** **(** :ref:`Area2D<class_Area2D>` area **)**
Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area2D.
----
.. _class_Area2D_signal_area_shape_entered:
- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area_rid`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
\ ``area`` the other Area2D.
\ ``area_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``area.shape_owner_get_owner(area_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area2D_signal_area_shape_exited:
- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area_rid`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
\ ``area`` the other Area2D.
\ ``area_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``area.shape_owner_get_owner(area_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area2D_signal_body_entered:
- **body_entered** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` enters this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
----
.. _class_Area2D_signal_body_exited:
- **body_exited** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` exits this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
----
.. _class_Area2D_signal_body_shape_entered:
- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
\ ``body_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``body.shape_owner_get_owner(body_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
----
.. _class_Area2D_signal_body_shape_exited:
- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
\ ``body_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``body.shape_owner_get_owner(body_shape_index)``.
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
Enumerations
------------
.. _enum_Area2D_SpaceOverride:
.. _class_Area2D_constant_SPACE_OVERRIDE_DISABLED:
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE:
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE:
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
enum **SpaceOverride**:
- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping.
- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order).
- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), ignoring any lower priority areas.
- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), but keeps calculating the rest of the areas.
Property Descriptions
---------------------
.. _class_Area2D_property_angular_damp:
- :ref:`float<class_float>` **angular_damp**
+-----------+-------------------------+
| *Default* | ``1.0`` |
+-----------+-------------------------+
| *Setter* | set_angular_damp(value) |
+-----------+-------------------------+
| *Getter* | get_angular_damp() |
+-----------+-------------------------+
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
See :ref:`ProjectSettings.physics/2d/default_angular_damp<class_ProjectSettings_property_physics/2d/default_angular_damp>` for more details about damping.
----
.. _class_Area2D_property_audio_bus_name:
- :ref:`String<class_String>` **audio_bus_name**
+-----------+---------------------------+
| *Default* | ``"Master"`` |
+-----------+---------------------------+
| *Setter* | set_audio_bus_name(value) |
+-----------+---------------------------+
| *Getter* | get_audio_bus_name() |
+-----------+---------------------------+
The name of the area's audio bus.
----
.. _class_Area2D_property_audio_bus_override:
- :ref:`bool<class_bool>` **audio_bus_override**
+-----------+-------------------------------+
| *Default* | ``false`` |
+-----------+-------------------------------+
| *Setter* | set_audio_bus_override(value) |
+-----------+-------------------------------+
| *Getter* | is_overriding_audio_bus() |
+-----------+-------------------------------+
If ``true``, the area's audio bus overrides the default audio bus.
----
.. _class_Area2D_property_gravity:
- :ref:`float<class_float>` **gravity**
+-----------+--------------------+
| *Default* | ``98.0`` |
+-----------+--------------------+
| *Setter* | set_gravity(value) |
+-----------+--------------------+
| *Getter* | get_gravity() |
+-----------+--------------------+
The area's gravity intensity (in pixels per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
----
.. _class_Area2D_property_gravity_distance_scale:
- :ref:`float<class_float>` **gravity_distance_scale**
+-----------+-----------------------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------------------+
| *Setter* | set_gravity_distance_scale(value) |
+-----------+-----------------------------------+
| *Getter* | get_gravity_distance_scale() |
+-----------+-----------------------------------+
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
----
.. _class_Area2D_property_gravity_point:
- :ref:`bool<class_bool>` **gravity_point**
+-----------+-----------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------+
| *Setter* | set_gravity_is_point(value) |
+-----------+-----------------------------+
| *Getter* | is_gravity_a_point() |
+-----------+-----------------------------+
If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec<class_Area2D_property_gravity_vec>`). See also :ref:`space_override<class_Area2D_property_space_override>`.
----
.. _class_Area2D_property_gravity_vec:
- :ref:`Vector2<class_Vector2>` **gravity_vec**
+-----------+---------------------------+
| *Default* | ``Vector2( 0, 1 )`` |
+-----------+---------------------------+
| *Setter* | set_gravity_vector(value) |
+-----------+---------------------------+
| *Getter* | get_gravity_vector() |
+-----------+---------------------------+
The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point<class_Area2D_property_gravity_point>`), this will be the point of attraction.
----
.. _class_Area2D_property_linear_damp:
- :ref:`float<class_float>` **linear_damp**
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_linear_damp(value) |
+-----------+------------------------+
| *Getter* | get_linear_damp() |
+-----------+------------------------+
The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
See :ref:`ProjectSettings.physics/2d/default_linear_damp<class_ProjectSettings_property_physics/2d/default_linear_damp>` for more details about damping.
----
.. _class_Area2D_property_monitorable:
- :ref:`bool<class_bool>` **monitorable**
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_monitorable(value) |
+-----------+------------------------+
| *Getter* | is_monitorable() |
+-----------+------------------------+
If ``true``, other monitoring areas can detect this area.
----
.. _class_Area2D_property_monitoring:
- :ref:`bool<class_bool>` **monitoring**
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_monitoring(value) |
+-----------+-----------------------+
| *Getter* | is_monitoring() |
+-----------+-----------------------+
If ``true``, the area detects bodies or areas entering and exiting it.
----
.. _class_Area2D_property_priority:
- :ref:`float<class_float>` **priority**
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
The area's priority. Higher priority areas are processed first.
----
.. _class_Area2D_property_space_override:
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **space_override**
+-----------+--------------------------------+
| *Default* | ``0`` |
+-----------+--------------------------------+
| *Setter* | set_space_override_mode(value) |
+-----------+--------------------------------+
| *Getter* | get_space_override_mode() |
+-----------+--------------------------------+
Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` for possible values.
Method Descriptions
-------------------
.. _class_Area2D_method_get_overlapping_areas:
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
Returns a list of intersecting ``Area2D``\ s. The overlapping area's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
----
.. _class_Area2D_method_get_overlapping_bodies:
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
Returns a list of intersecting :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s. The overlapping body's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
----
.. _class_Area2D_method_overlaps_area:
- :ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
If ``true``, the given area overlaps the Area2D.
\ **Note:** The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
----
.. _class_Area2D_method_overlaps_body:
- :ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
If ``true``, the given physics body overlaps the Area2D.
\ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
The ``body`` argument can either be a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or a :ref:`TileMap<class_TileMap>` instance (while TileMaps are not physics bodies themselves, they register their tiles with collision shapes as a virtual physics body).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

546
classes/class_array.rst Normal file
View File

@ -0,0 +1,546 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/Array.xml.
.. _class_Array:
Array
=====
A generic array datatype.
Description
-----------
A generic array that can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 is the second to last, etc.).
\ **Example:**\
::
var array = ["One", 2, 3, "Four"]
print(array[0]) # One.
print(array[2]) # 3.
print(array[-1]) # Four.
array[2] = "Three"
print(array[-2]) # Three.
Arrays can be concatenated using the ``+`` operator:
::
var array1 = ["One", 2]
var array2 = [3, "Four"]
print(array1 + array2) # ["One", 2, 3, "Four"]
\ **Note:** Concatenating with the ``+=`` operator will create a new array, which has a cost. If you want to append another array to an existing array, :ref:`append_array<class_Array_method_append_array>` is more efficient.
\ **Note:** Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use :ref:`duplicate<class_Array_method_duplicate>`.
\ **Note:** When declaring an array with ``const``, the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using ``const`` will only prevent assigning the constant with another value after it was initialized.
Methods
-------
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append<class_Array_method_append>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append_array<class_Array_method_append_array>` **(** :ref:`Array<class_Array>` array **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`back<class_Array_method_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch<class_Array_method_bsearch>` **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch_custom<class_Array_method_bsearch_custom>` **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_Array_method_clear>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`count<class_Array_method_count>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`duplicate<class_Array_method_duplicate>` **(** :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`empty<class_Array_method_empty>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`erase<class_Array_method_erase>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`fill<class_Array_method_fill>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find<class_Array_method_find>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_last<class_Array_method_find_last>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`front<class_Array_method_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has<class_Array_method_has>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`hash<class_Array_method_hash>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`insert<class_Array_method_insert>` **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`invert<class_Array_method_invert>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`max<class_Array_method_max>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`min<class_Array_method_min>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_at<class_Array_method_pop_at>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_back<class_Array_method_pop_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_front<class_Array_method_pop_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_back<class_Array_method_push_back>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_front<class_Array_method_push_front>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove<class_Array_method_remove>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_Array_method_resize>` **(** :ref:`int<class_int>` size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`rfind<class_Array_method_rfind>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`shuffle<class_Array_method_shuffle>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_Array_method_size>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`slice<class_Array_method_slice>` **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort<class_Array_method_sort>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort_custom<class_Array_method_sort_custom>` **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_Array_method_Array:
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)**
Constructs an array from a :ref:`PoolColorArray<class_PoolColorArray>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)**
Constructs an array from a :ref:`PoolVector3Array<class_PoolVector3Array>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)**
Constructs an array from a :ref:`PoolVector2Array<class_PoolVector2Array>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)**
Constructs an array from a :ref:`PoolStringArray<class_PoolStringArray>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)**
Constructs an array from a :ref:`PoolRealArray<class_PoolRealArray>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)**
Constructs an array from a :ref:`PoolIntArray<class_PoolIntArray>`.
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)**
Constructs an array from a :ref:`PoolByteArray<class_PoolByteArray>`.
----
.. _class_Array_method_append:
- void **append** **(** :ref:`Variant<class_Variant>` value **)**
Appends an element at the end of the array (alias of :ref:`push_back<class_Array_method_push_back>`).
----
.. _class_Array_method_append_array:
- void **append_array** **(** :ref:`Array<class_Array>` array **)**
Appends another array at the end of this array.
::
var array1 = [1, 2, 3]
var array2 = [4, 5, 6]
array1.append_array(array2)
print(array1) # Prints [1, 2, 3, 4, 5, 6].
----
.. _class_Array_method_back:
- :ref:`Variant<class_Variant>` **back** **(** **)**
Returns the last element of the array. Prints an error and returns ``null`` if the array is empty.
\ **Note:** Calling this function is not the same as writing ``array[-1]``. If the array is empty, accessing by index will pause project execution when running from the editor.
----
.. _class_Array_method_bsearch:
- :ref:`int<class_int>` **bsearch** **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)**
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array.
\ **Note:** Calling :ref:`bsearch<class_Array_method_bsearch>` on an unsorted array results in unexpected behavior.
----
.. _class_Array_method_bsearch_custom:
- :ref:`int<class_int>` **bsearch_custom** **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)**
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method declared in the ``obj``. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return ``true`` if the first argument is less than the second, and return ``false`` otherwise.
::
func cardinal_to_algebraic(a):
match a:
"one":
return 1
"two":
return 2
"three":
return 3
"four":
return 4
_:
return 0
func compare(a, b):
return cardinal_to_algebraic(a) < cardinal_to_algebraic(b)
func _ready():
var a = ["one", "two", "three", "four"]
# `compare` is defined in this object, so we use `self` as the `obj` parameter.
print(a.bsearch_custom("three", self, "compare", true)) # Expected value is 2.
\ **Note:** Calling :ref:`bsearch_custom<class_Array_method_bsearch_custom>` on an unsorted array results in unexpected behavior.
----
.. _class_Array_method_clear:
- void **clear** **(** **)**
Clears the array. This is equivalent to using :ref:`resize<class_Array_method_resize>` with a size of ``0``.
----
.. _class_Array_method_count:
- :ref:`int<class_int>` **count** **(** :ref:`Variant<class_Variant>` value **)**
Returns the number of times an element is in the array.
----
.. _class_Array_method_duplicate:
- :ref:`Array<class_Array>` **duplicate** **(** :ref:`bool<class_bool>` deep=false **)**
Returns a copy of the array.
If ``deep`` is ``true``, a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If ``false``, a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array.
----
.. _class_Array_method_empty:
- :ref:`bool<class_bool>` **empty** **(** **)**
Returns ``true`` if the array is empty.
----
.. _class_Array_method_erase:
- void **erase** **(** :ref:`Variant<class_Variant>` value **)**
Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use :ref:`remove<class_Array_method_remove>` instead.
\ **Note:** This method acts in-place and doesn't return a value.
\ **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
----
.. _class_Array_method_fill:
- void **fill** **(** :ref:`Variant<class_Variant>` value **)**
Assigns the given value to all elements in the array. This can typically be used together with :ref:`resize<class_Array_method_resize>` to create an array with a given size and initialized elements:
::
var array = []
array.resize(10)
array.fill(0) # Initialize the 10 elements to 0.
----
.. _class_Array_method_find:
- :ref:`int<class_int>` **find** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)**
Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds.
----
.. _class_Array_method_find_last:
- :ref:`int<class_int>` **find_last** **(** :ref:`Variant<class_Variant>` value **)**
Searches the array in reverse order for a value and returns its index or ``-1`` if not found.
----
.. _class_Array_method_front:
- :ref:`Variant<class_Variant>` **front** **(** **)**
Returns the first element of the array. Prints an error and returns ``null`` if the array is empty.
\ **Note:** Calling this function is not the same as writing ``array[0]``. If the array is empty, accessing by index will pause project execution when running from the editor.
----
.. _class_Array_method_has:
- :ref:`bool<class_bool>` **has** **(** :ref:`Variant<class_Variant>` value **)**
Returns ``true`` if the array contains the given value.
::
["inside", 7].has("inside") # True
["inside", 7].has("outside") # False
["inside", 7].has(7) # True
["inside", 7].has("7") # False
\ **Note:** This is equivalent to using the ``in`` operator as follows:
::
# Will evaluate to `true`.
if 2 in [2, 4, 6, 8]:
pass
----
.. _class_Array_method_hash:
- :ref:`int<class_int>` **hash** **(** **)**
Returns a hashed 32-bit integer value representing the array and its contents.
\ **Note:** ``Array``\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the arrays are equal, because different arrays can have identical hash values due to hash collisions.
----
.. _class_Array_method_insert:
- void **insert** **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)**
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``pos == size()``).
\ **Note:** This method acts in-place and doesn't return a value.
\ **Note:** On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed.
----
.. _class_Array_method_invert:
- void **invert** **(** **)**
Reverses the order of the elements in the array.
----
.. _class_Array_method_max:
- :ref:`Variant<class_Variant>` **max** **(** **)**
Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned.
----
.. _class_Array_method_min:
- :ref:`Variant<class_Variant>` **min** **(** **)**
Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned.
----
.. _class_Array_method_pop_at:
- :ref:`Variant<class_Variant>` **pop_at** **(** :ref:`int<class_int>` position **)**
Removes and returns the element of the array at index ``position``. If negative, ``position`` is considered relative to the end of the array. Leaves the array untouched and returns ``null`` if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
\ **Note:** On large arrays, this method can be slower than :ref:`pop_back<class_Array_method_pop_back>` as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower :ref:`pop_at<class_Array_method_pop_at>` will be.
----
.. _class_Array_method_pop_back:
- :ref:`Variant<class_Variant>` **pop_back** **(** **)**
Removes and returns the last element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_front<class_Array_method_pop_front>`.
----
.. _class_Array_method_pop_front:
- :ref:`Variant<class_Variant>` **pop_front** **(** **)**
Removes and returns the first element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_back<class_Array_method_pop_back>`.
\ **Note:** On large arrays, this method is much slower than :ref:`pop_back<class_Array_method_pop_back>` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`pop_front<class_Array_method_pop_front>` will be.
----
.. _class_Array_method_push_back:
- void **push_back** **(** :ref:`Variant<class_Variant>` value **)**
Appends an element at the end of the array. See also :ref:`push_front<class_Array_method_push_front>`.
----
.. _class_Array_method_push_front:
- void **push_front** **(** :ref:`Variant<class_Variant>` value **)**
Adds an element at the beginning of the array. See also :ref:`push_back<class_Array_method_push_back>`.
\ **Note:** On large arrays, this method is much slower than :ref:`push_back<class_Array_method_push_back>` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`push_front<class_Array_method_push_front>` will be.
----
.. _class_Array_method_remove:
- void **remove** **(** :ref:`int<class_int>` position **)**
Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use :ref:`erase<class_Array_method_erase>` instead.
\ **Note:** This method acts in-place and doesn't return a value.
\ **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
----
.. _class_Array_method_resize:
- void **resize** **(** :ref:`int<class_int>` size **)**
Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are ``null``.
----
.. _class_Array_method_rfind:
- :ref:`int<class_int>` **rfind** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)**
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array.
----
.. _class_Array_method_shuffle:
- void **shuffle** **(** **)**
Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as :ref:`@GDScript.randi<class_@GDScript_method_randi>`. Call :ref:`@GDScript.randomize<class_@GDScript_method_randomize>` to ensure that a new seed will be used each time if you want non-reproducible shuffling.
----
.. _class_Array_method_size:
- :ref:`int<class_int>` **size** **(** **)**
Returns the number of elements in the array.
----
.. _class_Array_method_slice:
- :ref:`Array<class_Array>` **slice** **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)**
Duplicates the subset described in the function and returns it in an array, deeply copying the array if ``deep`` is ``true``. Lower and upper index are inclusive, with the ``step`` describing the change between indices while slicing.
----
.. _class_Array_method_sort:
- void **sort** **(** **)**
Sorts the array.
\ **Note:** Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example:
::
var strings = ["string1", "string2", "string10", "string11"]
strings.sort()
print(strings) # Prints [string1, string10, string11, string2]
----
.. _class_Array_method_sort_custom:
- void **sort_custom** **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)**
Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either ``true`` or ``false``.
For two elements ``a`` and ``b``, if the given method returns ``true``, element ``b`` will be after element ``a`` in the array.
\ **Note:** You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
::
class MyCustomSorter:
static func sort_ascending(a, b):
if a[0] < b[0]:
return true
return false
var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]]
my_items.sort_custom(MyCustomSorter, "sort_ascending")
print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]].
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

387
classes/class_arraymesh.rst Normal file
View File

@ -0,0 +1,387 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ArrayMesh.xml.
.. _class_ArrayMesh:
ArrayMesh
=========
**Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
:ref:`Mesh<class_Mesh>` type that provides utility for constructing a surface from arrays.
Description
-----------
The ``ArrayMesh`` is used to construct a :ref:`Mesh<class_Mesh>` by specifying the attributes as arrays.
The most basic example is the creation of a single triangle:
::
var vertices = PoolVector3Array()
vertices.push_back(Vector3(0, 1, 0))
vertices.push_back(Vector3(1, 0, 0))
vertices.push_back(Vector3(0, 0, 1))
# Initialize the ArrayMesh.
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(ArrayMesh.ARRAY_MAX)
arrays[ArrayMesh.ARRAY_VERTEX] = vertices
# Create the Mesh.
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
var m = MeshInstance.new()
m.mesh = arr_mesh
The :ref:`MeshInstance<class_MeshInstance>` is ready to be added to the :ref:`SceneTree<class_SceneTree>` to be shown.
See also :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`MeshDataTool<class_MeshDataTool>` and :ref:`SurfaceTool<class_SurfaceTool>` for procedural geometry generation.
\ **Note:** Godot uses clockwise `winding order <https://learnopengl.com/Advanced-OpenGL/Face-culling>`__ for front faces of triangle primitive modes.
Tutorials
---------
- :doc:`../tutorials/3d/procedural_geometry/arraymesh`
Properties
----------
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` | :ref:`blend_shape_mode<class_ArrayMesh_property_blend_shape_mode>` | ``1`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_ArrayMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
Methods
-------
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_blend_shapes<class_ArrayMesh_method_clear_blend_shapes>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_surfaces<class_ArrayMesh_method_clear_surfaces>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ArrayMesh_method_get_blend_shape_count>` **(** **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_blend_shape_name<class_ArrayMesh_method_get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`lightmap_unwrap<class_ArrayMesh_method_lightmap_unwrap>` **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`regen_normalmaps<class_ArrayMesh_method_regen_normalmaps>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_find_by_name<class_ArrayMesh_method_surface_find_by_name>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_index_len<class_ArrayMesh_method_surface_get_array_index_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_len<class_ArrayMesh_method_surface_get_array_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_format<class_ArrayMesh_method_surface_get_format>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`surface_get_name<class_ArrayMesh_method_surface_get_name>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`surface_get_primitive_type<class_ArrayMesh_method_surface_get_primitive_type>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_remove<class_ArrayMesh_method_surface_remove>` **(** :ref:`int<class_int>` surf_idx **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_update_region<class_ArrayMesh_method_surface_update_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_ArrayMesh_ArrayType:
.. _class_ArrayMesh_constant_ARRAY_VERTEX:
.. _class_ArrayMesh_constant_ARRAY_NORMAL:
.. _class_ArrayMesh_constant_ARRAY_TANGENT:
.. _class_ArrayMesh_constant_ARRAY_COLOR:
.. _class_ArrayMesh_constant_ARRAY_TEX_UV:
.. _class_ArrayMesh_constant_ARRAY_TEX_UV2:
.. _class_ArrayMesh_constant_ARRAY_BONES:
.. _class_ArrayMesh_constant_ARRAY_WEIGHTS:
.. _class_ArrayMesh_constant_ARRAY_INDEX:
.. _class_ArrayMesh_constant_ARRAY_MAX:
enum **ArrayType**:
- **ARRAY_VERTEX** = **0** --- :ref:`PoolVector3Array<class_PoolVector3Array>`, :ref:`PoolVector2Array<class_PoolVector2Array>`, or :ref:`Array<class_Array>` of vertex positions.
- **ARRAY_NORMAL** = **1** --- :ref:`PoolVector3Array<class_PoolVector3Array>` of vertex normals.
- **ARRAY_TANGENT** = **2** --- :ref:`PoolRealArray<class_PoolRealArray>` of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
- **ARRAY_COLOR** = **3** --- :ref:`PoolColorArray<class_PoolColorArray>` of vertex colors.
- **ARRAY_TEX_UV** = **4** --- :ref:`PoolVector2Array<class_PoolVector2Array>` for UV coordinates.
- **ARRAY_TEX_UV2** = **5** --- :ref:`PoolVector2Array<class_PoolVector2Array>` for second UV coordinates.
- **ARRAY_BONES** = **6** --- :ref:`PoolRealArray<class_PoolRealArray>` or :ref:`PoolIntArray<class_PoolIntArray>` of bone indices. Each element in groups of 4 floats.
- **ARRAY_WEIGHTS** = **7** --- :ref:`PoolRealArray<class_PoolRealArray>` of bone weights. Each element in groups of 4 floats.
- **ARRAY_INDEX** = **8** --- :ref:`PoolIntArray<class_PoolIntArray>` of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
- **ARRAY_MAX** = **9** --- Represents the size of the :ref:`ArrayType<enum_ArrayMesh_ArrayType>` enum.
----
.. _enum_ArrayMesh_ArrayFormat:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TANGENT:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_COLOR:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV2:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_BONES:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_WEIGHTS:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_INDEX:
enum **ArrayFormat**:
- **ARRAY_FORMAT_VERTEX** = **1** --- Array format will include vertices (mandatory).
- **ARRAY_FORMAT_NORMAL** = **2** --- Array format will include normals.
- **ARRAY_FORMAT_TANGENT** = **4** --- Array format will include tangents.
- **ARRAY_FORMAT_COLOR** = **8** --- Array format will include a color array.
- **ARRAY_FORMAT_TEX_UV** = **16** --- Array format will include UVs.
- **ARRAY_FORMAT_TEX_UV2** = **32** --- Array format will include another set of UVs.
- **ARRAY_FORMAT_BONES** = **64** --- Array format will include bone indices.
- **ARRAY_FORMAT_WEIGHTS** = **128** --- Array format will include bone weights.
- **ARRAY_FORMAT_INDEX** = **256** --- Index array will be used.
Constants
---------
.. _class_ArrayMesh_constant_NO_INDEX_ARRAY:
.. _class_ArrayMesh_constant_ARRAY_WEIGHTS_SIZE:
- **NO_INDEX_ARRAY** = **-1** --- Value used internally when no indices are present.
- **ARRAY_WEIGHTS_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4).
Property Descriptions
---------------------
.. _class_ArrayMesh_property_blend_shape_mode:
- :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **blend_shape_mode**
+-----------+-----------------------------+
| *Default* | ``1`` |
+-----------+-----------------------------+
| *Setter* | set_blend_shape_mode(value) |
+-----------+-----------------------------+
| *Getter* | get_blend_shape_mode() |
+-----------+-----------------------------+
Sets the blend shape mode to one of :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`.
----
.. _class_ArrayMesh_property_custom_aabb:
- :ref:`AABB<class_AABB>` **custom_aabb**
+-----------+------------------------------+
| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-----------+------------------------------+
| *Setter* | set_custom_aabb(value) |
+-----------+------------------------------+
| *Getter* | get_custom_aabb() |
+-----------+------------------------------+
Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
Method Descriptions
-------------------
.. _class_ArrayMesh_method_add_blend_shape:
- void **add_blend_shape** **(** :ref:`String<class_String>` name **)**
Adds name for a blend shape that will be added with :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`. Must be called before surface is added.
----
.. _class_ArrayMesh_method_add_surface_from_arrays:
- void **add_surface_from_arrays** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)**
Creates a new surface.
Surfaces are created to be rendered using a ``primitive``, which may be any of the types defined in :ref:`PrimitiveType<enum_Mesh_PrimitiveType>`. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) :ref:`Mesh.get_surface_count<class_Mesh_method_get_surface_count>` will become the ``surf_idx`` for this new surface.
The ``arrays`` argument is an array of arrays. See :ref:`ArrayType<enum_ArrayMesh_ArrayType>` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for :ref:`ARRAY_INDEX<class_ArrayMesh_constant_ARRAY_INDEX>` if it is used.
----
.. _class_ArrayMesh_method_clear_blend_shapes:
- void **clear_blend_shapes** **(** **)**
Removes all blend shapes from this ``ArrayMesh``.
----
.. _class_ArrayMesh_method_clear_surfaces:
- void **clear_surfaces** **(** **)**
Removes all surfaces from this ``ArrayMesh``.
----
.. _class_ArrayMesh_method_get_blend_shape_count:
- :ref:`int<class_int>` **get_blend_shape_count** **(** **)** |const|
Returns the number of blend shapes that the ``ArrayMesh`` holds.
----
.. _class_ArrayMesh_method_get_blend_shape_name:
- :ref:`String<class_String>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |const|
Returns the name of the blend shape at this index.
----
.. _class_ArrayMesh_method_lightmap_unwrap:
- :ref:`Error<enum_@GlobalScope_Error>` **lightmap_unwrap** **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)**
Will perform a UV unwrap on the ``ArrayMesh`` to prepare the mesh for lightmapping.
----
.. _class_ArrayMesh_method_regen_normalmaps:
- void **regen_normalmaps** **(** **)**
Will regenerate normal maps for the ``ArrayMesh``.
----
.. _class_ArrayMesh_method_set_blend_shape_name:
- void **set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)**
----
.. _class_ArrayMesh_method_surface_find_by_name:
- :ref:`int<class_int>` **surface_find_by_name** **(** :ref:`String<class_String>` name **)** |const|
Returns the index of the first surface with this name held within this ``ArrayMesh``. If none are found, -1 is returned.
----
.. _class_ArrayMesh_method_surface_get_array_index_len:
- :ref:`int<class_int>` **surface_get_array_index_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
----
.. _class_ArrayMesh_method_surface_get_array_len:
- :ref:`int<class_int>` **surface_get_array_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
----
.. _class_ArrayMesh_method_surface_get_format:
- :ref:`int<class_int>` **surface_get_format** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
----
.. _class_ArrayMesh_method_surface_get_name:
- :ref:`String<class_String>` **surface_get_name** **(** :ref:`int<class_int>` surf_idx **)** |const|
Gets the name assigned to this surface.
----
.. _class_ArrayMesh_method_surface_get_primitive_type:
- :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **surface_get_primitive_type** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
----
.. _class_ArrayMesh_method_surface_remove:
- void **surface_remove** **(** :ref:`int<class_int>` surf_idx **)**
Removes a surface at position ``surf_idx``, shifting greater surfaces one ``surf_idx`` slot down.
----
.. _class_ArrayMesh_method_surface_set_name:
- void **surface_set_name** **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)**
Sets a name for a given surface.
----
.. _class_ArrayMesh_method_surface_update_region:
- void **surface_update_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)**
Updates a specified region of mesh arrays on the GPU.
\ **Warning:** Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,117 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRAnchor.xml.
.. _class_ARVRAnchor:
ARVRAnchor
==========
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
An anchor point in AR space.
Description
-----------
The ``ARVRAnchor`` point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized.
Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
Properties
----------
+-----------------------+-------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`anchor_id<class_ARVRAnchor_property_anchor_id>` | ``1`` |
+-----------------------+-------------------------------------------------------+-------+
Methods
-------
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_anchor_name<class_ARVRAnchor_method_get_anchor_name>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRAnchor_method_get_is_active>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRAnchor_method_get_mesh>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Plane<class_Plane>` | :ref:`get_plane<class_ARVRAnchor_method_get_plane>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_size<class_ARVRAnchor_method_get_size>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
Signals
-------
.. _class_ARVRAnchor_signal_mesh_updated:
- **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
Emitted when the mesh associated with the anchor changes or when one becomes available. This is especially important for topology that is constantly being ``mesh_updated``.
Property Descriptions
---------------------
.. _class_ARVRAnchor_property_anchor_id:
- :ref:`int<class_int>` **anchor_id**
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_anchor_id(value) |
+-----------+----------------------+
| *Getter* | get_anchor_id() |
+-----------+----------------------+
The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of ``1``, the second an ID of ``2``, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them.
Method Descriptions
-------------------
.. _class_ARVRAnchor_method_get_anchor_name:
- :ref:`String<class_String>` **get_anchor_name** **(** **)** |const|
Returns the name given to this anchor.
----
.. _class_ARVRAnchor_method_get_is_active:
- :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
Returns ``true`` if the anchor is being tracked and ``false`` if no anchor with this ID is currently known.
----
.. _class_ARVRAnchor_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes.
----
.. _class_ARVRAnchor_method_get_plane:
- :ref:`Plane<class_Plane>` **get_plane** **(** **)** |const|
Returns a plane aligned with our anchor; handy for intersection testing.
----
.. _class_ARVRAnchor_method_get_size:
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)** |const|
Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,31 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRCamera.xml.
.. _class_ARVRCamera:
ARVRCamera
==========
**Inherits:** :ref:`Camera<class_Camera>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A camera node with a few overrules for AR/VR applied, such as location tracking.
Description
-----------
This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes.
The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result.
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,184 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRController.xml.
.. _class_ARVRController:
ARVRController
==============
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
A spatial node representing a spatially-tracked controller.
Description
-----------
This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene.
The position of the controller node is automatically updated by the :ref:`ARVRServer<class_ARVRServer>`. This makes this node ideal to add child nodes to visualize the controller.
Tutorials
---------
- :doc:`../tutorials/vr/index`
Properties
----------
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`controller_id<class_ARVRController_property_controller_id>` | ``1`` |
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRController_property_rumble>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+---------+
Methods
-------
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_controller_name<class_ARVRController_method_get_controller_name>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRController_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRController_method_get_is_active>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_joystick_axis<class_ARVRController_method_get_joystick_axis>` **(** :ref:`int<class_int>` axis **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joystick_id<class_ARVRController_method_get_joystick_id>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRController_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`is_button_pressed<class_ARVRController_method_is_button_pressed>` **(** :ref:`int<class_int>` button **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_ARVRController_signal_button_pressed:
- **button_pressed** **(** :ref:`int<class_int>` button **)**
Emitted when a button on this controller is pressed.
----
.. _class_ARVRController_signal_button_release:
- **button_release** **(** :ref:`int<class_int>` button **)**
Emitted when a button on this controller is released.
----
.. _class_ARVRController_signal_mesh_updated:
- **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
Emitted when the mesh associated with the controller changes or when one becomes available. Generally speaking this will be a static mesh after becoming available.
Property Descriptions
---------------------
.. _class_ARVRController_property_controller_id:
- :ref:`int<class_int>` **controller_id**
+-----------+--------------------------+
| *Default* | ``1`` |
+-----------+--------------------------+
| *Setter* | set_controller_id(value) |
+-----------+--------------------------+
| *Getter* | get_controller_id() |
+-----------+--------------------------+
The controller's ID.
A controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller.
For any other controller that the :ref:`ARVRServer<class_ARVRServer>` detects, we continue with controller ID 3.
When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off.
----
.. _class_ARVRController_property_rumble:
- :ref:`float<class_float>` **rumble**
+-----------+-------------------+
| *Default* | ``0.0`` |
+-----------+-------------------+
| *Setter* | set_rumble(value) |
+-----------+-------------------+
| *Getter* | get_rumble() |
+-----------+-------------------+
The degree to which the controller vibrates. Ranges from ``0.0`` to ``1.0``. If changed, updates :ref:`ARVRPositionalTracker.rumble<class_ARVRPositionalTracker_property_rumble>` accordingly.
This is a useful property to animate if you want the controller to vibrate for a limited duration.
Method Descriptions
-------------------
.. _class_ARVRController_method_get_controller_name:
- :ref:`String<class_String>` **get_controller_name** **(** **)** |const|
If active, returns the name of the associated controller if provided by the AR/VR SDK used.
----
.. _class_ARVRController_method_get_hand:
- :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
Returns the hand holding this controller, if known. See :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>`.
----
.. _class_ARVRController_method_get_is_active:
- :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
Returns ``true`` if the bound controller is active. ARVR systems attempt to track active controllers.
----
.. _class_ARVRController_method_get_joystick_axis:
- :ref:`float<class_float>` **get_joystick_axis** **(** :ref:`int<class_int>` axis **)** |const|
Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller.
----
.. _class_ARVRController_method_get_joystick_id:
- :ref:`int<class_int>` **get_joystick_id** **(** **)** |const|
Returns the ID of the joystick object bound to this. Every controller tracked by the :ref:`ARVRServer<class_ARVRServer>` that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry.
----
.. _class_ARVRController_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh associated with the controller. This can be used to visualize the controller.
----
.. _class_ARVRController_method_is_button_pressed:
- :ref:`int<class_int>` **is_button_pressed** **(** :ref:`int<class_int>` button **)** |const|
Returns ``true`` if the button at index ``button`` is pressed. See :ref:`JoystickList<enum_@GlobalScope_JoystickList>`, in particular the ``JOY_VR_*`` constants.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,258 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRInterface.xml.
.. _class_ARVRInterface:
ARVRInterface
=============
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`ARVRInterfaceGDNative<class_ARVRInterfaceGDNative>`, :ref:`MobileVRInterface<class_MobileVRInterface>`, :ref:`WebXRInterface<class_WebXRInterface>`
Base class for an AR/VR interface implementation.
Description
-----------
This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDNative modules (note that for GDNative the subclass ARVRScriptInterface should be used). Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform.
Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through :ref:`ARVRServer<class_ARVRServer>`.
Tutorials
---------
- :doc:`../tutorials/vr/index`
Properties
----------
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`ar_is_anchor_detection_enabled<class_ARVRInterface_property_ar_is_anchor_detection_enabled>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_initialized<class_ARVRInterface_property_interface_is_initialized>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_primary<class_ARVRInterface_property_interface_is_primary>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
Methods
-------
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_camera_feed_id<class_ARVRInterface_method_get_camera_feed_id>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_capabilities<class_ARVRInterface_method_get_capabilities>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRInterface_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` | :ref:`get_tracking_status<class_ARVRInterface_method_get_tracking_status>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_ARVRInterface_method_initialize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_stereo<class_ARVRInterface_method_is_stereo>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| void | :ref:`uninitialize<class_ARVRInterface_method_uninitialize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_ARVRInterface_Capabilities:
.. _class_ARVRInterface_constant_ARVR_NONE:
.. _class_ARVRInterface_constant_ARVR_MONO:
.. _class_ARVRInterface_constant_ARVR_STEREO:
.. _class_ARVRInterface_constant_ARVR_AR:
.. _class_ARVRInterface_constant_ARVR_EXTERNAL:
enum **Capabilities**:
- **ARVR_NONE** = **0** --- No ARVR capabilities.
- **ARVR_MONO** = **1** --- This interface can work with normal rendering output (non-HMD based AR).
- **ARVR_STEREO** = **2** --- This interface supports stereoscopic rendering.
- **ARVR_AR** = **4** --- This interface supports AR (video background and real world tracking).
- **ARVR_EXTERNAL** = **8** --- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>`). Using a separate viewport node frees up the main viewport for other purposes.
----
.. _enum_ARVRInterface_Eyes:
.. _class_ARVRInterface_constant_EYE_MONO:
.. _class_ARVRInterface_constant_EYE_LEFT:
.. _class_ARVRInterface_constant_EYE_RIGHT:
enum **Eyes**:
- **EYE_MONO** = **0** --- Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
- **EYE_LEFT** = **1** --- Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information.
- **EYE_RIGHT** = **2** --- Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
----
.. _enum_ARVRInterface_Tracking_status:
.. _class_ARVRInterface_constant_ARVR_NORMAL_TRACKING:
.. _class_ARVRInterface_constant_ARVR_EXCESSIVE_MOTION:
.. _class_ARVRInterface_constant_ARVR_INSUFFICIENT_FEATURES:
.. _class_ARVRInterface_constant_ARVR_UNKNOWN_TRACKING:
.. _class_ARVRInterface_constant_ARVR_NOT_TRACKING:
enum **Tracking_status**:
- **ARVR_NORMAL_TRACKING** = **0** --- Tracking is behaving as expected.
- **ARVR_EXCESSIVE_MOTION** = **1** --- Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
- **ARVR_INSUFFICIENT_FEATURES** = **2** --- Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
- **ARVR_UNKNOWN_TRACKING** = **3** --- We don't know the status of the tracking or this interface does not provide feedback.
- **ARVR_NOT_TRACKING** = **4** --- Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
Property Descriptions
---------------------
.. _class_ARVRInterface_property_ar_is_anchor_detection_enabled:
- :ref:`bool<class_bool>` **ar_is_anchor_detection_enabled**
+-----------+----------------------------------------+
| *Default* | ``false`` |
+-----------+----------------------------------------+
| *Setter* | set_anchor_detection_is_enabled(value) |
+-----------+----------------------------------------+
| *Getter* | get_anchor_detection_is_enabled() |
+-----------+----------------------------------------+
On an AR interface, ``true`` if anchor detection is enabled.
----
.. _class_ARVRInterface_property_interface_is_initialized:
- :ref:`bool<class_bool>` **interface_is_initialized**
+-----------+---------------------------+
| *Default* | ``false`` |
+-----------+---------------------------+
| *Setter* | set_is_initialized(value) |
+-----------+---------------------------+
| *Getter* | is_initialized() |
+-----------+---------------------------+
``true`` if this interface been initialized.
----
.. _class_ARVRInterface_property_interface_is_primary:
- :ref:`bool<class_bool>` **interface_is_primary**
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_is_primary(value) |
+-----------+-----------------------+
| *Getter* | is_primary() |
+-----------+-----------------------+
``true`` if this is the primary interface.
Method Descriptions
-------------------
.. _class_ARVRInterface_method_get_camera_feed_id:
- :ref:`int<class_int>` **get_camera_feed_id** **(** **)**
If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the :ref:`CameraServer<class_CameraServer>` for this interface.
----
.. _class_ARVRInterface_method_get_capabilities:
- :ref:`int<class_int>` **get_capabilities** **(** **)** |const|
Returns a combination of :ref:`Capabilities<enum_ARVRInterface_Capabilities>` flags providing information about the capabilities of this interface.
----
.. _class_ARVRInterface_method_get_name:
- :ref:`String<class_String>` **get_name** **(** **)** |const|
Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc).
----
.. _class_ARVRInterface_method_get_render_targetsize:
- :ref:`Vector2<class_Vector2>` **get_render_targetsize** **(** **)**
Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform.
----
.. _class_ARVRInterface_method_get_tracking_status:
- :ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **get_tracking_status** **(** **)** |const|
If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking.
----
.. _class_ARVRInterface_method_initialize:
- :ref:`bool<class_bool>` **initialize** **(** **)**
Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.
After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence.
\ **Note:** You must enable the AR/VR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR.
If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different.
While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
----
.. _class_ARVRInterface_method_is_stereo:
- :ref:`bool<class_bool>` **is_stereo** **(** **)**
Returns ``true`` if the current output of this interface is in stereo.
----
.. _class_ARVRInterface_method_uninitialize:
- void **uninitialize** **(** **)**
Turns the interface off.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml.
.. _class_ARVRInterfaceGDNative:
ARVRInterfaceGDNative
=====================
**Inherits:** :ref:`ARVRInterface<class_ARVRInterface>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
GDNative wrapper for an ARVR interface.
Description
-----------
This is a wrapper class for GDNative implementations of the ARVR interface. To use a GDNative ARVR interface, simply instantiate this object and set your GDNative library containing the ARVR interface implementation.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,61 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVROrigin.xml.
.. _class_ARVROrigin:
ARVROrigin
==========
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
The origin point in AR/VR.
Description
-----------
This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world.
There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly.
It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point.
For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node.
Tutorials
---------
- :doc:`../tutorials/vr/index`
Properties
----------
+---------------------------+-----------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVROrigin_property_world_scale>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------+---------+
Property Descriptions
---------------------
.. _class_ARVROrigin_property_world_scale:
- :ref:`float<class_float>` **world_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_world_scale(value) |
+-----------+------------------------+
| *Getter* | get_world_scale() |
+-----------+------------------------+
Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
\ **Note:** This method is a passthrough to the :ref:`ARVRServer<class_ARVRServer>` itself.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,192 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRPositionalTracker.xml.
.. _class_ARVRPositionalTracker:
ARVRPositionalTracker
=====================
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
A tracked object.
Description
-----------
An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally.
As controllers are turned on and the AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the :ref:`ARVRServer<class_ARVRServer>`.
The :ref:`ARVRController<class_ARVRController>` and :ref:`ARVRAnchor<class_ARVRAnchor>` both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them.
Tutorials
---------
- :doc:`../tutorials/vr/index`
Properties
----------
+---------------------------+------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRPositionalTracker_property_rumble>` | ``0.0`` |
+---------------------------+------------------------------------------------------------+---------+
Methods
-------
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRPositionalTracker_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joy_id<class_ARVRPositionalTracker_method_get_joy_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRPositionalTracker_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRPositionalTracker_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`get_orientation<class_ARVRPositionalTracker_method_get_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_position<class_ARVRPositionalTracker_method_get_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_id<class_ARVRPositionalTracker_method_get_tracker_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_orientation<class_ARVRPositionalTracker_method_get_tracks_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_position<class_ARVRPositionalTracker_method_get_tracks_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_transform<class_ARVRPositionalTracker_method_get_transform>` **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerType<enum_ARVRServer_TrackerType>` | :ref:`get_type<class_ARVRPositionalTracker_method_get_type>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_ARVRPositionalTracker_TrackerHand:
.. _class_ARVRPositionalTracker_constant_TRACKER_HAND_UNKNOWN:
.. _class_ARVRPositionalTracker_constant_TRACKER_LEFT_HAND:
.. _class_ARVRPositionalTracker_constant_TRACKER_RIGHT_HAND:
enum **TrackerHand**:
- **TRACKER_HAND_UNKNOWN** = **0** --- The hand this tracker is held in is unknown or not applicable.
- **TRACKER_LEFT_HAND** = **1** --- This tracker is the left hand controller.
- **TRACKER_RIGHT_HAND** = **2** --- This tracker is the right hand controller.
Property Descriptions
---------------------
.. _class_ARVRPositionalTracker_property_rumble:
- :ref:`float<class_float>` **rumble**
+-----------+-------------------+
| *Default* | ``0.0`` |
+-----------+-------------------+
| *Setter* | set_rumble(value) |
+-----------+-------------------+
| *Getter* | get_rumble() |
+-----------+-------------------+
The degree to which the tracker rumbles. Ranges from ``0.0`` to ``1.0`` with precision ``.01``.
Method Descriptions
-------------------
.. _class_ARVRPositionalTracker_method_get_hand:
- :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
Returns the hand holding this tracker, if known. See :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` constants.
----
.. _class_ARVRPositionalTracker_method_get_joy_id:
- :ref:`int<class_int>` **get_joy_id** **(** **)** |const|
If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID.
----
.. _class_ARVRPositionalTracker_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
Returns the mesh related to a controller or anchor point if one is available.
----
.. _class_ARVRPositionalTracker_method_get_name:
- :ref:`String<class_String>` **get_name** **(** **)** |const|
Returns the controller or anchor point's name if available.
----
.. _class_ARVRPositionalTracker_method_get_orientation:
- :ref:`Basis<class_Basis>` **get_orientation** **(** **)** |const|
Returns the controller's orientation matrix.
----
.. _class_ARVRPositionalTracker_method_get_position:
- :ref:`Vector3<class_Vector3>` **get_position** **(** **)** |const|
Returns the world-space controller position.
----
.. _class_ARVRPositionalTracker_method_get_tracker_id:
- :ref:`int<class_int>` **get_tracker_id** **(** **)** |const|
Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the :ref:`ARVRController<class_ARVRController>` and :ref:`ARVRAnchor<class_ARVRAnchor>` nodes.
----
.. _class_ARVRPositionalTracker_method_get_tracks_orientation:
- :ref:`bool<class_bool>` **get_tracks_orientation** **(** **)** |const|
Returns ``true`` if this device tracks orientation.
----
.. _class_ARVRPositionalTracker_method_get_tracks_position:
- :ref:`bool<class_bool>` **get_tracks_position** **(** **)** |const|
Returns ``true`` if this device tracks position.
----
.. _class_ARVRPositionalTracker_method_get_transform:
- :ref:`Transform<class_Transform>` **get_transform** **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const|
Returns the transform combining this device's orientation and position.
----
.. _class_ARVRPositionalTracker_method_get_type:
- :ref:`TrackerType<enum_ARVRServer_TrackerType>` **get_type** **(** **)** |const|
Returns the tracker's type.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,337 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ARVRServer.xml.
.. _class_ARVRServer:
ARVRServer
==========
**Inherits:** :ref:`Object<class_Object>`
Server for AR and VR features.
Description
-----------
The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing.
Tutorials
---------
- :doc:`../tutorials/vr/index`
Properties
----------
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`primary_interface<class_ARVRServer_property_primary_interface>` | |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVRServer_property_world_scale>` | ``1.0`` |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
Methods
-------
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_interface<class_ARVRServer_method_add_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_tracker<class_ARVRServer_method_add_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`center_on_hmd<class_ARVRServer_method_center_on_hmd>` **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_primary_interface_if<class_ARVRServer_method_clear_primary_interface_if>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`find_interface<class_ARVRServer_method_find_interface>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_hmd_transform<class_ARVRServer_method_get_hmd_transform>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`get_interface<class_ARVRServer_method_get_interface>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_interface_count<class_ARVRServer_method_get_interface_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_interfaces<class_ARVRServer_method_get_interfaces>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_commit_usec<class_ARVRServer_method_get_last_commit_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_frame_usec<class_ARVRServer_method_get_last_frame_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_process_usec<class_ARVRServer_method_get_last_process_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_reference_frame<class_ARVRServer_method_get_reference_frame>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` | :ref:`get_tracker<class_ARVRServer_method_get_tracker>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_count<class_ARVRServer_method_get_tracker_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_interface<class_ARVRServer_method_remove_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_tracker<class_ARVRServer_method_remove_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_ARVRServer_signal_interface_added:
- **interface_added** **(** :ref:`String<class_String>` interface_name **)**
Emitted when a new interface has been added.
----
.. _class_ARVRServer_signal_interface_removed:
- **interface_removed** **(** :ref:`String<class_String>` interface_name **)**
Emitted when an interface is removed.
----
.. _class_ARVRServer_signal_tracker_added:
- **tracker_added** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using :ref:`ARVRAnchor<class_ARVRAnchor>`\ s for an AR solution, it is important to react to this signal to add the appropriate :ref:`ARVRController<class_ARVRController>` or :ref:`ARVRAnchor<class_ARVRAnchor>` nodes related to this new tracker.
----
.. _class_ARVRServer_signal_tracker_removed:
- **tracker_removed** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
Emitted when a tracker is removed. You should remove any :ref:`ARVRController<class_ARVRController>` or :ref:`ARVRAnchor<class_ARVRAnchor>` points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one).
Enumerations
------------
.. _enum_ARVRServer_TrackerType:
.. _class_ARVRServer_constant_TRACKER_CONTROLLER:
.. _class_ARVRServer_constant_TRACKER_BASESTATION:
.. _class_ARVRServer_constant_TRACKER_ANCHOR:
.. _class_ARVRServer_constant_TRACKER_ANY_KNOWN:
.. _class_ARVRServer_constant_TRACKER_UNKNOWN:
.. _class_ARVRServer_constant_TRACKER_ANY:
enum **TrackerType**:
- **TRACKER_CONTROLLER** = **1** --- The tracker tracks the location of a controller.
- **TRACKER_BASESTATION** = **2** --- The tracker tracks the location of a base station.
- **TRACKER_ANCHOR** = **4** --- The tracker tracks the location and size of an AR anchor.
- **TRACKER_ANY_KNOWN** = **127** --- Used internally to filter trackers of any known type.
- **TRACKER_UNKNOWN** = **128** --- Used internally if we haven't set the tracker type yet.
- **TRACKER_ANY** = **255** --- Used internally to select all trackers.
----
.. _enum_ARVRServer_RotationMode:
.. _class_ARVRServer_constant_RESET_FULL_ROTATION:
.. _class_ARVRServer_constant_RESET_BUT_KEEP_TILT:
.. _class_ARVRServer_constant_DONT_RESET_ROTATION:
enum **RotationMode**:
- **RESET_FULL_ROTATION** = **0** --- Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world.
- **RESET_BUT_KEEP_TILT** = **1** --- Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset.
- **DONT_RESET_ROTATION** = **2** --- Does not reset the orientation of the HMD, only the position of the player gets centered.
Property Descriptions
---------------------
.. _class_ARVRServer_property_primary_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **primary_interface**
+----------+------------------------------+
| *Setter* | set_primary_interface(value) |
+----------+------------------------------+
| *Getter* | get_primary_interface() |
+----------+------------------------------+
The primary :ref:`ARVRInterface<class_ARVRInterface>` currently bound to the ``ARVRServer``.
----
.. _class_ARVRServer_property_world_scale:
- :ref:`float<class_float>` **world_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_world_scale(value) |
+-----------+------------------------+
| *Getter* | get_world_scale() |
+-----------+------------------------+
Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
Method Descriptions
-------------------
.. _class_ARVRServer_method_add_interface:
- void **add_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Registers an :ref:`ARVRInterface<class_ARVRInterface>` object.
----
.. _class_ARVRServer_method_add_tracker:
- void **add_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
Registers a new :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` that tracks a spatial location in real space.
----
.. _class_ARVRServer_method_center_on_hmd:
- void **center_on_hmd** **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)**
This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently.
For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world.
For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera.
This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world.
For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game.
You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism.
----
.. _class_ARVRServer_method_clear_primary_interface_if:
- void **clear_primary_interface_if** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Clears our current primary interface if it is set to the provided interface.
----
.. _class_ARVRServer_method_find_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **find_interface** **(** :ref:`String<class_String>` name **)** |const|
Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it.
----
.. _class_ARVRServer_method_get_hmd_transform:
- :ref:`Transform<class_Transform>` **get_hmd_transform** **(** **)**
Returns the primary interface's transformation.
----
.. _class_ARVRServer_method_get_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **get_interface** **(** :ref:`int<class_int>` idx **)** |const|
Returns the interface registered at a given index in our list of interfaces.
----
.. _class_ARVRServer_method_get_interface_count:
- :ref:`int<class_int>` **get_interface_count** **(** **)** |const|
Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns ``true``.
----
.. _class_ARVRServer_method_get_interfaces:
- :ref:`Array<class_Array>` **get_interfaces** **(** **)** |const|
Returns a list of available interfaces the ID and name of each interface.
----
.. _class_ARVRServer_method_get_last_commit_usec:
- :ref:`int<class_int>` **get_last_commit_usec** **(** **)**
Returns the absolute timestamp (in μs) of the last ``ARVRServer`` commit of the AR/VR eyes to :ref:`VisualServer<class_VisualServer>`. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
----
.. _class_ARVRServer_method_get_last_frame_usec:
- :ref:`int<class_int>` **get_last_frame_usec** **(** **)**
Returns the duration (in μs) of the last frame. This is computed as the difference between :ref:`get_last_commit_usec<class_ARVRServer_method_get_last_commit_usec>` and :ref:`get_last_process_usec<class_ARVRServer_method_get_last_process_usec>` when committing.
----
.. _class_ARVRServer_method_get_last_process_usec:
- :ref:`int<class_int>` **get_last_process_usec** **(** **)**
Returns the absolute timestamp (in μs) of the last ``ARVRServer`` process callback. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
----
.. _class_ARVRServer_method_get_reference_frame:
- :ref:`Transform<class_Transform>` **get_reference_frame** **(** **)** |const|
Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces.
----
.. _class_ARVRServer_method_get_tracker:
- :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` **get_tracker** **(** :ref:`int<class_int>` idx **)** |const|
Returns the positional tracker at the given ID.
----
.. _class_ARVRServer_method_get_tracker_count:
- :ref:`int<class_int>` **get_tracker_count** **(** **)** |const|
Returns the number of trackers currently registered.
----
.. _class_ARVRServer_method_remove_interface:
- void **remove_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Removes this interface.
----
.. _class_ARVRServer_method_remove_tracker:
- void **remove_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
Removes this positional tracker.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,150 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AspectRatioContainer.xml.
.. _class_AspectRatioContainer:
AspectRatioContainer
====================
**Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Container that preserves its child controls' aspect ratio.
Description
-----------
Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions.
Tutorials
---------
- :doc:`GUI containers <../tutorials/ui/gui_containers>`
Properties
----------
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_horizontal<class_AspectRatioContainer_property_alignment_horizontal>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_vertical<class_AspectRatioContainer_property_alignment_vertical>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`ratio<class_AspectRatioContainer_property_ratio>` | ``1.0`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` | :ref:`stretch_mode<class_AspectRatioContainer_property_stretch_mode>` | ``2`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
Enumerations
------------
.. _enum_AspectRatioContainer_StretchMode:
.. _class_AspectRatioContainer_constant_STRETCH_WIDTH_CONTROLS_HEIGHT:
.. _class_AspectRatioContainer_constant_STRETCH_HEIGHT_CONTROLS_WIDTH:
.. _class_AspectRatioContainer_constant_STRETCH_FIT:
.. _class_AspectRatioContainer_constant_STRETCH_COVER:
enum **StretchMode**:
- **STRETCH_WIDTH_CONTROLS_HEIGHT** = **0** --- The height of child controls is automatically adjusted based on the width of the container.
- **STRETCH_HEIGHT_CONTROLS_WIDTH** = **1** --- The width of child controls is automatically adjusted based on the height of the container.
- **STRETCH_FIT** = **2** --- The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio.
- **STRETCH_COVER** = **3** --- The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
When the bounding rectangle of child controls exceed the container's size and :ref:`Control.rect_clip_content<class_Control_property_rect_clip_content>` is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
----
.. _enum_AspectRatioContainer_AlignMode:
.. _class_AspectRatioContainer_constant_ALIGN_BEGIN:
.. _class_AspectRatioContainer_constant_ALIGN_CENTER:
.. _class_AspectRatioContainer_constant_ALIGN_END:
enum **AlignMode**:
- **ALIGN_BEGIN** = **0** --- Aligns child controls with the beginning (left or top) of the container.
- **ALIGN_CENTER** = **1** --- Aligns child controls with the center of the container.
- **ALIGN_END** = **2** --- Aligns child controls with the end (right or bottom) of the container.
Property Descriptions
---------------------
.. _class_AspectRatioContainer_property_alignment_horizontal:
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_horizontal**
+-----------+---------------------------------+
| *Default* | ``1`` |
+-----------+---------------------------------+
| *Setter* | set_alignment_horizontal(value) |
+-----------+---------------------------------+
| *Getter* | get_alignment_horizontal() |
+-----------+---------------------------------+
Specifies the horizontal relative position of child controls.
----
.. _class_AspectRatioContainer_property_alignment_vertical:
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_vertical**
+-----------+-------------------------------+
| *Default* | ``1`` |
+-----------+-------------------------------+
| *Setter* | set_alignment_vertical(value) |
+-----------+-------------------------------+
| *Getter* | get_alignment_vertical() |
+-----------+-------------------------------+
Specifies the vertical relative position of child controls.
----
.. _class_AspectRatioContainer_property_ratio:
- :ref:`float<class_float>` **ratio**
+-----------+------------------+
| *Default* | ``1.0`` |
+-----------+------------------+
| *Setter* | set_ratio(value) |
+-----------+------------------+
| *Getter* | get_ratio() |
+-----------+------------------+
The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the :ref:`stretch_mode<class_AspectRatioContainer_property_stretch_mode>`.
----
.. _class_AspectRatioContainer_property_stretch_mode:
- :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **stretch_mode**
+-----------+-------------------------+
| *Default* | ``2`` |
+-----------+-------------------------+
| *Setter* | set_stretch_mode(value) |
+-----------+-------------------------+
| *Getter* | get_stretch_mode() |
+-----------+-------------------------+
The stretch mode used to align child controls.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

363
classes/class_astar.rst Normal file
View File

@ -0,0 +1,363 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AStar.xml.
.. _class_AStar:
AStar
=====
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
An implementation of A\* to find the shortest paths among connected points in space.
Description
-----------
A\* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A\* implementation uses points in three-dimensional space and Euclidean distances by default.
You must add points manually with :ref:`add_point<class_AStar_method_add_point>` and create segments manually with :ref:`connect_points<class_AStar_method_connect_points>`. Then you can test if there is a path between two points with the :ref:`are_points_connected<class_AStar_method_are_points_connected>` function, get a path containing indices by :ref:`get_id_path<class_AStar_method_get_id_path>`, or one containing actual coordinates with :ref:`get_point_path<class_AStar_method_get_point_path>`.
It is also possible to use non-Euclidean distances. To do so, create a class that extends ``AStar`` and override methods :ref:`_compute_cost<class_AStar_method__compute_cost>` and :ref:`_estimate_cost<class_AStar_method__estimate_cost>`. Both take two indices and return a length, as is shown in the following example.
::
class MyAStar:
extends AStar
func _compute_cost(u, v):
return abs(u - v)
func _estimate_cost(u, v):
return min(0, abs(u - v) - 1)
\ :ref:`_estimate_cost<class_AStar_method__estimate_cost>` should return a lower bound of the distance, i.e. ``_estimate_cost(u, v) <= _compute_cost(u, v)``. This serves as a hint to the algorithm because the custom ``_compute_cost`` might be computation-heavy. If this is not the case, make :ref:`_estimate_cost<class_AStar_method__estimate_cost>` return the same value as :ref:`_compute_cost<class_AStar_method__compute_cost>` to provide the algorithm with the most accurate information.
If the default :ref:`_estimate_cost<class_AStar_method__estimate_cost>` and :ref:`_compute_cost<class_AStar_method__compute_cost>` methods are used, or if the supplied :ref:`_estimate_cost<class_AStar_method__estimate_cost>` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the :ref:`_compute_cost<class_AStar_method__compute_cost>` results of all segments in the path multiplied by the ``weight_scale``\ s of the endpoints of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals the sum of Euclidean distances of all segments in the path.
Methods
-------
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar_method_clear>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar_method_get_closest_point>` **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_closest_position_in_segment<class_AStar_method_get_closest_position_in_segment>` **(** :ref:`Vector3<class_Vector3>` to_position **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_point_path<class_AStar_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_point_position<class_AStar_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar_method_get_points>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AStar_method__compute_cost:
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when computing the cost between two connected points.
Note that this function is hidden in the default ``AStar`` class.
----
.. _class_AStar_method__estimate_cost:
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default ``AStar`` class.
----
.. _class_AStar_method_add_point:
- void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater.
The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path.
::
var astar = AStar.new()
astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1
If there already exists a point for the given ``id``, its position and weight scale are updated to the given values.
----
.. _class_AStar_method_are_points_connected:
- :ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
Returns whether the two given points are directly connected by a segment. If ``bidirectional`` is ``false``, returns whether movement from ``id`` to ``to_id`` is possible through this segment.
----
.. _class_AStar_method_clear:
- void **clear** **(** **)**
Clears all the points and segments.
----
.. _class_AStar_method_connect_points:
- void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction.
::
var astar = AStar.new()
astar.add_point(1, Vector3(1, 1, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2, false)
----
.. _class_AStar_method_disconnect_points:
- void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Deletes the segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is prevented, and a unidirectional segment possibly remains.
----
.. _class_AStar_method_get_available_point_id:
- :ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
Returns the next available point ID with no point associated to it.
----
.. _class_AStar_method_get_closest_point:
- :ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool.
\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result.
----
.. _class_AStar_method_get_closest_position_in_segment:
- :ref:`Vector3<class_Vector3>` **get_closest_position_in_segment** **(** :ref:`Vector3<class_Vector3>` to_position **)** |const|
Returns the closest position to ``to_position`` that resides inside a segment between two connected points.
::
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0)
The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point.
----
.. _class_AStar_method_get_id_path:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
::
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1
astar.add_point(3, Vector3(1, 1, 0))
astar.add_point(4, Vector3(2, 0, 0))
astar.connect_points(1, 2, false)
astar.connect_points(2, 3, false)
astar.connect_points(4, 3, false)
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
----
.. _class_AStar_method_get_point_capacity:
- :ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``.
----
.. _class_AStar_method_get_point_connections:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
Returns an array with the IDs of the points that form the connection with the given point.
::
var astar = AStar.new()
astar.add_point(1, Vector3(0, 0, 0))
astar.add_point(2, Vector3(0, 1, 0))
astar.add_point(3, Vector3(1, 1, 0))
astar.add_point(4, Vector3(2, 0, 0))
astar.connect_points(1, 2, true)
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
----
.. _class_AStar_method_get_point_count:
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
Returns the number of points currently in the points pool.
----
.. _class_AStar_method_get_point_path:
- :ref:`PoolVector3Array<class_PoolVector3Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty :ref:`PoolVector3Array<class_PoolVector3Array>` and will print an error message.
----
.. _class_AStar_method_get_point_position:
- :ref:`Vector3<class_Vector3>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
Returns the position of the point associated with the given ``id``.
----
.. _class_AStar_method_get_point_weight_scale:
- :ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
Returns the weight scale of the point associated with the given ``id``.
----
.. _class_AStar_method_get_points:
- :ref:`Array<class_Array>` **get_points** **(** **)**
Returns an array of all points.
----
.. _class_AStar_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point associated with the given ``id`` exists.
----
.. _class_AStar_method_is_point_disabled:
- :ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
----
.. _class_AStar_method_remove_point:
- void **remove_point** **(** :ref:`int<class_int>` id **)**
Removes the point associated with the given ``id`` from the points pool.
----
.. _class_AStar_method_reserve_space:
- void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity.
----
.. _class_AStar_method_set_point_disabled:
- void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.
----
.. _class_AStar_method_set_point_position:
- void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)**
Sets the ``position`` for the point with the given ``id``.
----
.. _class_AStar_method_set_point_weight_scale:
- void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

344
classes/class_astar2d.rst Normal file
View File

@ -0,0 +1,344 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AStar2D.xml.
.. _class_AStar2D:
AStar2D
=======
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
AStar class representation that uses 2D vectors as edges.
Description
-----------
This is a wrapper for the :ref:`AStar<class_AStar>` class which uses 2D vectors instead of 3D vectors.
Methods
-------
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar2D_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar2D_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar2D_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar2D_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar2D_method_clear>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar2D_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar2D_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar2D_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar2D_method_get_closest_point>` **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_closest_position_in_segment<class_AStar2D_method_get_closest_position_in_segment>` **(** :ref:`Vector2<class_Vector2>` to_position **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar2D_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar2D_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar2D_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar2D_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_point_path<class_AStar2D_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_point_position<class_AStar2D_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar2D_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar2D_method_get_points>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar2D_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar2D_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar2D_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar2D_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar2D_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar2D_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar2D_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AStar2D_method__compute_cost:
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when computing the cost between two connected points.
Note that this function is hidden in the default ``AStar2D`` class.
----
.. _class_AStar2D_method__estimate_cost:
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default ``AStar2D`` class.
----
.. _class_AStar2D_method_add_point:
- void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater.
The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar2D_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower ``weight_scale``\ s to form a path.
::
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1
If there already exists a point for the given ``id``, its position and weight scale are updated to the given values.
----
.. _class_AStar2D_method_are_points_connected:
- :ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
Returns whether there is a connection/segment between the given points. If ``bidirectional`` is ``false``, returns whether movement from ``id`` to ``to_id`` is possible through this segment.
----
.. _class_AStar2D_method_clear:
- void **clear** **(** **)**
Clears all the points and segments.
----
.. _class_AStar2D_method_connect_points:
- void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction.
::
var astar = AStar2D.new()
astar.add_point(1, Vector2(1, 1))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2, false)
----
.. _class_AStar2D_method_disconnect_points:
- void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Deletes the segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is prevented, and a unidirectional segment possibly remains.
----
.. _class_AStar2D_method_get_available_point_id:
- :ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
Returns the next available point ID with no point associated to it.
----
.. _class_AStar2D_method_get_closest_point:
- :ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool.
\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result.
----
.. _class_AStar2D_method_get_closest_position_in_segment:
- :ref:`Vector2<class_Vector2>` **get_closest_position_in_segment** **(** :ref:`Vector2<class_Vector2>` to_position **)** |const|
Returns the closest position to ``to_position`` that resides inside a segment between two connected points.
::
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2)
var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3)
The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point.
----
.. _class_AStar2D_method_get_id_path:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
::
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1
astar.add_point(3, Vector2(1, 1))
astar.add_point(4, Vector2(2, 0))
astar.connect_points(1, 2, false)
astar.connect_points(2, 3, false)
astar.connect_points(4, 3, false)
astar.connect_points(1, 4, false)
var res = astar.get_id_path(1, 3) # Returns [1, 2, 3]
If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
----
.. _class_AStar2D_method_get_point_capacity:
- :ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``.
----
.. _class_AStar2D_method_get_point_connections:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
Returns an array with the IDs of the points that form the connection with the given point.
::
var astar = AStar2D.new()
astar.add_point(1, Vector2(0, 0))
astar.add_point(2, Vector2(0, 1))
astar.add_point(3, Vector2(1, 1))
astar.add_point(4, Vector2(2, 0))
astar.connect_points(1, 2, true)
astar.connect_points(1, 3, true)
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
----
.. _class_AStar2D_method_get_point_count:
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
Returns the number of points currently in the points pool.
----
.. _class_AStar2D_method_get_point_path:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty :ref:`PoolVector2Array<class_PoolVector2Array>` and will print an error message.
----
.. _class_AStar2D_method_get_point_position:
- :ref:`Vector2<class_Vector2>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
Returns the position of the point associated with the given ``id``.
----
.. _class_AStar2D_method_get_point_weight_scale:
- :ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
Returns the weight scale of the point associated with the given ``id``.
----
.. _class_AStar2D_method_get_points:
- :ref:`Array<class_Array>` **get_points** **(** **)**
Returns an array of all points.
----
.. _class_AStar2D_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point associated with the given ``id`` exists.
----
.. _class_AStar2D_method_is_point_disabled:
- :ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
----
.. _class_AStar2D_method_remove_point:
- void **remove_point** **(** :ref:`int<class_int>` id **)**
Removes the point associated with the given ``id`` from the points pool.
----
.. _class_AStar2D_method_reserve_space:
- void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity.
----
.. _class_AStar2D_method_set_point_disabled:
- void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.
----
.. _class_AStar2D_method_set_point_position:
- void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)**
Sets the ``position`` for the point with the given ``id``.
----
.. _class_AStar2D_method_set_point_weight_scale:
- void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar2D_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,106 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AtlasTexture.xml.
.. _class_AtlasTexture:
AtlasTexture
============
**Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Crops out one part of a texture, such as a texture from a texture atlas.
Description
-----------
:ref:`Texture<class_Texture>` resource that crops out one part of the :ref:`atlas<class_AtlasTexture_property_atlas>` texture, defined by :ref:`region<class_AtlasTexture_property_region>`. The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a :ref:`Texture<class_Texture>` for the :ref:`atlas<class_AtlasTexture_property_atlas>`, a :ref:`region<class_AtlasTexture_property_region>` that defines the area of :ref:`atlas<class_AtlasTexture_property_atlas>` to use, and a :ref:`margin<class_AtlasTexture_property_margin>` that defines the border width.
\ ``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, cannot be tiled in nodes such as :ref:`TextureRect<class_TextureRect>`, and does not work properly if used inside of other ``AtlasTexture`` resources. Multiple ``AtlasTexture`` resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files.
\ **Note:** AtlasTextures don't support repetition. The :ref:`Texture.FLAG_REPEAT<class_Texture_constant_FLAG_REPEAT>` and :ref:`Texture.FLAG_MIRRORED_REPEAT<class_Texture_constant_FLAG_MIRRORED_REPEAT>` flags are ignored when using an AtlasTexture.
Properties
----------
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`margin<class_AtlasTexture_property_margin>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`region<class_AtlasTexture_property_region>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AtlasTexture_property_atlas:
- :ref:`Texture<class_Texture>` **atlas**
+----------+------------------+
| *Setter* | set_atlas(value) |
+----------+------------------+
| *Getter* | get_atlas() |
+----------+------------------+
The texture that contains the atlas. Can be any :ref:`Texture<class_Texture>` subtype.
----
.. _class_AtlasTexture_property_filter_clip:
- :ref:`bool<class_bool>` **filter_clip**
+-----------+------------------------+
| *Default* | ``false`` |
+-----------+------------------------+
| *Setter* | set_filter_clip(value) |
+-----------+------------------------+
| *Getter* | has_filter_clip() |
+-----------+------------------------+
If ``true``, clips the area outside of the region to avoid bleeding of the surrounding texture pixels.
----
.. _class_AtlasTexture_property_margin:
- :ref:`Rect2<class_Rect2>` **margin**
+-----------+-------------------------+
| *Default* | ``Rect2( 0, 0, 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_margin(value) |
+-----------+-------------------------+
| *Getter* | get_margin() |
+-----------+-------------------------+
The margin around the region. The :ref:`Rect2<class_Rect2>`'s :ref:`Rect2.size<class_Rect2_property_size>` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin.
----
.. _class_AtlasTexture_property_region:
- :ref:`Rect2<class_Rect2>` **region**
+-----------+-------------------------+
| *Default* | ``Rect2( 0, 0, 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_region(value) |
+-----------+-------------------------+
| *Getter* | get_region() |
+-----------+-------------------------+
The AtlasTexture's used region.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioBusLayout.xml.
.. _class_AudioBusLayout:
AudioBusLayout
==============
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Stores information about the audio buses.
Description
-----------
Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See :ref:`AudioServer<class_AudioServer>` for usage.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,31 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffect.xml.
.. _class_AudioEffect:
AudioEffect
===========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioEffectAmplify<class_AudioEffectAmplify>`, :ref:`AudioEffectCapture<class_AudioEffectCapture>`, :ref:`AudioEffectChorus<class_AudioEffectChorus>`, :ref:`AudioEffectCompressor<class_AudioEffectCompressor>`, :ref:`AudioEffectDelay<class_AudioEffectDelay>`, :ref:`AudioEffectDistortion<class_AudioEffectDistortion>`, :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectFilter<class_AudioEffectFilter>`, :ref:`AudioEffectLimiter<class_AudioEffectLimiter>`, :ref:`AudioEffectPanner<class_AudioEffectPanner>`, :ref:`AudioEffectPhaser<class_AudioEffectPhaser>`, :ref:`AudioEffectPitchShift<class_AudioEffectPitchShift>`, :ref:`AudioEffectRecord<class_AudioEffectRecord>`, :ref:`AudioEffectReverb<class_AudioEffectReverb>`, :ref:`AudioEffectSpectrumAnalyzer<class_AudioEffectSpectrumAnalyzer>`, :ref:`AudioEffectStereoEnhance<class_AudioEffectStereoEnhance>`
Audio effect for audio.
Description
-----------
Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on.
Tutorials
---------
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,50 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectAmplify.xml.
.. _class_AudioEffectAmplify:
AudioEffectAmplify
==================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds an amplifying audio effect to an audio bus.
Increases or decreases the volume of the selected audio bus.
Description
-----------
Increases or decreases the volume being routed through the audio bus.
Properties
----------
+---------------------------+---------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------+---------+
Property Descriptions
---------------------
.. _class_AudioEffectAmplify_property_volume_db:
- :ref:`float<class_float>` **volume_db**
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectBandLimitFilter.xml.
.. _class_AudioEffectBandLimitFilter:
AudioEffectBandLimitFilter
==========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a band limit filter to the audio bus.
Description
-----------
Limits the frequencies in a range around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows frequencies outside of this range to pass.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectBandPassFilter.xml.
.. _class_AudioEffectBandPassFilter:
AudioEffectBandPassFilter
=========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a band pass filter to the audio bus.
Description
-----------
Attenuates the frequencies inside of a range around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and cuts frequencies outside of this band.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,137 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectCapture.xml.
.. _class_AudioEffectCapture:
AudioEffectCapture
==================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Captures audio from an audio bus in real-time.
Description
-----------
AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer.
Application code should consume these audio frames from this ring buffer using :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>` and process it as needed, for example to capture data from an :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`, implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
- `Audio Mic Record Demo <https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record>`__
Properties
----------
+---------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectCapture_property_buffer_length>` | ``0.1`` |
+---------------------------+-----------------------------------------------------------------------+---------+
Methods
-------
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_get_buffer<class_AudioEffectCapture_method_can_get_buffer>` **(** :ref:`int<class_int>` frames **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioEffectCapture_method_clear_buffer>` **(** **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>` **(** :ref:`int<class_int>` frames **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_buffer_length_frames<class_AudioEffectCapture_method_get_buffer_length_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_discarded_frames<class_AudioEffectCapture_method_get_discarded_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioEffectCapture_method_get_frames_available>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_pushed_frames<class_AudioEffectCapture_method_get_pushed_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AudioEffectCapture_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
+-----------+--------------------------+
| *Default* | ``0.1`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.
Method Descriptions
-------------------
.. _class_AudioEffectCapture_method_can_get_buffer:
- :ref:`bool<class_bool>` **can_get_buffer** **(** :ref:`int<class_int>` frames **)** |const|
Returns ``true`` if at least ``frames`` audio frames are available to read in the internal ring buffer.
----
.. _class_AudioEffectCapture_method_clear_buffer:
- void **clear_buffer** **(** **)**
Clears the internal ring buffer.
----
.. _class_AudioEffectCapture_method_get_buffer:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
Gets the next ``frames`` audio samples from the internal ring buffer.
Returns a :ref:`PoolVector2Array<class_PoolVector2Array>` containing exactly ``frames`` audio samples if available, or an empty :ref:`PoolVector2Array<class_PoolVector2Array>` if insufficient data was available.
----
.. _class_AudioEffectCapture_method_get_buffer_length_frames:
- :ref:`int<class_int>` **get_buffer_length_frames** **(** **)** |const|
Returns the total size of the internal ring buffer in frames.
----
.. _class_AudioEffectCapture_method_get_discarded_frames:
- :ref:`int<class_int>` **get_discarded_frames** **(** **)** |const|
Returns the number of audio frames discarded from the audio bus due to full buffer.
----
.. _class_AudioEffectCapture_method_get_frames_available:
- :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
Returns the number of frames available to read using :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>`.
----
.. _class_AudioEffectCapture_method_get_pushed_frames:
- :ref:`int<class_int>` **get_pushed_frames** **(** **)** |const|
Returns the number of audio frames inserted from the audio bus.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,594 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectChorus.xml.
.. _class_AudioEffectChorus:
AudioEffectChorus
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a chorus audio effect.
Description
-----------
Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter.
Properties
----------
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectChorus_property_dry>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/cutoff_hz<class_AudioEffectChorus_property_voice/1/cutoff_hz>` | ``8000.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/delay_ms<class_AudioEffectChorus_property_voice/1/delay_ms>` | ``15.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/depth_ms<class_AudioEffectChorus_property_voice/1/depth_ms>` | ``2.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/level_db<class_AudioEffectChorus_property_voice/1/level_db>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/pan<class_AudioEffectChorus_property_voice/1/pan>` | ``-0.5`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/1/rate_hz<class_AudioEffectChorus_property_voice/1/rate_hz>` | ``0.8`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/cutoff_hz<class_AudioEffectChorus_property_voice/2/cutoff_hz>` | ``8000.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/delay_ms<class_AudioEffectChorus_property_voice/2/delay_ms>` | ``20.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/depth_ms<class_AudioEffectChorus_property_voice/2/depth_ms>` | ``3.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/level_db<class_AudioEffectChorus_property_voice/2/level_db>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/pan<class_AudioEffectChorus_property_voice/2/pan>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/2/rate_hz<class_AudioEffectChorus_property_voice/2/rate_hz>` | ``1.2`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/cutoff_hz<class_AudioEffectChorus_property_voice/3/cutoff_hz>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/delay_ms<class_AudioEffectChorus_property_voice/3/delay_ms>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/depth_ms<class_AudioEffectChorus_property_voice/3/depth_ms>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/level_db<class_AudioEffectChorus_property_voice/3/level_db>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/pan<class_AudioEffectChorus_property_voice/3/pan>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/3/rate_hz<class_AudioEffectChorus_property_voice/3/rate_hz>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/cutoff_hz<class_AudioEffectChorus_property_voice/4/cutoff_hz>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/delay_ms<class_AudioEffectChorus_property_voice/4/delay_ms>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/depth_ms<class_AudioEffectChorus_property_voice/4/depth_ms>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/level_db<class_AudioEffectChorus_property_voice/4/level_db>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/pan<class_AudioEffectChorus_property_voice/4/pan>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`voice/4/rate_hz<class_AudioEffectChorus_property_voice/4/rate_hz>` | |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`int<class_int>` | :ref:`voice_count<class_AudioEffectChorus_property_voice_count>` | ``2`` |
+---------------------------+------------------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`wet<class_AudioEffectChorus_property_wet>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+------------+
Methods
-------
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_cutoff_hz<class_AudioEffectChorus_method_get_voice_cutoff_hz>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_delay_ms<class_AudioEffectChorus_method_get_voice_delay_ms>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_depth_ms<class_AudioEffectChorus_method_get_voice_depth_ms>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_level_db<class_AudioEffectChorus_method_get_voice_level_db>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_pan<class_AudioEffectChorus_method_get_voice_pan>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_voice_rate_hz<class_AudioEffectChorus_method_get_voice_rate_hz>` **(** :ref:`int<class_int>` voice_idx **)** |const| |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_cutoff_hz<class_AudioEffectChorus_method_set_voice_cutoff_hz>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` cutoff_hz **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_delay_ms<class_AudioEffectChorus_method_set_voice_delay_ms>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` delay_ms **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_depth_ms<class_AudioEffectChorus_method_set_voice_depth_ms>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` depth_ms **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_level_db<class_AudioEffectChorus_method_set_voice_level_db>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` level_db **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_pan<class_AudioEffectChorus_method_set_voice_pan>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` pan **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_voice_rate_hz<class_AudioEffectChorus_method_set_voice_rate_hz>` **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` rate_hz **)** |
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AudioEffectChorus_property_dry:
- :ref:`float<class_float>` **dry**
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_dry(value) |
+-----------+----------------+
| *Getter* | get_dry() |
+-----------+----------------+
The effect's raw signal.
----
.. _class_AudioEffectChorus_property_voice/1/cutoff_hz:
- :ref:`float<class_float>` **voice/1/cutoff_hz**
+-----------+----------------------------+
| *Default* | ``8000.0`` |
+-----------+----------------------------+
| *Setter* | set_voice_cutoff_hz(value) |
+-----------+----------------------------+
| *Getter* | get_voice_cutoff_hz() |
+-----------+----------------------------+
The voice's cutoff frequency.
----
.. _class_AudioEffectChorus_property_voice/1/delay_ms:
- :ref:`float<class_float>` **voice/1/delay_ms**
+-----------+---------------------------+
| *Default* | ``15.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_delay_ms(value) |
+-----------+---------------------------+
| *Getter* | get_voice_delay_ms() |
+-----------+---------------------------+
The voice's signal delay.
----
.. _class_AudioEffectChorus_property_voice/1/depth_ms:
- :ref:`float<class_float>` **voice/1/depth_ms**
+-----------+---------------------------+
| *Default* | ``2.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_depth_ms(value) |
+-----------+---------------------------+
| *Getter* | get_voice_depth_ms() |
+-----------+---------------------------+
The voice filter's depth.
----
.. _class_AudioEffectChorus_property_voice/1/level_db:
- :ref:`float<class_float>` **voice/1/level_db**
+-----------+---------------------------+
| *Default* | ``0.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_level_db(value) |
+-----------+---------------------------+
| *Getter* | get_voice_level_db() |
+-----------+---------------------------+
The voice's volume.
----
.. _class_AudioEffectChorus_property_voice/1/pan:
- :ref:`float<class_float>` **voice/1/pan**
+-----------+----------------------+
| *Default* | ``-0.5`` |
+-----------+----------------------+
| *Setter* | set_voice_pan(value) |
+-----------+----------------------+
| *Getter* | get_voice_pan() |
+-----------+----------------------+
The voice's pan level.
----
.. _class_AudioEffectChorus_property_voice/1/rate_hz:
- :ref:`float<class_float>` **voice/1/rate_hz**
+-----------+--------------------------+
| *Default* | ``0.8`` |
+-----------+--------------------------+
| *Setter* | set_voice_rate_hz(value) |
+-----------+--------------------------+
| *Getter* | get_voice_rate_hz() |
+-----------+--------------------------+
The voice's filter rate.
----
.. _class_AudioEffectChorus_property_voice/2/cutoff_hz:
- :ref:`float<class_float>` **voice/2/cutoff_hz**
+-----------+----------------------------+
| *Default* | ``8000.0`` |
+-----------+----------------------------+
| *Setter* | set_voice_cutoff_hz(value) |
+-----------+----------------------------+
| *Getter* | get_voice_cutoff_hz() |
+-----------+----------------------------+
The voice's cutoff frequency.
----
.. _class_AudioEffectChorus_property_voice/2/delay_ms:
- :ref:`float<class_float>` **voice/2/delay_ms**
+-----------+---------------------------+
| *Default* | ``20.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_delay_ms(value) |
+-----------+---------------------------+
| *Getter* | get_voice_delay_ms() |
+-----------+---------------------------+
The voice's signal delay.
----
.. _class_AudioEffectChorus_property_voice/2/depth_ms:
- :ref:`float<class_float>` **voice/2/depth_ms**
+-----------+---------------------------+
| *Default* | ``3.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_depth_ms(value) |
+-----------+---------------------------+
| *Getter* | get_voice_depth_ms() |
+-----------+---------------------------+
The voice filter's depth.
----
.. _class_AudioEffectChorus_property_voice/2/level_db:
- :ref:`float<class_float>` **voice/2/level_db**
+-----------+---------------------------+
| *Default* | ``0.0`` |
+-----------+---------------------------+
| *Setter* | set_voice_level_db(value) |
+-----------+---------------------------+
| *Getter* | get_voice_level_db() |
+-----------+---------------------------+
The voice's volume.
----
.. _class_AudioEffectChorus_property_voice/2/pan:
- :ref:`float<class_float>` **voice/2/pan**
+-----------+----------------------+
| *Default* | ``0.5`` |
+-----------+----------------------+
| *Setter* | set_voice_pan(value) |
+-----------+----------------------+
| *Getter* | get_voice_pan() |
+-----------+----------------------+
The voice's pan level.
----
.. _class_AudioEffectChorus_property_voice/2/rate_hz:
- :ref:`float<class_float>` **voice/2/rate_hz**
+-----------+--------------------------+
| *Default* | ``1.2`` |
+-----------+--------------------------+
| *Setter* | set_voice_rate_hz(value) |
+-----------+--------------------------+
| *Getter* | get_voice_rate_hz() |
+-----------+--------------------------+
The voice's filter rate.
----
.. _class_AudioEffectChorus_property_voice/3/cutoff_hz:
- :ref:`float<class_float>` **voice/3/cutoff_hz**
+----------+----------------------------+
| *Setter* | set_voice_cutoff_hz(value) |
+----------+----------------------------+
| *Getter* | get_voice_cutoff_hz() |
+----------+----------------------------+
The voice's cutoff frequency.
----
.. _class_AudioEffectChorus_property_voice/3/delay_ms:
- :ref:`float<class_float>` **voice/3/delay_ms**
+----------+---------------------------+
| *Setter* | set_voice_delay_ms(value) |
+----------+---------------------------+
| *Getter* | get_voice_delay_ms() |
+----------+---------------------------+
The voice's signal delay.
----
.. _class_AudioEffectChorus_property_voice/3/depth_ms:
- :ref:`float<class_float>` **voice/3/depth_ms**
+----------+---------------------------+
| *Setter* | set_voice_depth_ms(value) |
+----------+---------------------------+
| *Getter* | get_voice_depth_ms() |
+----------+---------------------------+
The voice filter's depth.
----
.. _class_AudioEffectChorus_property_voice/3/level_db:
- :ref:`float<class_float>` **voice/3/level_db**
+----------+---------------------------+
| *Setter* | set_voice_level_db(value) |
+----------+---------------------------+
| *Getter* | get_voice_level_db() |
+----------+---------------------------+
The voice's volume.
----
.. _class_AudioEffectChorus_property_voice/3/pan:
- :ref:`float<class_float>` **voice/3/pan**
+----------+----------------------+
| *Setter* | set_voice_pan(value) |
+----------+----------------------+
| *Getter* | get_voice_pan() |
+----------+----------------------+
The voice's pan level.
----
.. _class_AudioEffectChorus_property_voice/3/rate_hz:
- :ref:`float<class_float>` **voice/3/rate_hz**
+----------+--------------------------+
| *Setter* | set_voice_rate_hz(value) |
+----------+--------------------------+
| *Getter* | get_voice_rate_hz() |
+----------+--------------------------+
The voice's filter rate.
----
.. _class_AudioEffectChorus_property_voice/4/cutoff_hz:
- :ref:`float<class_float>` **voice/4/cutoff_hz**
+----------+----------------------------+
| *Setter* | set_voice_cutoff_hz(value) |
+----------+----------------------------+
| *Getter* | get_voice_cutoff_hz() |
+----------+----------------------------+
The voice's cutoff frequency.
----
.. _class_AudioEffectChorus_property_voice/4/delay_ms:
- :ref:`float<class_float>` **voice/4/delay_ms**
+----------+---------------------------+
| *Setter* | set_voice_delay_ms(value) |
+----------+---------------------------+
| *Getter* | get_voice_delay_ms() |
+----------+---------------------------+
The voice's signal delay.
----
.. _class_AudioEffectChorus_property_voice/4/depth_ms:
- :ref:`float<class_float>` **voice/4/depth_ms**
+----------+---------------------------+
| *Setter* | set_voice_depth_ms(value) |
+----------+---------------------------+
| *Getter* | get_voice_depth_ms() |
+----------+---------------------------+
The voice filter's depth.
----
.. _class_AudioEffectChorus_property_voice/4/level_db:
- :ref:`float<class_float>` **voice/4/level_db**
+----------+---------------------------+
| *Setter* | set_voice_level_db(value) |
+----------+---------------------------+
| *Getter* | get_voice_level_db() |
+----------+---------------------------+
The voice's volume.
----
.. _class_AudioEffectChorus_property_voice/4/pan:
- :ref:`float<class_float>` **voice/4/pan**
+----------+----------------------+
| *Setter* | set_voice_pan(value) |
+----------+----------------------+
| *Getter* | get_voice_pan() |
+----------+----------------------+
The voice's pan level.
----
.. _class_AudioEffectChorus_property_voice/4/rate_hz:
- :ref:`float<class_float>` **voice/4/rate_hz**
+----------+--------------------------+
| *Setter* | set_voice_rate_hz(value) |
+----------+--------------------------+
| *Getter* | get_voice_rate_hz() |
+----------+--------------------------+
The voice's filter rate.
----
.. _class_AudioEffectChorus_property_voice_count:
- :ref:`int<class_int>` **voice_count**
+-----------+------------------------+
| *Default* | ``2`` |
+-----------+------------------------+
| *Setter* | set_voice_count(value) |
+-----------+------------------------+
| *Getter* | get_voice_count() |
+-----------+------------------------+
The amount of voices in the effect.
----
.. _class_AudioEffectChorus_property_wet:
- :ref:`float<class_float>` **wet**
+-----------+----------------+
| *Default* | ``0.5`` |
+-----------+----------------+
| *Setter* | set_wet(value) |
+-----------+----------------+
| *Getter* | get_wet() |
+-----------+----------------+
The effect's processed signal.
Method Descriptions
-------------------
.. _class_AudioEffectChorus_method_get_voice_cutoff_hz:
- :ref:`float<class_float>` **get_voice_cutoff_hz** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_get_voice_delay_ms:
- :ref:`float<class_float>` **get_voice_delay_ms** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_get_voice_depth_ms:
- :ref:`float<class_float>` **get_voice_depth_ms** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_get_voice_level_db:
- :ref:`float<class_float>` **get_voice_level_db** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_get_voice_pan:
- :ref:`float<class_float>` **get_voice_pan** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_get_voice_rate_hz:
- :ref:`float<class_float>` **get_voice_rate_hz** **(** :ref:`int<class_int>` voice_idx **)** |const|
----
.. _class_AudioEffectChorus_method_set_voice_cutoff_hz:
- void **set_voice_cutoff_hz** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` cutoff_hz **)**
----
.. _class_AudioEffectChorus_method_set_voice_delay_ms:
- void **set_voice_delay_ms** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` delay_ms **)**
----
.. _class_AudioEffectChorus_method_set_voice_depth_ms:
- void **set_voice_depth_ms** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` depth_ms **)**
----
.. _class_AudioEffectChorus_method_set_voice_level_db:
- void **set_voice_level_db** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` level_db **)**
----
.. _class_AudioEffectChorus_method_set_voice_pan:
- void **set_voice_pan** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` pan **)**
----
.. _class_AudioEffectChorus_method_set_voice_rate_hz:
- void **set_voice_rate_hz** **(** :ref:`int<class_int>` voice_idx, :ref:`float<class_float>` rate_hz **)**
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,168 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectCompressor.xml.
.. _class_AudioEffectCompressor:
AudioEffectCompressor
=====================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a compressor audio effect to an audio bus.
Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
Description
-----------
Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB).
Compressor has many uses in the mix:
- In the Master bus to compress the whole output (although an :ref:`AudioEffectLimiter<class_AudioEffectLimiter>` is probably better).
- In voice channels to ensure they sound as balanced as possible.
- Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard.
- Accentuates transients by using a wider attack, making effects sound more punchy.
Properties
----------
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`attack_us<class_AudioEffectCompressor_property_attack_us>` | ``20.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectCompressor_property_gain>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`mix<class_AudioEffectCompressor_property_mix>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`ratio<class_AudioEffectCompressor_property_ratio>` | ``4.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`release_ms<class_AudioEffectCompressor_property_release_ms>` | ``250.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`sidechain<class_AudioEffectCompressor_property_sidechain>` | ``""`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`threshold<class_AudioEffectCompressor_property_threshold>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AudioEffectCompressor_property_attack_us:
- :ref:`float<class_float>` **attack_us**
+-----------+----------------------+
| *Default* | ``20.0`` |
+-----------+----------------------+
| *Setter* | set_attack_us(value) |
+-----------+----------------------+
| *Getter* | get_attack_us() |
+-----------+----------------------+
Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.
----
.. _class_AudioEffectCompressor_property_gain:
- :ref:`float<class_float>` **gain**
+-----------+-----------------+
| *Default* | ``0.0`` |
+-----------+-----------------+
| *Setter* | set_gain(value) |
+-----------+-----------------+
| *Getter* | get_gain() |
+-----------+-----------------+
Gain applied to the output signal.
----
.. _class_AudioEffectCompressor_property_mix:
- :ref:`float<class_float>` **mix**
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_mix(value) |
+-----------+----------------+
| *Getter* | get_mix() |
+-----------+----------------+
Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).
----
.. _class_AudioEffectCompressor_property_ratio:
- :ref:`float<class_float>` **ratio**
+-----------+------------------+
| *Default* | ``4.0`` |
+-----------+------------------+
| *Setter* | set_ratio(value) |
+-----------+------------------+
| *Getter* | get_ratio() |
+-----------+------------------+
Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48.
----
.. _class_AudioEffectCompressor_property_release_ms:
- :ref:`float<class_float>` **release_ms**
+-----------+-----------------------+
| *Default* | ``250.0`` |
+-----------+-----------------------+
| *Setter* | set_release_ms(value) |
+-----------+-----------------------+
| *Getter* | get_release_ms() |
+-----------+-----------------------+
Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000.
----
.. _class_AudioEffectCompressor_property_sidechain:
- :ref:`String<class_String>` **sidechain**
+-----------+----------------------+
| *Default* | ``""`` |
+-----------+----------------------+
| *Setter* | set_sidechain(value) |
+-----------+----------------------+
| *Getter* | get_sidechain() |
+-----------+----------------------+
Reduce the sound level using another audio bus for threshold detection.
----
.. _class_AudioEffectCompressor_property_threshold:
- :ref:`float<class_float>` **threshold**
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_threshold(value) |
+-----------+----------------------+
| *Getter* | get_threshold() |
+-----------+----------------------+
The level above which compression is applied to the audio. Value can range from -60 to 0.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,266 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectDelay.xml.
.. _class_AudioEffectDelay:
AudioEffectDelay
================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a delay audio effect to an audio bus. Plays input signal back after a period of time.
Two tap delay and feedback options.
Description
-----------
Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds.
Properties
----------
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectDelay_property_dry>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`feedback/active<class_AudioEffectDelay_property_feedback/active>` | ``false`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/delay_ms<class_AudioEffectDelay_property_feedback/delay_ms>` | ``340.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/level_db<class_AudioEffectDelay_property_feedback/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/lowpass<class_AudioEffectDelay_property_feedback/lowpass>` | ``16000.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap1/active<class_AudioEffectDelay_property_tap1/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/delay_ms<class_AudioEffectDelay_property_tap1/delay_ms>` | ``250.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/level_db<class_AudioEffectDelay_property_tap1/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/pan<class_AudioEffectDelay_property_tap1/pan>` | ``0.2`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap2/active<class_AudioEffectDelay_property_tap2/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/delay_ms<class_AudioEffectDelay_property_tap2/delay_ms>` | ``500.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/level_db<class_AudioEffectDelay_property_tap2/level_db>` | ``-12.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/pan<class_AudioEffectDelay_property_tap2/pan>` | ``-0.4`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
Property Descriptions
---------------------
.. _class_AudioEffectDelay_property_dry:
- :ref:`float<class_float>` **dry**
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_dry(value) |
+-----------+----------------+
| *Getter* | get_dry() |
+-----------+----------------+
Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1.
----
.. _class_AudioEffectDelay_property_feedback/active:
- :ref:`bool<class_bool>` **feedback/active**
+-----------+----------------------------+
| *Default* | ``false`` |
+-----------+----------------------------+
| *Setter* | set_feedback_active(value) |
+-----------+----------------------------+
| *Getter* | is_feedback_active() |
+-----------+----------------------------+
If ``true``, feedback is enabled.
----
.. _class_AudioEffectDelay_property_feedback/delay_ms:
- :ref:`float<class_float>` **feedback/delay_ms**
+-----------+------------------------------+
| *Default* | ``340.0`` |
+-----------+------------------------------+
| *Setter* | set_feedback_delay_ms(value) |
+-----------+------------------------------+
| *Getter* | get_feedback_delay_ms() |
+-----------+------------------------------+
Feedback delay time in milliseconds.
----
.. _class_AudioEffectDelay_property_feedback/level_db:
- :ref:`float<class_float>` **feedback/level_db**
+-----------+------------------------------+
| *Default* | ``-6.0`` |
+-----------+------------------------------+
| *Setter* | set_feedback_level_db(value) |
+-----------+------------------------------+
| *Getter* | get_feedback_level_db() |
+-----------+------------------------------+
Sound level for ``tap1``.
----
.. _class_AudioEffectDelay_property_feedback/lowpass:
- :ref:`float<class_float>` **feedback/lowpass**
+-----------+-----------------------------+
| *Default* | ``16000.0`` |
+-----------+-----------------------------+
| *Setter* | set_feedback_lowpass(value) |
+-----------+-----------------------------+
| *Getter* | get_feedback_lowpass() |
+-----------+-----------------------------+
Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal.
----
.. _class_AudioEffectDelay_property_tap1/active:
- :ref:`bool<class_bool>` **tap1/active**
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_tap1_active(value) |
+-----------+------------------------+
| *Getter* | is_tap1_active() |
+-----------+------------------------+
If ``true``, ``tap1`` will be enabled.
----
.. _class_AudioEffectDelay_property_tap1/delay_ms:
- :ref:`float<class_float>` **tap1/delay_ms**
+-----------+--------------------------+
| *Default* | ``250.0`` |
+-----------+--------------------------+
| *Setter* | set_tap1_delay_ms(value) |
+-----------+--------------------------+
| *Getter* | get_tap1_delay_ms() |
+-----------+--------------------------+
``tap1`` delay time in milliseconds.
----
.. _class_AudioEffectDelay_property_tap1/level_db:
- :ref:`float<class_float>` **tap1/level_db**
+-----------+--------------------------+
| *Default* | ``-6.0`` |
+-----------+--------------------------+
| *Setter* | set_tap1_level_db(value) |
+-----------+--------------------------+
| *Getter* | get_tap1_level_db() |
+-----------+--------------------------+
Sound level for ``tap1``.
----
.. _class_AudioEffectDelay_property_tap1/pan:
- :ref:`float<class_float>` **tap1/pan**
+-----------+---------------------+
| *Default* | ``0.2`` |
+-----------+---------------------+
| *Setter* | set_tap1_pan(value) |
+-----------+---------------------+
| *Getter* | get_tap1_pan() |
+-----------+---------------------+
Pan position for ``tap1``. Value can range from -1 (fully left) to 1 (fully right).
----
.. _class_AudioEffectDelay_property_tap2/active:
- :ref:`bool<class_bool>` **tap2/active**
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_tap2_active(value) |
+-----------+------------------------+
| *Getter* | is_tap2_active() |
+-----------+------------------------+
If ``true``, ``tap2`` will be enabled.
----
.. _class_AudioEffectDelay_property_tap2/delay_ms:
- :ref:`float<class_float>` **tap2/delay_ms**
+-----------+--------------------------+
| *Default* | ``500.0`` |
+-----------+--------------------------+
| *Setter* | set_tap2_delay_ms(value) |
+-----------+--------------------------+
| *Getter* | get_tap2_delay_ms() |
+-----------+--------------------------+
**Tap2** delay time in milliseconds.
----
.. _class_AudioEffectDelay_property_tap2/level_db:
- :ref:`float<class_float>` **tap2/level_db**
+-----------+--------------------------+
| *Default* | ``-12.0`` |
+-----------+--------------------------+
| *Setter* | set_tap2_level_db(value) |
+-----------+--------------------------+
| *Getter* | get_tap2_level_db() |
+-----------+--------------------------+
Sound level for ``tap2``.
----
.. _class_AudioEffectDelay_property_tap2/pan:
- :ref:`float<class_float>` **tap2/pan**
+-----------+---------------------+
| *Default* | ``-0.4`` |
+-----------+---------------------+
| *Setter* | set_tap2_pan(value) |
+-----------+---------------------+
| *Getter* | get_tap2_pan() |
+-----------+---------------------+
Pan position for ``tap2``. Value can range from -1 (fully left) to 1 (fully right).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,156 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectDistortion.xml.
.. _class_AudioEffectDistortion:
AudioEffectDistortion
=====================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a distortion audio effect to an Audio bus.
Modify the sound to make it distorted.
Description
-----------
Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.
By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
Properties
----------
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`drive<class_AudioEffectDistortion_property_drive>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`keep_hf_hz<class_AudioEffectDistortion_property_keep_hf_hz>` | ``16000.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`Mode<enum_AudioEffectDistortion_Mode>` | :ref:`mode<class_AudioEffectDistortion_property_mode>` | ``0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`post_gain<class_AudioEffectDistortion_property_post_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`pre_gain<class_AudioEffectDistortion_property_pre_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
Enumerations
------------
.. _enum_AudioEffectDistortion_Mode:
.. _class_AudioEffectDistortion_constant_MODE_CLIP:
.. _class_AudioEffectDistortion_constant_MODE_ATAN:
.. _class_AudioEffectDistortion_constant_MODE_LOFI:
.. _class_AudioEffectDistortion_constant_MODE_OVERDRIVE:
.. _class_AudioEffectDistortion_constant_MODE_WAVESHAPE:
enum **Mode**:
- **MODE_CLIP** = **0** --- Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
- **MODE_ATAN** = **1**
- **MODE_LOFI** = **2** --- Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices.
- **MODE_OVERDRIVE** = **3** --- Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers.
- **MODE_WAVESHAPE** = **4** --- Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
Property Descriptions
---------------------
.. _class_AudioEffectDistortion_property_drive:
- :ref:`float<class_float>` **drive**
+-----------+------------------+
| *Default* | ``0.0`` |
+-----------+------------------+
| *Setter* | set_drive(value) |
+-----------+------------------+
| *Getter* | get_drive() |
+-----------+------------------+
Distortion power. Value can range from 0 to 1.
----
.. _class_AudioEffectDistortion_property_keep_hf_hz:
- :ref:`float<class_float>` **keep_hf_hz**
+-----------+-----------------------+
| *Default* | ``16000.0`` |
+-----------+-----------------------+
| *Setter* | set_keep_hf_hz(value) |
+-----------+-----------------------+
| *Getter* | get_keep_hf_hz() |
+-----------+-----------------------+
High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000.
----
.. _class_AudioEffectDistortion_property_mode:
- :ref:`Mode<enum_AudioEffectDistortion_Mode>` **mode**
+-----------+-----------------+
| *Default* | ``0`` |
+-----------+-----------------+
| *Setter* | set_mode(value) |
+-----------+-----------------+
| *Getter* | get_mode() |
+-----------+-----------------+
Distortion type.
----
.. _class_AudioEffectDistortion_property_post_gain:
- :ref:`float<class_float>` **post_gain**
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_post_gain(value) |
+-----------+----------------------+
| *Getter* | get_post_gain() |
+-----------+----------------------+
Increases or decreases the volume after the effect. Value can range from -80 to 24.
----
.. _class_AudioEffectDistortion_property_pre_gain:
- :ref:`float<class_float>` **pre_gain**
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_pre_gain(value) |
+-----------+---------------------+
| *Getter* | get_pre_gain() |
+-----------+---------------------+
Increases or decreases the volume before the effect. Value can range from -60 to 60.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,64 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectEQ.xml.
.. _class_AudioEffectEQ:
AudioEffectEQ
=============
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioEffectEQ10<class_AudioEffectEQ10>`, :ref:`AudioEffectEQ21<class_AudioEffectEQ21>`, :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`
Base class for audio equalizers. Gives you control over frequencies.
Use it to create a custom equalizer if :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>` or :ref:`AudioEffectEQ21<class_AudioEffectEQ21>` don't fit your needs.
Description
-----------
AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged).
Methods
-------
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_band_count<class_AudioEffectEQ_method_get_band_count>` **(** **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_band_gain_db<class_AudioEffectEQ_method_get_band_gain_db>` **(** :ref:`int<class_int>` band_idx **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_band_gain_db<class_AudioEffectEQ_method_set_band_gain_db>` **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)** |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AudioEffectEQ_method_get_band_count:
- :ref:`int<class_int>` **get_band_count** **(** **)** |const|
Returns the number of bands of the equalizer.
----
.. _class_AudioEffectEQ_method_get_band_gain_db:
- :ref:`float<class_float>` **get_band_gain_db** **(** :ref:`int<class_int>` band_idx **)** |const|
Returns the band's gain at the specified index, in dB.
----
.. _class_AudioEffectEQ_method_set_band_gain_db:
- void **set_band_gain_db** **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)**
Sets band's gain at the specified index, in dB.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,48 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectEQ10.xml.
.. _class_AudioEffectEQ10:
AudioEffectEQ10
===============
**Inherits:** :ref:`AudioEffectEQ<class_AudioEffectEQ>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz.
Each frequency can be modulated between -60/+24 dB.
Description
-----------
Frequency bands:
Band 1: 31 Hz
Band 2: 62 Hz
Band 3: 125 Hz
Band 4: 250 Hz
Band 5: 500 Hz
Band 6: 1000 Hz
Band 7: 2000 Hz
Band 8: 4000 Hz
Band 9: 8000 Hz
Band 10: 16000 Hz
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ21<class_AudioEffectEQ21>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,70 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectEQ21.xml.
.. _class_AudioEffectEQ21:
AudioEffectEQ21
===============
**Inherits:** :ref:`AudioEffectEQ<class_AudioEffectEQ>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz.
Each frequency can be modulated between -60/+24 dB.
Description
-----------
Frequency bands:
Band 1: 22 Hz
Band 2: 32 Hz
Band 3: 44 Hz
Band 4: 63 Hz
Band 5: 90 Hz
Band 6: 125 Hz
Band 7: 175 Hz
Band 8: 250 Hz
Band 9: 350 Hz
Band 10: 500 Hz
Band 11: 700 Hz
Band 12: 1000 Hz
Band 13: 1400 Hz
Band 14: 2000 Hz
Band 15: 2800 Hz
Band 16: 4000 Hz
Band 17: 5600 Hz
Band 18: 8000 Hz
Band 19: 11000 Hz
Band 20: 16000 Hz
Band 21: 22000 Hz
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,40 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectEQ6.xml.
.. _class_AudioEffectEQ6:
AudioEffectEQ6
==============
**Inherits:** :ref:`AudioEffectEQ<class_AudioEffectEQ>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz.
Each frequency can be modulated between -60/+24 dB.
Description
-----------
Frequency bands:
Band 1: 32 Hz
Band 2: 100 Hz
Band 3: 320 Hz
Band 4: 1000 Hz
Band 5: 3200 Hz
Band 6: 10000 Hz
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>`, :ref:`AudioEffectEQ21<class_AudioEffectEQ21>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,130 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectFilter.xml.
.. _class_AudioEffectFilter:
AudioEffectFilter
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioEffectBandLimitFilter<class_AudioEffectBandLimitFilter>`, :ref:`AudioEffectBandPassFilter<class_AudioEffectBandPassFilter>`, :ref:`AudioEffectHighPassFilter<class_AudioEffectHighPassFilter>`, :ref:`AudioEffectHighShelfFilter<class_AudioEffectHighShelfFilter>`, :ref:`AudioEffectLowPassFilter<class_AudioEffectLowPassFilter>`, :ref:`AudioEffectLowShelfFilter<class_AudioEffectLowShelfFilter>`, :ref:`AudioEffectNotchFilter<class_AudioEffectNotchFilter>`
Adds a filter to the audio bus.
Description
-----------
Allows frequencies other than the :ref:`cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` to pass.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
Properties
----------
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` | ``2000.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` | :ref:`db<class_AudioEffectFilter_property_db>` | ``0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectFilter_property_gain>` | ``1.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`resonance<class_AudioEffectFilter_property_resonance>` | ``0.5`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
Enumerations
------------
.. _enum_AudioEffectFilter_FilterDB:
.. _class_AudioEffectFilter_constant_FILTER_6DB:
.. _class_AudioEffectFilter_constant_FILTER_12DB:
.. _class_AudioEffectFilter_constant_FILTER_18DB:
.. _class_AudioEffectFilter_constant_FILTER_24DB:
enum **FilterDB**:
- **FILTER_6DB** = **0**
- **FILTER_12DB** = **1**
- **FILTER_18DB** = **2**
- **FILTER_24DB** = **3**
Property Descriptions
---------------------
.. _class_AudioEffectFilter_property_cutoff_hz:
- :ref:`float<class_float>` **cutoff_hz**
+-----------+-------------------+
| *Default* | ``2000.0`` |
+-----------+-------------------+
| *Setter* | set_cutoff(value) |
+-----------+-------------------+
| *Getter* | get_cutoff() |
+-----------+-------------------+
Threshold frequency for the filter, in Hz.
----
.. _class_AudioEffectFilter_property_db:
- :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **db**
+-----------+---------------+
| *Default* | ``0`` |
+-----------+---------------+
| *Setter* | set_db(value) |
+-----------+---------------+
| *Getter* | get_db() |
+-----------+---------------+
----
.. _class_AudioEffectFilter_property_gain:
- :ref:`float<class_float>` **gain**
+-----------+-----------------+
| *Default* | ``1.0`` |
+-----------+-----------------+
| *Setter* | set_gain(value) |
+-----------+-----------------+
| *Getter* | get_gain() |
+-----------+-----------------+
Gain amount of the frequencies after the filter.
----
.. _class_AudioEffectFilter_property_resonance:
- :ref:`float<class_float>` **resonance**
+-----------+----------------------+
| *Default* | ``0.5`` |
+-----------+----------------------+
| *Setter* | set_resonance(value) |
+-----------+----------------------+
| *Getter* | get_resonance() |
+-----------+----------------------+
Amount of boost in the frequency range near the cutoff frequency.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectHighPassFilter.xml.
.. _class_AudioEffectHighPassFilter:
AudioEffectHighPassFilter
=========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a high-pass filter to the Audio Bus.
Description
-----------
Cuts frequencies lower than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows higher frequencies to pass.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectHighShelfFilter.xml.
.. _class_AudioEffectHighShelfFilter:
AudioEffectHighShelfFilter
==========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Reduces all frequencies above the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,21 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectInstance.xml.
.. _class_AudioEffectInstance:
AudioEffectInstance
===================
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioEffectSpectrumAnalyzerInstance<class_AudioEffectSpectrumAnalyzerInstance>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,102 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectLimiter.xml.
.. _class_AudioEffectLimiter:
AudioEffectLimiter
==================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a soft-clip limiter audio effect to an Audio bus.
Description
-----------
A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects of clipping.
Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded.
Properties
----------
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`ceiling_db<class_AudioEffectLimiter_property_ceiling_db>` | ``-0.1`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_db<class_AudioEffectLimiter_property_soft_clip_db>` | ``2.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_ratio<class_AudioEffectLimiter_property_soft_clip_ratio>` | ``10.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`threshold_db<class_AudioEffectLimiter_property_threshold_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
Property Descriptions
---------------------
.. _class_AudioEffectLimiter_property_ceiling_db:
- :ref:`float<class_float>` **ceiling_db**
+-----------+-----------------------+
| *Default* | ``-0.1`` |
+-----------+-----------------------+
| *Setter* | set_ceiling_db(value) |
+-----------+-----------------------+
| *Getter* | get_ceiling_db() |
+-----------+-----------------------+
The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1.
----
.. _class_AudioEffectLimiter_property_soft_clip_db:
- :ref:`float<class_float>` **soft_clip_db**
+-----------+-------------------------+
| *Default* | ``2.0`` |
+-----------+-------------------------+
| *Setter* | set_soft_clip_db(value) |
+-----------+-------------------------+
| *Getter* | get_soft_clip_db() |
+-----------+-------------------------+
Applies a gain to the limited waves, in decibels. Value can range from 0 to 6.
----
.. _class_AudioEffectLimiter_property_soft_clip_ratio:
- :ref:`float<class_float>` **soft_clip_ratio**
+-----------+----------------------------+
| *Default* | ``10.0`` |
+-----------+----------------------------+
| *Setter* | set_soft_clip_ratio(value) |
+-----------+----------------------------+
| *Getter* | get_soft_clip_ratio() |
+-----------+----------------------------+
----
.. _class_AudioEffectLimiter_property_threshold_db:
- :ref:`float<class_float>` **threshold_db**
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_threshold_db(value) |
+-----------+-------------------------+
| *Getter* | get_threshold_db() |
+-----------+-------------------------+
Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectLowPassFilter.xml.
.. _class_AudioEffectLowPassFilter:
AudioEffectLowPassFilter
========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a low-pass filter to the Audio bus.
Description
-----------
Cuts frequencies higher than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows lower frequencies to pass.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectLowShelfFilter.xml.
.. _class_AudioEffectLowShelfFilter:
AudioEffectLowShelfFilter
=========================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Reduces all frequencies below the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,24 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectNotchFilter.xml.
.. _class_AudioEffectNotchFilter:
AudioEffectNotchFilter
======================
**Inherits:** :ref:`AudioEffectFilter<class_AudioEffectFilter>` **<** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a notch filter to the Audio bus.
Description
-----------
Attenuates frequencies in a narrow band around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and cuts frequencies outside of this range.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,48 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectPanner.xml.
.. _class_AudioEffectPanner:
AudioEffectPanner
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a panner audio effect to an Audio bus. Pans sound left or right.
Description
-----------
Determines how much of an audio signal is sent to the left and right buses.
Properties
----------
+---------------------------+--------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan<class_AudioEffectPanner_property_pan>` | ``0.0`` |
+---------------------------+--------------------------------------------------+---------+
Property Descriptions
---------------------
.. _class_AudioEffectPanner_property_pan:
- :ref:`float<class_float>` **pan**
+-----------+----------------+
| *Default* | ``0.0`` |
+-----------+----------------+
| *Setter* | set_pan(value) |
+-----------+----------------+
| *Getter* | get_pan() |
+-----------+----------------+
Pan position. Value can range from -1 (fully left) to 1 (fully right).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,122 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectPhaser.xml.
.. _class_AudioEffectPhaser:
AudioEffectPhaser
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a phaser audio effect to an Audio bus.
Combines the original signal with a copy that is slightly out of phase with the original.
Description
-----------
Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator.
Properties
----------
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`depth<class_AudioEffectPhaser_property_depth>` | ``1.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`feedback<class_AudioEffectPhaser_property_feedback>` | ``0.7`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_max_hz<class_AudioEffectPhaser_property_range_max_hz>` | ``1600.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_min_hz<class_AudioEffectPhaser_property_range_min_hz>` | ``440.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`rate_hz<class_AudioEffectPhaser_property_rate_hz>` | ``0.5`` |
+---------------------------+--------------------------------------------------------------------+------------+
Property Descriptions
---------------------
.. _class_AudioEffectPhaser_property_depth:
- :ref:`float<class_float>` **depth**
+-----------+------------------+
| *Default* | ``1.0`` |
+-----------+------------------+
| *Setter* | set_depth(value) |
+-----------+------------------+
| *Getter* | get_depth() |
+-----------+------------------+
Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4.
----
.. _class_AudioEffectPhaser_property_feedback:
- :ref:`float<class_float>` **feedback**
+-----------+---------------------+
| *Default* | ``0.7`` |
+-----------+---------------------+
| *Setter* | set_feedback(value) |
+-----------+---------------------+
| *Getter* | get_feedback() |
+-----------+---------------------+
Output percent of modified sound. Value can range from 0.1 to 0.9.
----
.. _class_AudioEffectPhaser_property_range_max_hz:
- :ref:`float<class_float>` **range_max_hz**
+-----------+-------------------------+
| *Default* | ``1600.0`` |
+-----------+-------------------------+
| *Setter* | set_range_max_hz(value) |
+-----------+-------------------------+
| *Getter* | get_range_max_hz() |
+-----------+-------------------------+
Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000.
----
.. _class_AudioEffectPhaser_property_range_min_hz:
- :ref:`float<class_float>` **range_min_hz**
+-----------+-------------------------+
| *Default* | ``440.0`` |
+-----------+-------------------------+
| *Setter* | set_range_min_hz(value) |
+-----------+-------------------------+
| *Getter* | get_range_min_hz() |
+-----------+-------------------------+
Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000.
----
.. _class_AudioEffectPhaser_property_rate_hz:
- :ref:`float<class_float>` **rate_hz**
+-----------+--------------------+
| *Default* | ``0.5`` |
+-----------+--------------------+
| *Setter* | set_rate_hz(value) |
+-----------+--------------------+
| *Getter* | get_rate_hz() |
+-----------+--------------------+
Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,117 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectPitchShift.xml.
.. _class_AudioEffectPitchShift:
AudioEffectPitchShift
=====================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a pitch-shifting audio effect to an Audio bus.
Raises or lowers the pitch of original sound.
Description
-----------
Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients.
Properties
----------
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` | :ref:`fft_size<class_AudioEffectPitchShift_property_fft_size>` | ``3`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`oversampling<class_AudioEffectPitchShift_property_oversampling>` | ``4`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` | ``1.0`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
Enumerations
------------
.. _enum_AudioEffectPitchShift_FFT_Size:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_256:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_512:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_1024:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_2048:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_4096:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX:
enum **FFT_Size**:
- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` enum.
Property Descriptions
---------------------
.. _class_AudioEffectPitchShift_property_fft_size:
- :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **fft_size**
+-----------+---------------------+
| *Default* | ``3`` |
+-----------+---------------------+
| *Setter* | set_fft_size(value) |
+-----------+---------------------+
| *Getter* | get_fft_size() |
+-----------+---------------------+
The size of the `Fast Fourier transform <https://en.wikipedia.org/wiki/Fast_Fourier_transform>`__ buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes.
----
.. _class_AudioEffectPitchShift_property_oversampling:
- :ref:`int<class_int>` **oversampling**
+-----------+-------------------------+
| *Default* | ``4`` |
+-----------+-------------------------+
| *Setter* | set_oversampling(value) |
+-----------+-------------------------+
| *Getter* | get_oversampling() |
+-----------+-------------------------+
The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up.
----
.. _class_AudioEffectPitchShift_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaltered. :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` can range from ``0.0`` (infinitely low pitch, inaudible) to ``16`` (16 times higher than the initial pitch).
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,95 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectRecord.xml.
.. _class_AudioEffectRecord:
AudioEffectRecord
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Audio effect used for recording the sound from an audio bus.
Description
-----------
Allows the user to record the sound from an audio bus. This can include all audio output by Godot when used on the "Master" audio bus.
Can be used (with an :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`) to record from a microphone.
It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample.
Tutorials
---------
- :doc:`Recording with microphone <../tutorials/audio/recording_with_microphone>`
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
Properties
----------
+----------------------------------------------+--------------------------------------------------------+-------+
| :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioEffectRecord_property_format>` | ``1`` |
+----------------------------------------------+--------------------------------------------------------+-------+
Methods
-------
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamSample<class_AudioStreamSample>` | :ref:`get_recording<class_AudioEffectRecord_method_get_recording>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_recording_active<class_AudioEffectRecord_method_is_recording_active>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_recording_active<class_AudioEffectRecord_method_set_recording_active>` **(** :ref:`bool<class_bool>` record **)** |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_AudioEffectRecord_property_format:
- :ref:`Format<enum_AudioStreamSample_Format>` **format**
+-----------+-------------------+
| *Default* | ``1`` |
+-----------+-------------------+
| *Setter* | set_format(value) |
+-----------+-------------------+
| *Getter* | get_format() |
+-----------+-------------------+
Specifies the format in which the sample will be recorded. See :ref:`Format<enum_AudioStreamSample_Format>` for available formats.
Method Descriptions
-------------------
.. _class_AudioEffectRecord_method_get_recording:
- :ref:`AudioStreamSample<class_AudioStreamSample>` **get_recording** **(** **)** |const|
Returns the recorded sample.
----
.. _class_AudioEffectRecord_method_is_recording_active:
- :ref:`bool<class_bool>` **is_recording_active** **(** **)** |const|
Returns whether the recording is active or not.
----
.. _class_AudioEffectRecord_method_set_recording_active:
- void **set_recording_active** **(** :ref:`bool<class_bool>` record **)**
If ``true``, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,181 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectReverb.xml.
.. _class_AudioEffectReverb:
AudioEffectReverb
=================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Adds a reverberation audio effect to an Audio bus.
Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces.
Description
-----------
Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room.
Tutorials
---------
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
Properties
----------
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`damping<class_AudioEffectReverb_property_damping>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectReverb_property_dry>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`hipass<class_AudioEffectReverb_property_hipass>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_feedback<class_AudioEffectReverb_property_predelay_feedback>` | ``0.4`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_msec<class_AudioEffectReverb_property_predelay_msec>` | ``150.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`room_size<class_AudioEffectReverb_property_room_size>` | ``0.8`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`spread<class_AudioEffectReverb_property_spread>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`wet<class_AudioEffectReverb_property_wet>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_AudioEffectReverb_property_damping:
- :ref:`float<class_float>` **damping**
+-----------+--------------------+
| *Default* | ``0.5`` |
+-----------+--------------------+
| *Setter* | set_damping(value) |
+-----------+--------------------+
| *Getter* | get_damping() |
+-----------+--------------------+
Defines how reflective the imaginary room's walls are. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_dry:
- :ref:`float<class_float>` **dry**
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_dry(value) |
+-----------+----------------+
| *Getter* | get_dry() |
+-----------+----------------+
Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_hipass:
- :ref:`float<class_float>` **hipass**
+-----------+----------------+
| *Default* | ``0.0`` |
+-----------+----------------+
| *Setter* | set_hpf(value) |
+-----------+----------------+
| *Getter* | get_hpf() |
+-----------+----------------+
High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_predelay_feedback:
- :ref:`float<class_float>` **predelay_feedback**
+-----------+------------------------------+
| *Default* | ``0.4`` |
+-----------+------------------------------+
| *Setter* | set_predelay_feedback(value) |
+-----------+------------------------------+
| *Getter* | get_predelay_feedback() |
+-----------+------------------------------+
Output percent of predelay. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_predelay_msec:
- :ref:`float<class_float>` **predelay_msec**
+-----------+--------------------------+
| *Default* | ``150.0`` |
+-----------+--------------------------+
| *Setter* | set_predelay_msec(value) |
+-----------+--------------------------+
| *Getter* | get_predelay_msec() |
+-----------+--------------------------+
Time between the original signal and the early reflections of the reverb signal, in milliseconds.
----
.. _class_AudioEffectReverb_property_room_size:
- :ref:`float<class_float>` **room_size**
+-----------+----------------------+
| *Default* | ``0.8`` |
+-----------+----------------------+
| *Setter* | set_room_size(value) |
+-----------+----------------------+
| *Getter* | get_room_size() |
+-----------+----------------------+
Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_spread:
- :ref:`float<class_float>` **spread**
+-----------+-------------------+
| *Default* | ``1.0`` |
+-----------+-------------------+
| *Setter* | set_spread(value) |
+-----------+-------------------+
| *Getter* | get_spread() |
+-----------+-------------------+
Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1.
----
.. _class_AudioEffectReverb_property_wet:
- :ref:`float<class_float>` **wet**
+-----------+----------------+
| *Default* | ``0.5`` |
+-----------+----------------+
| *Setter* | set_wet(value) |
+-----------+----------------+
| *Getter* | get_wet() |
+-----------+----------------+
Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,122 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectSpectrumAnalyzer.xml.
.. _class_AudioEffectSpectrumAnalyzer:
AudioEffectSpectrumAnalyzer
===========================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Audio effect that can be used for real-time audio visualizations.
Description
-----------
This audio effect does not affect sound output, but can be used for real-time audio visualizations.
See also :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` for procedurally generating sounds.
Tutorials
---------
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
Properties
----------
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectSpectrumAnalyzer_property_buffer_length>` | ``2.0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` | :ref:`fft_size<class_AudioEffectSpectrumAnalyzer_property_fft_size>` | ``2`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`tap_back_pos<class_AudioEffectSpectrumAnalyzer_property_tap_back_pos>` | ``0.01`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
Enumerations
------------
.. _enum_AudioEffectSpectrumAnalyzer_FFT_Size:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_256:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_512:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_1024:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_2048:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_4096:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_MAX:
enum **FFT_Size**:
- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` enum.
Property Descriptions
---------------------
.. _class_AudioEffectSpectrumAnalyzer_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
+-----------+--------------------------+
| *Default* | ``2.0`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory.
----
.. _class_AudioEffectSpectrumAnalyzer_property_fft_size:
- :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **fft_size**
+-----------+---------------------+
| *Default* | ``2`` |
+-----------+---------------------+
| *Setter* | set_fft_size(value) |
+-----------+---------------------+
| *Getter* | get_fft_size() |
+-----------+---------------------+
The size of the `Fast Fourier transform <https://en.wikipedia.org/wiki/Fast_Fourier_transform>`__ buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes.
----
.. _class_AudioEffectSpectrumAnalyzer_property_tap_back_pos:
- :ref:`float<class_float>` **tap_back_pos**
+-----------+-------------------------+
| *Default* | ``0.01`` |
+-----------+-------------------------+
| *Setter* | set_tap_back_pos(value) |
+-----------+-------------------------+
| *Getter* | get_tap_back_pos() |
+-----------+-------------------------+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,48 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml.
.. _class_AudioEffectSpectrumAnalyzerInstance:
AudioEffectSpectrumAnalyzerInstance
===================================
**Inherits:** :ref:`AudioEffectInstance<class_AudioEffectInstance>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Methods
-------
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_magnitude_for_frequency_range<class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range>` **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode:
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_AVERAGE:
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_MAX:
enum **MagnitudeMode**:
- **MAGNITUDE_AVERAGE** = **0** --- Use the average value as magnitude.
- **MAGNITUDE_MAX** = **1** --- Use the maximum value as magnitude.
Method Descriptions
-------------------
.. _class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range:
- :ref:`Vector2<class_Vector2>` **get_magnitude_for_frequency_range** **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,73 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioEffectStereoEnhance.xml.
.. _class_AudioEffectStereoEnhance:
AudioEffectStereoEnhance
========================
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Properties
----------
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan_pullout<class_AudioEffectStereoEnhance_property_pan_pullout>` | ``1.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`surround<class_AudioEffectStereoEnhance_property_surround>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`time_pullout_ms<class_AudioEffectStereoEnhance_property_time_pullout_ms>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
Property Descriptions
---------------------
.. _class_AudioEffectStereoEnhance_property_pan_pullout:
- :ref:`float<class_float>` **pan_pullout**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pan_pullout(value) |
+-----------+------------------------+
| *Getter* | get_pan_pullout() |
+-----------+------------------------+
----
.. _class_AudioEffectStereoEnhance_property_surround:
- :ref:`float<class_float>` **surround**
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_surround(value) |
+-----------+---------------------+
| *Getter* | get_surround() |
+-----------+---------------------+
----
.. _class_AudioEffectStereoEnhance_property_time_pullout_ms:
- :ref:`float<class_float>` **time_pullout_ms**
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_time_pullout(value) |
+-----------+-------------------------+
| *Getter* | get_time_pullout() |
+-----------+-------------------------+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,537 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioServer.xml.
.. _class_AudioServer:
AudioServer
===========
**Inherits:** :ref:`Object<class_Object>`
Server interface for low-level audio access.
Description
-----------
``AudioServer`` is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
- `Audio Device Changer Demo <https://godotengine.org/asset-library/asset/525>`__
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
Properties
----------
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`bus_count<class_AudioServer_property_bus_count>` | ``1`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`capture_device<class_AudioServer_property_capture_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`device<class_AudioServer_property_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`float<class_float>` | :ref:`global_rate_scale<class_AudioServer_property_global_rate_scale>` | ``1.0`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
Methods
-------
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus<class_AudioServer_method_add_bus>` **(** :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus_effect<class_AudioServer_method_add_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioBusLayout<class_AudioBusLayout>` | :ref:`generate_bus_layout<class_AudioServer_method_generate_bus_layout>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_channels<class_AudioServer_method_get_bus_channels>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffect<class_AudioEffect>` | :ref:`get_bus_effect<class_AudioServer_method_get_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_effect_count<class_AudioServer_method_get_bus_effect_count>` **(** :ref:`int<class_int>` bus_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`get_bus_effect_instance<class_AudioServer_method_get_bus_effect_instance>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_index<class_AudioServer_method_get_bus_index>` **(** :ref:`String<class_String>` bus_name **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_name<class_AudioServer_method_get_bus_name>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_left_db<class_AudioServer_method_get_bus_peak_volume_left_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_right_db<class_AudioServer_method_get_bus_peak_volume_right_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_send<class_AudioServer_method_get_bus_send>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_volume_db<class_AudioServer_method_get_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_device_list<class_AudioServer_method_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_mix_rate<class_AudioServer_method_get_mix_rate>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_output_latency<class_AudioServer_method_get_output_latency>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` | :ref:`get_speaker_mode<class_AudioServer_method_get_speaker_mode>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_to_next_mix<class_AudioServer_method_get_time_to_next_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_bypassing_effects<class_AudioServer_method_is_bus_bypassing_effects>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_effect_enabled<class_AudioServer_method_is_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_mute<class_AudioServer_method_is_bus_mute>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_solo<class_AudioServer_method_is_bus_solo>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`lock<class_AudioServer_method_lock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`move_bus<class_AudioServer_method_move_bus>` **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus<class_AudioServer_method_remove_bus>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus_effect<class_AudioServer_method_remove_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_bypass_effects<class_AudioServer_method_set_bus_bypass_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_effect_enabled<class_AudioServer_method_set_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_layout<class_AudioServer_method_set_bus_layout>` **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_mute<class_AudioServer_method_set_bus_mute>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_name<class_AudioServer_method_set_bus_name>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_send<class_AudioServer_method_set_bus_send>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_solo<class_AudioServer_method_set_bus_solo>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_volume_db<class_AudioServer_method_set_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`swap_bus_effects<class_AudioServer_method_swap_bus_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unlock<class_AudioServer_method_unlock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AudioServer_signal_bus_layout_changed:
- **bus_layout_changed** **(** **)**
Emitted when the :ref:`AudioBusLayout<class_AudioBusLayout>` changes.
Enumerations
------------
.. _enum_AudioServer_SpeakerMode:
.. _class_AudioServer_constant_SPEAKER_MODE_STEREO:
.. _class_AudioServer_constant_SPEAKER_SURROUND_31:
.. _class_AudioServer_constant_SPEAKER_SURROUND_51:
.. _class_AudioServer_constant_SPEAKER_SURROUND_71:
enum **SpeakerMode**:
- **SPEAKER_MODE_STEREO** = **0** --- Two or fewer speakers were detected.
- **SPEAKER_SURROUND_31** = **1** --- A 3.1 channel surround setup was detected.
- **SPEAKER_SURROUND_51** = **2** --- A 5.1 channel surround setup was detected.
- **SPEAKER_SURROUND_71** = **3** --- A 7.1 channel surround setup was detected.
Property Descriptions
---------------------
.. _class_AudioServer_property_bus_count:
- :ref:`int<class_int>` **bus_count**
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_bus_count(value) |
+-----------+----------------------+
| *Getter* | get_bus_count() |
+-----------+----------------------+
Number of available audio buses.
----
.. _class_AudioServer_property_capture_device:
- :ref:`String<class_String>` **capture_device**
+-----------+---------------------------+
| *Default* | ``"Default"`` |
+-----------+---------------------------+
| *Setter* | capture_set_device(value) |
+-----------+---------------------------+
| *Getter* | capture_get_device() |
+-----------+---------------------------+
Name of the current device for audio input (see :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>`). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value ``"Default"`` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
----
.. _class_AudioServer_property_device:
- :ref:`String<class_String>` **device**
+-----------+-------------------+
| *Default* | ``"Default"`` |
+-----------+-------------------+
| *Setter* | set_device(value) |
+-----------+-------------------+
| *Getter* | get_device() |
+-----------+-------------------+
Name of the current device for audio output (see :ref:`get_device_list<class_AudioServer_method_get_device_list>`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``.
----
.. _class_AudioServer_property_global_rate_scale:
- :ref:`float<class_float>` **global_rate_scale**
+-----------+------------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------------+
| *Setter* | set_global_rate_scale(value) |
+-----------+------------------------------+
| *Getter* | get_global_rate_scale() |
+-----------+------------------------------+
Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played twice as fast).
Method Descriptions
-------------------
.. _class_AudioServer_method_add_bus:
- void **add_bus** **(** :ref:`int<class_int>` at_position=-1 **)**
Adds a bus at ``at_position``.
----
.. _class_AudioServer_method_add_bus_effect:
- void **add_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)**
Adds an :ref:`AudioEffect<class_AudioEffect>` effect to the bus ``bus_idx`` at ``at_position``.
----
.. _class_AudioServer_method_capture_get_device_list:
- :ref:`Array<class_Array>` **capture_get_device_list** **(** **)**
Returns the names of all audio input devices detected on the system.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
----
.. _class_AudioServer_method_generate_bus_layout:
- :ref:`AudioBusLayout<class_AudioBusLayout>` **generate_bus_layout** **(** **)** |const|
Generates an :ref:`AudioBusLayout<class_AudioBusLayout>` using the available buses and effects.
----
.. _class_AudioServer_method_get_bus_channels:
- :ref:`int<class_int>` **get_bus_channels** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the amount of channels of the bus at index ``bus_idx``.
----
.. _class_AudioServer_method_get_bus_effect:
- :ref:`AudioEffect<class_AudioEffect>` **get_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
Returns the :ref:`AudioEffect<class_AudioEffect>` at position ``effect_idx`` in bus ``bus_idx``.
----
.. _class_AudioServer_method_get_bus_effect_count:
- :ref:`int<class_int>` **get_bus_effect_count** **(** :ref:`int<class_int>` bus_idx **)**
Returns the number of effects on the bus at ``bus_idx``.
----
.. _class_AudioServer_method_get_bus_effect_instance:
- :ref:`AudioEffectInstance<class_AudioEffectInstance>` **get_bus_effect_instance** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)**
Returns the :ref:`AudioEffectInstance<class_AudioEffectInstance>` assigned to the given bus and effect indices (and optionally channel).
----
.. _class_AudioServer_method_get_bus_index:
- :ref:`int<class_int>` **get_bus_index** **(** :ref:`String<class_String>` bus_name **)** |const|
Returns the index of the bus with the name ``bus_name``.
----
.. _class_AudioServer_method_get_bus_name:
- :ref:`String<class_String>` **get_bus_name** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the name of the bus with the index ``bus_idx``.
----
.. _class_AudioServer_method_get_bus_peak_volume_left_db:
- :ref:`float<class_float>` **get_bus_peak_volume_left_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
Returns the peak volume of the left speaker at bus index ``bus_idx`` and channel index ``channel``.
----
.. _class_AudioServer_method_get_bus_peak_volume_right_db:
- :ref:`float<class_float>` **get_bus_peak_volume_right_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
Returns the peak volume of the right speaker at bus index ``bus_idx`` and channel index ``channel``.
----
.. _class_AudioServer_method_get_bus_send:
- :ref:`String<class_String>` **get_bus_send** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the name of the bus that the bus at index ``bus_idx`` sends to.
----
.. _class_AudioServer_method_get_bus_volume_db:
- :ref:`float<class_float>` **get_bus_volume_db** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the volume of the bus at index ``bus_idx`` in dB.
----
.. _class_AudioServer_method_get_device_list:
- :ref:`Array<class_Array>` **get_device_list** **(** **)**
Returns the names of all audio devices detected on the system.
----
.. _class_AudioServer_method_get_mix_rate:
- :ref:`float<class_float>` **get_mix_rate** **(** **)** |const|
Returns the sample rate at the output of the ``AudioServer``.
----
.. _class_AudioServer_method_get_output_latency:
- :ref:`float<class_float>` **get_output_latency** **(** **)** |const|
Returns the audio driver's output latency.
----
.. _class_AudioServer_method_get_speaker_mode:
- :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **get_speaker_mode** **(** **)** |const|
Returns the speaker configuration.
----
.. _class_AudioServer_method_get_time_since_last_mix:
- :ref:`float<class_float>` **get_time_since_last_mix** **(** **)** |const|
Returns the relative time since the last mix occurred.
----
.. _class_AudioServer_method_get_time_to_next_mix:
- :ref:`float<class_float>` **get_time_to_next_mix** **(** **)** |const|
Returns the relative time until the next mix occurs.
----
.. _class_AudioServer_method_is_bus_bypassing_effects:
- :ref:`bool<class_bool>` **is_bus_bypassing_effects** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is bypassing effects.
----
.. _class_AudioServer_method_is_bus_effect_enabled:
- :ref:`bool<class_bool>` **is_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const|
If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
----
.. _class_AudioServer_method_is_bus_mute:
- :ref:`bool<class_bool>` **is_bus_mute** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is muted.
----
.. _class_AudioServer_method_is_bus_solo:
- :ref:`bool<class_bool>` **is_bus_solo** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is in solo mode.
----
.. _class_AudioServer_method_lock:
- void **lock** **(** **)**
Locks the audio driver's main loop.
\ **Note:** Remember to unlock it afterwards.
----
.. _class_AudioServer_method_move_bus:
- void **move_bus** **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)**
Moves the bus from index ``index`` to index ``to_index``.
----
.. _class_AudioServer_method_remove_bus:
- void **remove_bus** **(** :ref:`int<class_int>` index **)**
Removes the bus at index ``index``.
----
.. _class_AudioServer_method_remove_bus_effect:
- void **remove_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
Removes the effect at index ``effect_idx`` from the bus at index ``bus_idx``.
----
.. _class_AudioServer_method_set_bus_bypass_effects:
- void **set_bus_bypass_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is bypassing effects.
----
.. _class_AudioServer_method_set_bus_effect_enabled:
- void **set_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)**
If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
----
.. _class_AudioServer_method_set_bus_layout:
- void **set_bus_layout** **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)**
Overwrites the currently used :ref:`AudioBusLayout<class_AudioBusLayout>`.
----
.. _class_AudioServer_method_set_bus_mute:
- void **set_bus_mute** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is muted.
----
.. _class_AudioServer_method_set_bus_name:
- void **set_bus_name** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)**
Sets the name of the bus at index ``bus_idx`` to ``name``.
----
.. _class_AudioServer_method_set_bus_send:
- void **set_bus_send** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)**
Connects the output of the bus at ``bus_idx`` to the bus named ``send``.
----
.. _class_AudioServer_method_set_bus_solo:
- void **set_bus_solo** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is in solo mode.
----
.. _class_AudioServer_method_set_bus_volume_db:
- void **set_bus_volume_db** **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)**
Sets the volume of the bus at index ``bus_idx`` to ``volume_db``.
----
.. _class_AudioServer_method_swap_bus_effects:
- void **swap_bus_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)**
Swaps the position of two effects in bus ``bus_idx``.
----
.. _class_AudioServer_method_unlock:
- void **unlock** **(** **)**
Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,53 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStream.xml.
.. _class_AudioStream:
AudioStream
===========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`, :ref:`AudioStreamMP3<class_AudioStreamMP3>`, :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`, :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`, :ref:`AudioStreamRandomPitch<class_AudioStreamRandomPitch>`, :ref:`AudioStreamSample<class_AudioStreamSample>`
Base class for audio streams.
Description
-----------
Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via :ref:`AudioStreamSample<class_AudioStreamSample>`) and OGG (via :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`) file formats.
Tutorials
---------
- :doc:`Audio streams <../tutorials/audio/audio_streams>`
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
Methods
-------
+---------------------------+----------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AudioStream_method_get_length:
- :ref:`float<class_float>` **get_length** **(** **)** |const|
Returns the length of the audio stream in seconds.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,81 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamGenerator.xml.
.. _class_AudioStreamGenerator:
AudioStreamGenerator
====================
**Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Audio stream that generates sounds procedurally.
Description
-----------
This audio stream does not play back sounds, but expects a script to generate audio data for it instead. See also :ref:`AudioStreamGeneratorPlayback<class_AudioStreamGeneratorPlayback>`.
See also :ref:`AudioEffectSpectrumAnalyzer<class_AudioEffectSpectrumAnalyzer>` for performing real-time audio spectrum analysis.
\ **Note:** Due to performance constraints, this class is best used from C# or from a compiled language via GDNative. If you still want to use this class from GDScript, consider using a lower :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>` such as 11,025 Hz or 22,050 Hz.
Tutorials
---------
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
Properties
----------
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioStreamGenerator_property_buffer_length>` | ``0.5`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>` | ``44100.0`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
Property Descriptions
---------------------
.. _class_AudioStreamGenerator_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
+-----------+--------------------------+
| *Default* | ``0.5`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up.
----
.. _class_AudioStreamGenerator_property_mix_rate:
- :ref:`float<class_float>` **mix_rate**
+-----------+---------------------+
| *Default* | ``44100.0`` |
+-----------+---------------------+
| *Setter* | set_mix_rate(value) |
+-----------+---------------------+
| *Getter* | get_mix_rate() |
+-----------+---------------------+
The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality.
In games, common sample rates in use are ``11025``, ``16000``, ``22050``, ``32000``, ``44100``, and ``48000``.
According to the `Nyquist-Shannon sampling theorem <https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem>`__, there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as ``32000`` or ``22050`` may be usable with no loss in quality.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,95 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamGeneratorPlayback.xml.
.. _class_AudioStreamGeneratorPlayback:
AudioStreamGeneratorPlayback
============================
**Inherits:** :ref:`AudioStreamPlaybackResampled<class_AudioStreamPlaybackResampled>` **<** :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Plays back audio generated using :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`.
Description
-----------
This class is meant to be used with :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` to play back the generated audio in real-time.
Tutorials
---------
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
Methods
-------
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_push_buffer<class_AudioStreamGeneratorPlayback_method_can_push_buffer>` **(** :ref:`int<class_int>` amount **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioStreamGeneratorPlayback_method_clear_buffer>` **(** **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioStreamGeneratorPlayback_method_get_frames_available>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_skips<class_AudioStreamGeneratorPlayback_method_get_skips>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` **(** :ref:`Vector2<class_Vector2>` frame **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_AudioStreamGeneratorPlayback_method_can_push_buffer:
- :ref:`bool<class_bool>` **can_push_buffer** **(** :ref:`int<class_int>` amount **)** |const|
Returns ``true`` if a buffer of the size ``amount`` can be pushed to the audio sample data buffer without overflowing it, ``false`` otherwise.
----
.. _class_AudioStreamGeneratorPlayback_method_clear_buffer:
- void **clear_buffer** **(** **)**
Clears the audio sample data buffer.
----
.. _class_AudioStreamGeneratorPlayback_method_get_frames_available:
- :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
Returns the number of audio data frames left to play. If this returned number reaches ``0``, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking.
----
.. _class_AudioStreamGeneratorPlayback_method_get_skips:
- :ref:`int<class_int>` **get_skips** **(** **)** |const|
----
.. _class_AudioStreamGeneratorPlayback_method_push_buffer:
- :ref:`bool<class_bool>` **push_buffer** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)**
Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` in C# and compiled languages via GDNative, but :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` may be *less* efficient in GDScript.
----
.. _class_AudioStreamGeneratorPlayback_method_push_frame:
- :ref:`bool<class_bool>` **push_frame** **(** :ref:`Vector2<class_Vector2>` frame **)**
Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` in C# and compiled languages via GDNative, but :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` may be *more* efficient in GDScript.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,31 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamMicrophone.xml.
.. _class_AudioStreamMicrophone:
AudioStreamMicrophone
=====================
**Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Plays real-time audio input data.
Description
-----------
When used directly in an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` node, ``AudioStreamMicrophone`` plays back microphone input in real-time. This can be used in conjunction with :ref:`AudioEffectCapture<class_AudioEffectCapture>` to process the data or save it.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
Tutorials
---------
- `Audio Mic Record Demo <https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record>`__
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,84 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/modules/minimp3/doc_classes/AudioStreamMP3.xml.
.. _class_AudioStreamMP3:
AudioStreamMP3
==============
**Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
MP3 audio stream driver.
Description
-----------
MP3 audio stream driver.
Properties
----------
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamMP3_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamMP3_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamMP3_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
Property Descriptions
---------------------
.. _class_AudioStreamMP3_property_data:
- :ref:`PoolByteArray<class_PoolByteArray>` **data**
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data(value) |
+-----------+-----------------------+
| *Getter* | get_data() |
+-----------+-----------------------+
Contains the audio data in bytes.
----
.. _class_AudioStreamMP3_property_loop:
- :ref:`bool<class_bool>` **loop**
+-----------+-----------------+
| *Default* | ``false`` |
+-----------+-----------------+
| *Setter* | set_loop(value) |
+-----------+-----------------+
| *Getter* | has_loop() |
+-----------+-----------------+
If ``true``, the stream will automatically loop when it reaches the end.
----
.. _class_AudioStreamMP3_property_loop_offset:
- :ref:`float<class_float>` **loop_offset**
+-----------+------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------+
| *Setter* | set_loop_offset(value) |
+-----------+------------------------+
| *Getter* | get_loop_offset() |
+-----------+------------------------+
Time in seconds at which the stream starts after being looped.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,84 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml.
.. _class_AudioStreamOGGVorbis:
AudioStreamOGGVorbis
====================
**Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
OGG Vorbis audio stream driver.
Description
-----------
OGG Vorbis audio stream driver.
Properties
----------
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamOGGVorbis_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamOGGVorbis_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamOGGVorbis_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
Property Descriptions
---------------------
.. _class_AudioStreamOGGVorbis_property_data:
- :ref:`PoolByteArray<class_PoolByteArray>` **data**
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data(value) |
+-----------+-----------------------+
| *Getter* | get_data() |
+-----------+-----------------------+
Contains the audio data in bytes.
----
.. _class_AudioStreamOGGVorbis_property_loop:
- :ref:`bool<class_bool>` **loop**
+-----------+-----------------+
| *Default* | ``false`` |
+-----------+-----------------+
| *Setter* | set_loop(value) |
+-----------+-----------------+
| *Getter* | has_loop() |
+-----------+-----------------+
If ``true``, the stream will automatically loop when it reaches the end.
----
.. _class_AudioStreamOGGVorbis_property_loop_offset:
- :ref:`float<class_float>` **loop_offset**
+-----------+------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------+
| *Setter* | set_loop_offset(value) |
+-----------+------------------------+
| *Getter* | get_loop_offset() |
+-----------+------------------------+
Time in seconds at which the stream starts after being looped.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,31 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlayback.xml.
.. _class_AudioStreamPlayback:
AudioStreamPlayback
===================
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioStreamPlaybackResampled<class_AudioStreamPlaybackResampled>`
Meta class for playing back audio.
Description
-----------
Can play, loop, pause a scroll through audio. See :ref:`AudioStream<class_AudioStream>` and :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>` for usage.
Tutorials
---------
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,21 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlaybackResampled.xml.
.. _class_AudioStreamPlaybackResampled:
AudioStreamPlaybackResampled
============================
**Inherits:** :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioStreamGeneratorPlayback<class_AudioStreamGeneratorPlayback>`
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,273 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlayer.xml.
.. _class_AudioStreamPlayer:
AudioStreamPlayer
=================
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Plays back audio non-positionally.
Description
-----------
Plays an audio stream non-positionally.
To play audio positionally, use :ref:`AudioStreamPlayer2D<class_AudioStreamPlayer2D>` or :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>` instead of ``AudioStreamPlayer``.
Tutorials
---------
- :doc:`Audio streams <../tutorials/audio/audio_streams>`
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
- `Audio Device Changer Demo <https://godotengine.org/asset-library/asset/525>`__
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
Properties
----------
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer_property_autoplay>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer_property_bus>` | ``"Master"`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` | :ref:`mix_target<class_AudioStreamPlayer_property_mix_target>` | ``0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer_property_pitch_scale>` | ``1.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer_property_playing>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer_property_stream>` | |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer_property_stream_paused>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer_property_volume_db>` | ``0.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
Methods
-------
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer_method_stop>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AudioStreamPlayer_signal_finished:
- **finished** **(** **)**
Emitted when the audio stops playing.
Enumerations
------------
.. _enum_AudioStreamPlayer_MixTarget:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_STEREO:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_SURROUND:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_CENTER:
enum **MixTarget**:
- **MIX_TARGET_STEREO** = **0** --- The audio will be played only on the first channel.
- **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels.
- **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center.
Property Descriptions
---------------------
.. _class_AudioStreamPlayer_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
If ``true``, audio plays when added to scene tree.
----
.. _class_AudioStreamPlayer_property_bus:
- :ref:`String<class_String>` **bus**
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
Bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
----
.. _class_AudioStreamPlayer_property_mix_target:
- :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **mix_target**
+-----------+-----------------------+
| *Default* | ``0`` |
+-----------+-----------------------+
| *Setter* | set_mix_target(value) |
+-----------+-----------------------+
| *Getter* | get_mix_target() |
+-----------+-----------------------+
If the audio configuration has more than two speakers, this sets the target channels. See :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` constants.
----
.. _class_AudioStreamPlayer_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
----
.. _class_AudioStreamPlayer_property_playing:
- :ref:`bool<class_bool>` **playing**
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
If ``true``, audio is playing.
----
.. _class_AudioStreamPlayer_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
The :ref:`AudioStream<class_AudioStream>` object to be played.
----
.. _class_AudioStreamPlayer_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``.
----
.. _class_AudioStreamPlayer_property_volume_db:
- :ref:`float<class_float>` **volume_db**
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
Volume of sound, in dB.
Method Descriptions
-------------------
.. _class_AudioStreamPlayer_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>` in seconds.
----
.. _class_AudioStreamPlayer_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer``.
----
.. _class_AudioStreamPlayer_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given ``from_position``, in seconds.
----
.. _class_AudioStreamPlayer_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
----
.. _class_AudioStreamPlayer_method_stop:
- void **stop** **(** **)**
Stops the audio.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,302 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlayer2D.xml.
.. _class_AudioStreamPlayer2D:
AudioStreamPlayer2D
===================
**Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Plays positional sound in 2D space.
Description
-----------
Plays audio that dampens with distance from a given position.
By default, audio is heard from the screen center. This can be changed by adding a :ref:`Listener2D<class_Listener2D>` node to the scene and enabling it by calling :ref:`Listener2D.make_current<class_Listener2D_method_make_current>` on it.
See also :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` to play a sound non-positionally.
\ **Note:** Hiding an ``AudioStreamPlayer2D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer2D``'s audio output, set :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
Tutorials
---------
- :doc:`../tutorials/audio/audio_streams`
Properties
----------
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer2D_property_area_mask>` | ``1`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation<class_AudioStreamPlayer2D_property_attenuation>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer2D_property_autoplay>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer2D_property_bus>` | ``"Master"`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer2D_property_max_distance>` | ``2000.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer2D_property_panning_strength>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer2D_property_pitch_scale>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer2D_property_playing>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer2D_property_stream>` | |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer2D_property_stream_paused>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` | ``0.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
Methods
-------
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer2D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer2D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer2D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AudioStreamPlayer2D_signal_finished:
- **finished** **(** **)**
Emitted when the audio stops playing.
Property Descriptions
---------------------
.. _class_AudioStreamPlayer2D_property_area_mask:
- :ref:`int<class_int>` **area_mask**
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_area_mask(value) |
+-----------+----------------------+
| *Getter* | get_area_mask() |
+-----------+----------------------+
Determines which :ref:`Area2D<class_Area2D>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
----
.. _class_AudioStreamPlayer2D_property_attenuation:
- :ref:`float<class_float>` **attenuation**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_attenuation(value) |
+-----------+------------------------+
| *Getter* | get_attenuation() |
+-----------+------------------------+
Dampens audio over distance with this as an exponent.
----
.. _class_AudioStreamPlayer2D_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
If ``true``, audio plays when added to scene tree.
----
.. _class_AudioStreamPlayer2D_property_bus:
- :ref:`String<class_String>` **bus**
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
Bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
----
.. _class_AudioStreamPlayer2D_property_max_distance:
- :ref:`float<class_float>` **max_distance**
+-----------+-------------------------+
| *Default* | ``2000.0`` |
+-----------+-------------------------+
| *Setter* | set_max_distance(value) |
+-----------+-------------------------+
| *Getter* | get_max_distance() |
+-----------+-------------------------+
Maximum distance from which audio is still hearable.
----
.. _class_AudioStreamPlayer2D_property_panning_strength:
- :ref:`float<class_float>` **panning_strength**
+-----------+-----------------------------+
| *Default* | ``1.0`` |
+-----------+-----------------------------+
| *Setter* | set_panning_strength(value) |
+-----------+-----------------------------+
| *Getter* | get_panning_strength() |
+-----------+-----------------------------+
Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/2d_panning_strength<class_ProjectSettings_property_audio/2d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
----
.. _class_AudioStreamPlayer2D_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
----
.. _class_AudioStreamPlayer2D_property_playing:
- :ref:`bool<class_bool>` **playing**
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
If ``true``, audio is playing.
----
.. _class_AudioStreamPlayer2D_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
The :ref:`AudioStream<class_AudioStream>` object to be played.
----
.. _class_AudioStreamPlayer2D_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``.
----
.. _class_AudioStreamPlayer2D_property_volume_db:
- :ref:`float<class_float>` **volume_db**
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
Base volume without dampening.
Method Descriptions
-------------------
.. _class_AudioStreamPlayer2D_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>`.
----
.. _class_AudioStreamPlayer2D_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer2D``.
----
.. _class_AudioStreamPlayer2D_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given position ``from_position``, in seconds.
----
.. _class_AudioStreamPlayer2D_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
----
.. _class_AudioStreamPlayer2D_method_stop:
- void **stop** **(** **)**
Stops the audio.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,521 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlayer3D.xml.
.. _class_AudioStreamPlayer3D:
AudioStreamPlayer3D
===================
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Plays positional sound in 3D space.
Description
-----------
Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` to ``20500``.
By default, audio is heard from the camera position. This can be changed by adding a :ref:`Listener<class_Listener>` node to the scene and enabling it by calling :ref:`Listener.make_current<class_Listener_method_make_current>` on it.
See also :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` to play a sound non-positionally.
\ **Note:** Hiding an ``AudioStreamPlayer3D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer3D``'s audio output, set :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
Tutorials
---------
- :doc:`../tutorials/audio/audio_streams`
Properties
----------
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer3D_property_area_mask>` | ``1`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` | ``5000.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_db<class_AudioStreamPlayer3D_property_attenuation_filter_db>` | ``-24.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` | :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer3D_property_autoplay>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer3D_property_bus>` | ``"Master"`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` | ``45.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_filter_attenuation_db<class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db>` | ``-12.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_db<class_AudioStreamPlayer3D_property_max_db>` | ``3.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` | :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer3D_property_panning_strength>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` | |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
Methods
-------
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AudioStreamPlayer3D_signal_finished:
- **finished** **(** **)**
Emitted when the audio stops playing.
Enumerations
------------
.. _enum_AudioStreamPlayer3D_AttenuationModel:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
enum **AttenuationModel**:
- **ATTENUATION_INVERSE_DISTANCE** = **0** --- Linear dampening of loudness according to distance.
- **ATTENUATION_INVERSE_SQUARE_DISTANCE** = **1** --- Squared dampening of loudness according to distance.
- **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance.
- **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. :ref:`ATTENUATION_DISABLED<class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED>` can be combined with a :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` value greater than ``0.0`` to achieve linear attenuation clamped to a sphere of a defined size.
----
.. _enum_AudioStreamPlayer3D_OutOfRangeMode:
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
enum **OutOfRangeMode**:
- **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
- **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
----
.. _enum_AudioStreamPlayer3D_DopplerTracking:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
enum **DopplerTracking**:
- **DOPPLER_TRACKING_DISABLED** = **0** --- Disables doppler tracking.
- **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Executes doppler tracking in idle step (every rendered frame).
- **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step (every simulated physics frame).
Property Descriptions
---------------------
.. _class_AudioStreamPlayer3D_property_area_mask:
- :ref:`int<class_int>` **area_mask**
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_area_mask(value) |
+-----------+----------------------+
| *Getter* | get_area_mask() |
+-----------+----------------------+
Determines which :ref:`Area<class_Area>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
----
.. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
- :ref:`float<class_float>` **attenuation_filter_cutoff_hz**
+-----------+-----------------------------------------+
| *Default* | ``5000.0`` |
+-----------+-----------------------------------------+
| *Setter* | set_attenuation_filter_cutoff_hz(value) |
+-----------+-----------------------------------------+
| *Getter* | get_attenuation_filter_cutoff_hz() |
+-----------+-----------------------------------------+
Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to ``20500`` as this frequency is above the human hearing limit.
----
.. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
- :ref:`float<class_float>` **attenuation_filter_db**
+-----------+----------------------------------+
| *Default* | ``-24.0`` |
+-----------+----------------------------------+
| *Setter* | set_attenuation_filter_db(value) |
+-----------+----------------------------------+
| *Getter* | get_attenuation_filter_db() |
+-----------+----------------------------------+
Amount how much the filter affects the loudness, in decibels.
----
.. _class_AudioStreamPlayer3D_property_attenuation_model:
- :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model**
+-----------+------------------------------+
| *Default* | ``0`` |
+-----------+------------------------------+
| *Setter* | set_attenuation_model(value) |
+-----------+------------------------------+
| *Getter* | get_attenuation_model() |
+-----------+------------------------------+
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
----
.. _class_AudioStreamPlayer3D_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
----
.. _class_AudioStreamPlayer3D_property_bus:
- :ref:`String<class_String>` **bus**
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
The bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
----
.. _class_AudioStreamPlayer3D_property_doppler_tracking:
- :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking**
+-----------+-----------------------------+
| *Default* | ``0`` |
+-----------+-----------------------------+
| *Setter* | set_doppler_tracking(value) |
+-----------+-----------------------------+
| *Getter* | get_doppler_tracking() |
+-----------+-----------------------------+
Decides in which step the `Doppler effect <https://en.wikipedia.org/wiki/Doppler_effect>`__ should be calculated.
\ **Note:** Only effective if the current :ref:`Camera<class_Camera>`'s :ref:`Camera.doppler_tracking<class_Camera_property_doppler_tracking>` property is set to a value other than :ref:`Camera.DOPPLER_TRACKING_DISABLED<class_Camera_constant_DOPPLER_TRACKING_DISABLED>`.
----
.. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
- :ref:`float<class_float>` **emission_angle_degrees**
+-----------+---------------------------+
| *Default* | ``45.0`` |
+-----------+---------------------------+
| *Setter* | set_emission_angle(value) |
+-----------+---------------------------+
| *Getter* | get_emission_angle() |
+-----------+---------------------------+
The angle in which the audio reaches cameras undampened.
----
.. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
- :ref:`bool<class_bool>` **emission_angle_enabled**
+-----------+-----------------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------------+
| *Setter* | set_emission_angle_enabled(value) |
+-----------+-----------------------------------+
| *Getter* | is_emission_angle_enabled() |
+-----------+-----------------------------------+
If ``true``, the audio should be dampened according to the direction of the sound.
----
.. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
- :ref:`float<class_float>` **emission_angle_filter_attenuation_db**
+-----------+-------------------------------------------------+
| *Default* | ``-12.0`` |
+-----------+-------------------------------------------------+
| *Setter* | set_emission_angle_filter_attenuation_db(value) |
+-----------+-------------------------------------------------+
| *Getter* | get_emission_angle_filter_attenuation_db() |
+-----------+-------------------------------------------------+
Dampens audio if camera is outside of :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` and :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` is set by this factor, in decibels.
----
.. _class_AudioStreamPlayer3D_property_max_db:
- :ref:`float<class_float>` **max_db**
+-----------+-------------------+
| *Default* | ``3.0`` |
+-----------+-------------------+
| *Setter* | set_max_db(value) |
+-----------+-------------------+
| *Getter* | get_max_db() |
+-----------+-------------------+
Sets the absolute maximum of the soundlevel, in decibels.
----
.. _class_AudioStreamPlayer3D_property_max_distance:
- :ref:`float<class_float>` **max_distance**
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_max_distance(value) |
+-----------+-------------------------+
| *Getter* | get_max_distance() |
+-----------+-------------------------+
Sets the distance from which the :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` takes effect. Has no effect if set to 0.
----
.. _class_AudioStreamPlayer3D_property_out_of_range_mode:
- :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode**
+-----------+------------------------------+
| *Default* | ``0`` |
+-----------+------------------------------+
| *Setter* | set_out_of_range_mode(value) |
+-----------+------------------------------+
| *Getter* | get_out_of_range_mode() |
+-----------+------------------------------+
Decides if audio should pause when source is outside of :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` range.
----
.. _class_AudioStreamPlayer3D_property_panning_strength:
- :ref:`float<class_float>` **panning_strength**
+-----------+-----------------------------+
| *Default* | ``1.0`` |
+-----------+-----------------------------+
| *Setter* | set_panning_strength(value) |
+-----------+-----------------------------+
| *Getter* | get_panning_strength() |
+-----------+-----------------------------+
Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/3d_panning_strength<class_ProjectSettings_property_audio/3d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
----
.. _class_AudioStreamPlayer3D_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
----
.. _class_AudioStreamPlayer3D_property_playing:
- :ref:`bool<class_bool>` **playing**
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
If ``true``, audio is playing.
----
.. _class_AudioStreamPlayer3D_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
The :ref:`AudioStream<class_AudioStream>` resource to be played.
----
.. _class_AudioStreamPlayer3D_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
----
.. _class_AudioStreamPlayer3D_property_unit_db:
- :ref:`float<class_float>` **unit_db**
+-----------+--------------------+
| *Default* | ``0.0`` |
+-----------+--------------------+
| *Setter* | set_unit_db(value) |
+-----------+--------------------+
| *Getter* | get_unit_db() |
+-----------+--------------------+
The base sound level unaffected by dampening, in decibels.
----
.. _class_AudioStreamPlayer3D_property_unit_size:
- :ref:`float<class_float>` **unit_size**
+-----------+----------------------+
| *Default* | ``1.0`` |
+-----------+----------------------+
| *Setter* | set_unit_size(value) |
+-----------+----------------------+
| *Getter* | get_unit_size() |
+-----------+----------------------+
The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
Method Descriptions
-------------------
.. _class_AudioStreamPlayer3D_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>`.
----
.. _class_AudioStreamPlayer3D_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer3D``.
----
.. _class_AudioStreamPlayer3D_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given position ``from_position``, in seconds.
----
.. _class_AudioStreamPlayer3D_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
----
.. _class_AudioStreamPlayer3D_method_stop:
- void **stop** **(** **)**
Stops the audio.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

View File

@ -0,0 +1,64 @@
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamRandomPitch.xml.
.. _class_AudioStreamRandomPitch:
AudioStreamRandomPitch
======================
**Inherits:** :ref:`AudioStream<class_AudioStream>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Plays audio with random pitch shifting.
Description
-----------
Randomly varies pitch on each start.
Properties
----------
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`audio_stream<class_AudioStreamRandomPitch_property_audio_stream>` | |
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`random_pitch<class_AudioStreamRandomPitch_property_random_pitch>` | ``1.1`` |
+---------------------------------------+-------------------------------------------------------------------------+---------+
Property Descriptions
---------------------
.. _class_AudioStreamRandomPitch_property_audio_stream:
- :ref:`AudioStream<class_AudioStream>` **audio_stream**
+----------+-------------------------+
| *Setter* | set_audio_stream(value) |
+----------+-------------------------+
| *Getter* | get_audio_stream() |
+----------+-------------------------+
The current :ref:`AudioStream<class_AudioStream>`.
----
.. _class_AudioStreamRandomPitch_property_random_pitch:
- :ref:`float<class_float>` **random_pitch**
+-----------+-------------------------+
| *Default* | ``1.1`` |
+-----------+-------------------------+
| *Setter* | set_random_pitch(value) |
+-----------+-------------------------+
| *Getter* | get_random_pitch() |
+-----------+-------------------------+
The intensity of random pitch variation.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

Some files were not shown because too many files have changed in this diff Show More