mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-02-06 16:16:00 +01:00
Added the current 3.4 godot docs as a base.
This commit is contained in:
commit
52de1273fe
19
.editorconfig
Normal file
19
.editorconfig
Normal file
@ -0,0 +1,19 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# YAML requires indentation with spaces instead of tabs.
|
||||
[*.{js,yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Makefile requires tab indentation.
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Properly detect languages on GitHub
|
||||
*.rst linguist-detectable=true
|
||||
|
||||
# Normalize EOL for all files that Git considers text files
|
||||
* text=auto eol=lf
|
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report incorrect or outdated documentation
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Your Godot version:**
|
||||
|
||||
**Issue description:**
|
||||
|
||||
**URL to the documentation page:**
|
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
blank_issues_enabled: false
|
||||
|
||||
contact_links:
|
||||
- name: Godot community channels
|
||||
url: https://godotengine.org/community
|
||||
about: Please ask for technical support on one of the other community channels, not here.
|
13
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Enhancement request
|
||||
about: Suggest new documentation or improving existing documentation
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Your Godot version:**
|
||||
|
||||
**Issue description:**
|
||||
|
||||
**URL to the documentation page (if already existing):**
|
7
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
7
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<!--
|
||||
**Note:** Pull Requests should be made against the `master` by default.
|
||||
|
||||
Only make Pull Requests against other branches (e.g. `2.1`) if your changes only apply to that specific version of Godot.
|
||||
|
||||
All pull requests for Godot 3 should usually go into `master`.
|
||||
-->
|
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Continuous integration
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Install tools used by `_tools/format.sh`.
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qq install dos2unix recode
|
||||
sudo pip3 install -r requirements.txt
|
||||
sudo pip3 install codespell
|
||||
|
||||
- name: Linter checks
|
||||
run: |
|
||||
bash _tools/format.sh
|
||||
codespell -I _tools/codespell-ignore.txt -x _tools/codespell-ignore-lines.txt {about,community,development,getting_started,tutorials}/**/*.rst
|
||||
|
||||
# Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
|
||||
- name: Sphinx build
|
||||
run: |
|
||||
sphinx-build --color -b dummy -d _build/doctrees -W . _build/html
|
42
.gitignore
vendored
Normal file
42
.gitignore
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
_build/
|
||||
env/
|
||||
__pycache__
|
||||
*.pyc
|
||||
*~
|
||||
.directory
|
||||
.vs/
|
||||
.vscode/
|
||||
*.mo
|
||||
|
||||
# Vim temp files
|
||||
*.swo
|
||||
*.swp
|
||||
|
||||
# Geany/geany-plugins files
|
||||
*.geany
|
||||
.geanyprj
|
||||
|
||||
# Finder (macOS) makes these automatically.
|
||||
.DS_Store
|
||||
__MACOSX
|
||||
|
||||
# Windows image file caches
|
||||
[Tt]humbs.db
|
||||
[Tt]humbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# Windows folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Windows Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
logo.h
|
||||
*.autosave
|
||||
|
||||
# Output of list-unused-images.sh tool
|
||||
tmp-unused-images
|
||||
tmp-unused-images-history
|
30
.mailmap
Normal file
30
.mailmap
Normal file
@ -0,0 +1,30 @@
|
||||
Andreas Haas <liu.gam3@gmail.com>
|
||||
Andrew Conrad <aconrad103@gmail.com>
|
||||
Andrii Doroshenko <xrayez@gmail.com>
|
||||
puchik <puchik@users.noreply.github.com> <48544263+puchik@users.noreply.github.com>
|
||||
Chris Bradfield <chris@kidscancode.org> <cb@scribe.net>
|
||||
clayjohn <claynjohn@gmail.com>
|
||||
clayjohn <claynjohn@gmail.com> <clayjohn@shaw.ca>
|
||||
corrigentia <coryan25@gmail.com> <20541985+corrigentia@users.noreply.github.com>
|
||||
Frido <f.schermutzki@gmail.com>
|
||||
Frido <f.schermutzki@gmail.com> <43795127+mega-bit@users.noreply.github.com>
|
||||
Hugo Locurcio <hugo.locurcio@hugo.pro> <calinou@opmbx.org>
|
||||
Hugo Locurcio <hugo.locurcio@hugo.pro> <hugo.l@openmailbox.org>
|
||||
Ignacio Etcheverry <ignalfonsore@gmail.com> <neikeq@users.noreply.github.com>
|
||||
Julian Murgia <the.straton@gmail.com>
|
||||
Kelly Thomas <kelly.thomas@hotmail.com.au>
|
||||
Leon Krause <lk@leonkrause.com>
|
||||
Leon Krause <lk@leonkrause.com> <eska@eska.me>
|
||||
Max Hilbrunner <m.hilbrunner@gmail.com>
|
||||
Max Hilbrunner <m.hilbrunner@gmail.com> <mhilbrunner@users.noreply.github.com>
|
||||
Michael Alexsander <michaelalexsander@protonmail.com>
|
||||
Nathan Lovato <nathan@gdquest.com>
|
||||
Paul Joannon <hello@pauljoannon.com> <437025+paulloz@users.noreply.github.com>
|
||||
Rémi Verschelde <rverschelde@gmail.com> <remi@verschelde.fr>
|
||||
skyace65 <trekie96@hotmail.com>
|
||||
skyace65 <trekie96@hotmail.com> <trekie96@Hotmail.com>
|
||||
TwistedTwigleg <beard.noah@gmail.com> <Beard.noah@gmail.com>
|
||||
Will Nations <willnationsdev@gmail.com>
|
||||
Yuri Roubinsky <chaosus89@gmail.com>
|
||||
Yuri Sizov <pycbouh@users.noreply.github.com> <yuris@humnom.net>
|
||||
ZX-WT <ZX-WT@ymail.com> <ZX_WT@ymail.com>
|
27
.readthedocs.yml
Normal file
27
.readthedocs.yml
Normal file
@ -0,0 +1,27 @@
|
||||
# .readthedocs.yml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
version: 2
|
||||
|
||||
build:
|
||||
image: latest
|
||||
|
||||
sphinx:
|
||||
configuration: conf.py
|
||||
|
||||
# Possible options: htmlzip, pdf, epub
|
||||
# All disabled for now:
|
||||
# - single-page htmlzip is too big to be usable, and requires too much memory.
|
||||
# - pdf generates too many latex warnings and the build is killed once logs
|
||||
# reach 4 MB. Could likely be improved if someone is motivated.
|
||||
# - epub is too big, and has tons of validation errors which make most readers
|
||||
# treat it as invalid (GH-3862). Also, it's ugly.
|
||||
# Hopefully one day we'll have a multi-page HTML zip option, but until
|
||||
# then, all offline download options are worthless.
|
||||
# (Track https://github.com/readthedocs/readthedocs.org/issues/3242)
|
||||
formats: []
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: requirements.txt
|
53
AUTHORS.md
Normal file
53
AUTHORS.md
Normal file
@ -0,0 +1,53 @@
|
||||
# Godot Engine documentation authors
|
||||
|
||||
Godot Engine is developed by a community of voluntary contributors who
|
||||
contribute on all areas, including writing and maintaining the documentation.
|
||||
|
||||
It is impossible to list them all; nevertheless, this file aims at listing
|
||||
the writers who contributed significant patches to this CC-BY licensed
|
||||
documentation on the `godot-docs` repository.
|
||||
|
||||
GitHub usernames are indicated in parentheses, or as sole entry when no other
|
||||
name is available.
|
||||
|
||||
## Main contributors
|
||||
|
||||
(in alphabetical order, with over 10 commits excluding merges)
|
||||
|
||||
Aaron Franke (aaronfranke)
|
||||
Andrew Conrad (her001)
|
||||
Andrii Doroshenko (Xrayez)
|
||||
Arman (puchik)
|
||||
Bastiaan Olij (BastiaanOlij)
|
||||
bitbutter
|
||||
Camille Mohr-Daurat (pouleyKetchoupp)
|
||||
Chris Bradfield (cbscribe)
|
||||
Clay John (clayjohn)
|
||||
corrigentia
|
||||
Fabio Alessandrelli (Faless)
|
||||
FeralBytes
|
||||
Frido (mega-bit)
|
||||
George Marques (vnen)
|
||||
Gerrit Großkopf (Grosskopf)
|
||||
Griatch
|
||||
Haoyu Qiu (timothyqiu)
|
||||
Hugo Locurcio (Calinou)
|
||||
Ignacio Roldán Etcheverry (neikeq)
|
||||
Jérôme Gully (Nutriz)
|
||||
Juan Linietsky (reduz)
|
||||
Julian Murgia (StraToN)
|
||||
Kelly Thomas (KellyThomas)
|
||||
Leon Krause (leonkrause)
|
||||
Matthew (skyace65)
|
||||
Max Hilbrunner (mhilbrunner)
|
||||
Michael Alexsander (YeldhamDev)
|
||||
Nathan Lovato (NathanLovato)
|
||||
Paul Joannon (paulloz)
|
||||
Poommetee Ketson (Naryosha)
|
||||
Rémi Verschelde (akien-mga)
|
||||
Tomasz Chabora (KoBeWi)
|
||||
TwistedTwigleg
|
||||
Will Nations (willnationsdev)
|
||||
Yuri Roubinsky (Chaosus)
|
||||
Yuri Sizov (pycbouh)
|
||||
ZX-WT
|
319
LICENSE.txt
Normal file
319
LICENSE.txt
Normal file
@ -0,0 +1,319 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
Attribution 3.0 Unported
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
|
||||
DAMAGES RESULTING FROM ITS USE.
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
|
||||
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
|
||||
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
|
||||
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
|
||||
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
|
||||
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
|
||||
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
|
||||
CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
a. "Adaptation" means a work based upon the Work, or upon the Work and
|
||||
other pre-existing works, such as a translation, adaptation,
|
||||
derivative work, arrangement of music or other alterations of a
|
||||
literary or artistic work, or phonogram or performance and includes
|
||||
cinematographic adaptations or any other form in which the Work may be
|
||||
recast, transformed, or adapted including in any form recognizably
|
||||
derived from the original, except that a work that constitutes a
|
||||
Collection will not be considered an Adaptation for the purpose of
|
||||
this License. For the avoidance of doubt, where the Work is a musical
|
||||
work, performance or phonogram, the synchronization of the Work in
|
||||
timed-relation with a moving image ("synching") will be considered an
|
||||
Adaptation for the purpose of this License.
|
||||
b. "Collection" means a collection of literary or artistic works, such as
|
||||
encyclopedias and anthologies, or performances, phonograms or
|
||||
broadcasts, or other works or subject matter other than works listed
|
||||
in Section 1(f) below, which, by reason of the selection and
|
||||
arrangement of their contents, constitute intellectual creations, in
|
||||
which the Work is included in its entirety in unmodified form along
|
||||
with one or more other contributions, each constituting separate and
|
||||
independent works in themselves, which together are assembled into a
|
||||
collective whole. A work that constitutes a Collection will not be
|
||||
considered an Adaptation (as defined above) for the purposes of this
|
||||
License.
|
||||
c. "Distribute" means to make available to the public the original and
|
||||
copies of the Work or Adaptation, as appropriate, through sale or
|
||||
other transfer of ownership.
|
||||
d. "Licensor" means the individual, individuals, entity or entities that
|
||||
offer(s) the Work under the terms of this License.
|
||||
e. "Original Author" means, in the case of a literary or artistic work,
|
||||
the individual, individuals, entity or entities who created the Work
|
||||
or if no individual or entity can be identified, the publisher; and in
|
||||
addition (i) in the case of a performance the actors, singers,
|
||||
musicians, dancers, and other persons who act, sing, deliver, declaim,
|
||||
play in, interpret or otherwise perform literary or artistic works or
|
||||
expressions of folklore; (ii) in the case of a phonogram the producer
|
||||
being the person or legal entity who first fixes the sounds of a
|
||||
performance or other sounds; and, (iii) in the case of broadcasts, the
|
||||
organization that transmits the broadcast.
|
||||
f. "Work" means the literary and/or artistic work offered under the terms
|
||||
of this License including without limitation any production in the
|
||||
literary, scientific and artistic domain, whatever may be the mode or
|
||||
form of its expression including digital form, such as a book,
|
||||
pamphlet and other writing; a lecture, address, sermon or other work
|
||||
of the same nature; a dramatic or dramatico-musical work; a
|
||||
choreographic work or entertainment in dumb show; a musical
|
||||
composition with or without words; a cinematographic work to which are
|
||||
assimilated works expressed by a process analogous to cinematography;
|
||||
a work of drawing, painting, architecture, sculpture, engraving or
|
||||
lithography; a photographic work to which are assimilated works
|
||||
expressed by a process analogous to photography; a work of applied
|
||||
art; an illustration, map, plan, sketch or three-dimensional work
|
||||
relative to geography, topography, architecture or science; a
|
||||
performance; a broadcast; a phonogram; a compilation of data to the
|
||||
extent it is protected as a copyrightable work; or a work performed by
|
||||
a variety or circus performer to the extent it is not otherwise
|
||||
considered a literary or artistic work.
|
||||
g. "You" means an individual or entity exercising rights under this
|
||||
License who has not previously violated the terms of this License with
|
||||
respect to the Work, or who has received express permission from the
|
||||
Licensor to exercise rights under this License despite a previous
|
||||
violation.
|
||||
h. "Publicly Perform" means to perform public recitations of the Work and
|
||||
to communicate to the public those public recitations, by any means or
|
||||
process, including by wire or wireless means or public digital
|
||||
performances; to make available to the public Works in such a way that
|
||||
members of the public may access these Works from a place and at a
|
||||
place individually chosen by them; to perform the Work to the public
|
||||
by any means or process and the communication to the public of the
|
||||
performances of the Work, including by public digital performance; to
|
||||
broadcast and rebroadcast the Work by any means including signs,
|
||||
sounds or images.
|
||||
i. "Reproduce" means to make copies of the Work by any means including
|
||||
without limitation by sound or visual recordings and the right of
|
||||
fixation and reproducing fixations of the Work, including storage of a
|
||||
protected performance or phonogram in digital form or other electronic
|
||||
medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
|
||||
limit, or restrict any uses free from copyright or rights arising from
|
||||
limitations or exceptions that are provided for in connection with the
|
||||
copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License,
|
||||
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
||||
perpetual (for the duration of the applicable copyright) license to
|
||||
exercise the rights in the Work as stated below:
|
||||
|
||||
a. to Reproduce the Work, to incorporate the Work into one or more
|
||||
Collections, and to Reproduce the Work as incorporated in the
|
||||
Collections;
|
||||
b. to create and Reproduce Adaptations provided that any such Adaptation,
|
||||
including any translation in any medium, takes reasonable steps to
|
||||
clearly label, demarcate or otherwise identify that changes were made
|
||||
to the original Work. For example, a translation could be marked "The
|
||||
original work was translated from English to Spanish," or a
|
||||
modification could indicate "The original work has been modified.";
|
||||
c. to Distribute and Publicly Perform the Work including as incorporated
|
||||
in Collections; and,
|
||||
d. to Distribute and Publicly Perform Adaptations.
|
||||
e. For the avoidance of doubt:
|
||||
|
||||
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme cannot be waived, the Licensor
|
||||
reserves the exclusive right to collect such royalties for any
|
||||
exercise by You of the rights granted under this License;
|
||||
ii. Waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme can be waived, the Licensor waives the
|
||||
exclusive right to collect such royalties for any exercise by You
|
||||
of the rights granted under this License; and,
|
||||
iii. Voluntary License Schemes. The Licensor waives the right to
|
||||
collect royalties, whether individually or, in the event that the
|
||||
Licensor is a member of a collecting society that administers
|
||||
voluntary licensing schemes, via that society, from any exercise
|
||||
by You of the rights granted under this License.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now
|
||||
known or hereafter devised. The above rights include the right to make
|
||||
such modifications as are technically necessary to exercise the rights in
|
||||
other media and formats. Subject to Section 8(f), all rights not expressly
|
||||
granted by Licensor are hereby reserved.
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made
|
||||
subject to and limited by the following restrictions:
|
||||
|
||||
a. You may Distribute or Publicly Perform the Work only under the terms
|
||||
of this License. You must include a copy of, or the Uniform Resource
|
||||
Identifier (URI) for, this License with every copy of the Work You
|
||||
Distribute or Publicly Perform. You may not offer or impose any terms
|
||||
on the Work that restrict the terms of this License or the ability of
|
||||
the recipient of the Work to exercise the rights granted to that
|
||||
recipient under the terms of the License. You may not sublicense the
|
||||
Work. You must keep intact all notices that refer to this License and
|
||||
to the disclaimer of warranties with every copy of the Work You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Work, You may not impose any effective technological
|
||||
measures on the Work that restrict the ability of a recipient of the
|
||||
Work from You to exercise the rights granted to that recipient under
|
||||
the terms of the License. This Section 4(a) applies to the Work as
|
||||
incorporated in a Collection, but this does not require the Collection
|
||||
apart from the Work itself to be made subject to the terms of this
|
||||
License. If You create a Collection, upon notice from any Licensor You
|
||||
must, to the extent practicable, remove from the Collection any credit
|
||||
as required by Section 4(b), as requested. If You create an
|
||||
Adaptation, upon notice from any Licensor You must, to the extent
|
||||
practicable, remove from the Adaptation any credit as required by
|
||||
Section 4(b), as requested.
|
||||
b. If You Distribute, or Publicly Perform the Work or any Adaptations or
|
||||
Collections, You must, unless a request has been made pursuant to
|
||||
Section 4(a), keep intact all copyright notices for the Work and
|
||||
provide, reasonable to the medium or means You are utilizing: (i) the
|
||||
name of the Original Author (or pseudonym, if applicable) if supplied,
|
||||
and/or if the Original Author and/or Licensor designate another party
|
||||
or parties (e.g., a sponsor institute, publishing entity, journal) for
|
||||
attribution ("Attribution Parties") in Licensor's copyright notice,
|
||||
terms of service or by other reasonable means, the name of such party
|
||||
or parties; (ii) the title of the Work if supplied; (iii) to the
|
||||
extent reasonably practicable, the URI, if any, that Licensor
|
||||
specifies to be associated with the Work, unless such URI does not
|
||||
refer to the copyright notice or licensing information for the Work;
|
||||
and (iv) , consistent with Section 3(b), in the case of an Adaptation,
|
||||
a credit identifying the use of the Work in the Adaptation (e.g.,
|
||||
"French translation of the Work by Original Author," or "Screenplay
|
||||
based on original Work by Original Author"). The credit required by
|
||||
this Section 4 (b) may be implemented in any reasonable manner;
|
||||
provided, however, that in the case of a Adaptation or Collection, at
|
||||
a minimum such credit will appear, if a credit for all contributing
|
||||
authors of the Adaptation or Collection appears, then as part of these
|
||||
credits and in a manner at least as prominent as the credits for the
|
||||
other contributing authors. For the avoidance of doubt, You may only
|
||||
use the credit required by this Section for the purpose of attribution
|
||||
in the manner set out above and, by exercising Your rights under this
|
||||
License, You may not implicitly or explicitly assert or imply any
|
||||
connection with, sponsorship or endorsement by the Original Author,
|
||||
Licensor and/or Attribution Parties, as appropriate, of You or Your
|
||||
use of the Work, without the separate, express prior written
|
||||
permission of the Original Author, Licensor and/or Attribution
|
||||
Parties.
|
||||
c. Except as otherwise agreed in writing by the Licensor or as may be
|
||||
otherwise permitted by applicable law, if You Reproduce, Distribute or
|
||||
Publicly Perform the Work either by itself or as part of any
|
||||
Adaptations or Collections, You must not distort, mutilate, modify or
|
||||
take other derogatory action in relation to the Work which would be
|
||||
prejudicial to the Original Author's honor or reputation. Licensor
|
||||
agrees that in those jurisdictions (e.g. Japan), in which any exercise
|
||||
of the right granted in Section 3(b) of this License (the right to
|
||||
make Adaptations) would be deemed to be a distortion, mutilation,
|
||||
modification or other derogatory action prejudicial to the Original
|
||||
Author's honor and reputation, the Licensor will waive or not assert,
|
||||
as appropriate, this Section, to the fullest extent permitted by the
|
||||
applicable national law, to enable You to reasonably exercise Your
|
||||
right under Section 3(b) of this License (right to make Adaptations)
|
||||
but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
|
||||
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
|
||||
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
|
||||
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
|
||||
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
|
||||
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
|
||||
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
|
||||
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
|
||||
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
|
||||
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
a. This License and the rights granted hereunder will terminate
|
||||
automatically upon any breach by You of the terms of this License.
|
||||
Individuals or entities who have received Adaptations or Collections
|
||||
from You under this License, however, will not have their licenses
|
||||
terminated provided such individuals or entities remain in full
|
||||
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
|
||||
survive any termination of this License.
|
||||
b. Subject to the above terms and conditions, the license granted here is
|
||||
perpetual (for the duration of the applicable copyright in the Work).
|
||||
Notwithstanding the above, Licensor reserves the right to release the
|
||||
Work under different license terms or to stop distributing the Work at
|
||||
any time; provided, however that any such election will not serve to
|
||||
withdraw this License (or any other license that has been, or is
|
||||
required to be, granted under the terms of this License), and this
|
||||
License will continue in full force and effect unless terminated as
|
||||
stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
a. Each time You Distribute or Publicly Perform the Work or a Collection,
|
||||
the Licensor offers to the recipient a license to the Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
|
||||
offers to the recipient a license to the original Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
c. If any provision of this License is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this License, and without further action
|
||||
by the parties to this agreement, such provision shall be reformed to
|
||||
the minimum extent necessary to make such provision valid and
|
||||
enforceable.
|
||||
d. No term or provision of this License shall be deemed waived and no
|
||||
breach consented to unless such waiver or consent shall be in writing
|
||||
and signed by the party to be charged with such waiver or consent.
|
||||
e. This License constitutes the entire agreement between the parties with
|
||||
respect to the Work licensed here. There are no understandings,
|
||||
agreements or representations with respect to the Work not specified
|
||||
here. Licensor shall not be bound by any additional provisions that
|
||||
may appear in any communication from You. This License may not be
|
||||
modified without the mutual written agreement of the Licensor and You.
|
||||
f. The rights granted under, and the subject matter referenced, in this
|
||||
License were drafted utilizing the terminology of the Berne Convention
|
||||
for the Protection of Literary and Artistic Works (as amended on
|
||||
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
|
||||
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
|
||||
and the Universal Copyright Convention (as revised on July 24, 1971).
|
||||
These rights and subject matter take effect in the relevant
|
||||
jurisdiction in which the License terms are sought to be enforced
|
||||
according to the corresponding provisions of the implementation of
|
||||
those treaty provisions in the applicable national law. If the
|
||||
standard suite of rights granted under applicable copyright law
|
||||
includes additional rights not granted under this License, such
|
||||
additional rights are deemed to be included in the License; this
|
||||
License is not intended to restrict the license of any rights under
|
||||
applicable law.
|
||||
|
||||
|
||||
Creative Commons Notice
|
||||
|
||||
Creative Commons is not a party to this License, and makes no warranty
|
||||
whatsoever in connection with the Work. Creative Commons will not be
|
||||
liable to You or any party on any legal theory for any damages
|
||||
whatsoever, including without limitation any general, special,
|
||||
incidental or consequential damages arising in connection to this
|
||||
license. Notwithstanding the foregoing two (2) sentences, if Creative
|
||||
Commons has expressly identified itself as the Licensor hereunder, it
|
||||
shall have all rights and obligations of Licensor.
|
||||
|
||||
Except for the limited purpose of indicating to the public that the
|
||||
Work is licensed under the CCPL, Creative Commons does not authorize
|
||||
the use by either party of the trademark "Creative Commons" or any
|
||||
related trademark or logo of Creative Commons without the prior
|
||||
written consent of Creative Commons. Any permitted use will be in
|
||||
compliance with Creative Commons' then-current trademark usage
|
||||
guidelines, as may be published on its website or otherwise made
|
||||
available upon request from time to time. For the avoidance of doubt,
|
||||
this trademark restriction does not form part of this License.
|
||||
|
||||
Creative Commons may be contacted at https://creativecommons.org/.
|
199
Makefile
Normal file
199
Makefile
Normal file
@ -0,0 +1,199 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
LATEXDEPS = latex dvipng
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD make variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -t i18n .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
@echo " dummy to run only the parse steps without generating output"
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GodotEngine.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GodotEngine.qhc"
|
||||
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/GodotEngine"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GodotEngine"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) ../sphinx/templates
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in ../sphinx/templates."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
|
||||
dummy:
|
||||
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. No output."
|
139
README.md
Normal file
139
README.md
Normal file
@ -0,0 +1,139 @@
|
||||
# Godot Engine documentation
|
||||
|
||||
This repository contains the source files of [Godot Engine](https://godotengine.org)'s documentation, in reStructuredText markup language (reST).
|
||||
|
||||
They are meant to be parsed with the [Sphinx](https://www.sphinx-doc.org/) documentation builder to build the HTML documentation on [Godot's website](https://docs.godotengine.org).
|
||||
|
||||
## Download for offline use
|
||||
|
||||
You can [download an HTML copy](https://nightly.link/godotengine/godot-docs/workflows/build_offline_docs/master/godot-docs-html-stable.zip)
|
||||
for offline reading (updated every Monday). Extract the ZIP archive then open
|
||||
the top-level `index.html` in a web browser.
|
||||
|
||||
## Theming
|
||||
|
||||
The Godot documentation uses the default ``sphinx_rtd_theme`` with many
|
||||
[customizations](_static/) applied on top. It will automatically switch between
|
||||
the light and dark theme depending on your browser/OS' theming preference.
|
||||
|
||||
If you use Firefox and wish to use the dark theme regardless of your OS
|
||||
configuration, you can install the
|
||||
[Dark Website Forcer](https://addons.mozilla.org/en-US/firefox/addon/dark-mode-website-switcher/)
|
||||
add-on.
|
||||
|
||||
## Contributing changes
|
||||
|
||||
**Pull Requests should use the `master` branch by default. Only make Pull Requests against other branches (e.g. `2.1` or `3.0`) if your changes only apply to that specific version of Godot.**
|
||||
|
||||
Though arguably less convenient to edit than a wiki, this Git repository is meant to receive pull requests to always improve the documentation, add new pages, etc. Having direct access to the source files in a revision control system is a big plus to ensure the quality of our documentation.
|
||||
|
||||
### Editing existing pages
|
||||
|
||||
To edit an existing page, locate its .rst source file and open it in your favorite text editor. You can then commit the changes, push them to your fork and make a pull request.
|
||||
**Note that the pages in `classes/` should not be edited here, they are automatically generated from Godot's [XML class references](https://github.com/godotengine/godot/tree/master/doc/classes).**
|
||||
See [Contribute to the Class Reference](https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html) for details.
|
||||
|
||||
### Adding new pages
|
||||
|
||||
To add a new page, create a .rst file with a meaningful name in the section you want to add a file to, e.g. `tutorials/3d/light_baking.rst`. Write its content like you would do for any other file, and make sure to define a reference name for Sphinx at the beginning of the file (check other files for the syntax), based on the file name with a "doc_" prefix (e.g. `.. _doc_light_baking:`).
|
||||
|
||||
You should then add your page to the relevant "toctree" (table of contents, e.g. `tutorials/3d/index.rst`). By convention, the files used to define the various levels of toctree are prefixed with an underscore, so in the above example the file should be referenced in `tutorials/3d/_3d_graphics.rst`. Add your new filename to the list on a new line, using a relative path and no extension, e.g. here `light_baking`.
|
||||
|
||||
### Sphinx and reStructuredText syntax
|
||||
|
||||
Check Sphinx's [reST Primer](https://www.sphinx-doc.org/en/stable/rest.html) and the [official reference](http://docutils.sourceforge.net/rst.html) for details on the syntax.
|
||||
|
||||
Sphinx uses specific reST comments to do specific operations, like defining the table of contents (`:toctree:`) or cross-referencing pages. Check the [official Sphinx documentation](https://www.sphinx-doc.org/en/stable/index.html) for more details, or see how things are done in existing pages and adapt it to your needs.
|
||||
|
||||
### Adding images and attachments
|
||||
|
||||
To add images, please put them in an `img/` folder next to the .rst file with a meaningful name and include them in your page with:
|
||||
```rst
|
||||
.. image:: img/image_name.png
|
||||
```
|
||||
|
||||
Similarly, you can include attachments (like assets as support material for a tutorial) by placing them into a `files/` folder next to the .rst file, and using this inline markup:
|
||||
```rst
|
||||
:download:`myfilename.zip <files/myfilename.zip>`
|
||||
```
|
||||
|
||||
## Building with Sphinx
|
||||
|
||||
To build the HTML website (or any other format supported by Sphinx, like PDF, EPUB or LaTeX), you need to install [Sphinx](https://www.sphinx-doc.org/) >= 1.3 as well as (for the HTML) the [readthedocs.org theme](https://github.com/snide/sphinx_rtd_theme).
|
||||
You also need to install the Sphinx extensions defined in `requirements.txt`.
|
||||
|
||||
Those tools are best installed using [pip](https://pip.pypa.io), Python's module installer. The Python 3 version might be provided (on Linux distros) as `pip3` or `python3-pip`. You can then run:
|
||||
|
||||
```sh
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
You can then build the HTML documentation from the root folder of this repository with:
|
||||
|
||||
```sh
|
||||
make html
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```sh
|
||||
make SPHINXBUILD=~/.local/bin/sphinx-build html
|
||||
```
|
||||
|
||||
Building the documentation requires at least 8 GB of RAM to be done without swapping. If you have at least 16 GB of RAM, you can speed up compilation by using:
|
||||
|
||||
```bash
|
||||
# On Linux/macOS
|
||||
make html SPHINXOPTS=-j2
|
||||
|
||||
# On Windows
|
||||
set SPHINXOPTS=-j2 && make html
|
||||
```
|
||||
|
||||
The compilation might take some time as the `classes/` folder contains many files to parse.
|
||||
|
||||
In case of a `MemoryError` or `EOFError`, you can remove the `classes/` folder and run `make` again. This will drop the class references from the final HTML documentation but will keep the rest intact. Make sure to avoid using `git add .` in this case when working on a pull request, or the whole `classes/` folder will be removed when you make a commit. See [#3157](https://github.com/godotengine/godot-docs/issues/3157) for more details.
|
||||
|
||||
You can then test the changes live by opening `_build/html/index.html` in your favorite browser.
|
||||
|
||||
### Building with Sphinx on Windows
|
||||
|
||||
On Windows, you need to:
|
||||
* Download the Python installer [here](https://www.python.org/downloads/).
|
||||
* Install Python. Don't forget to check the "Add Python to PATH" box.
|
||||
* Use the above `pip` commands.
|
||||
|
||||
Building is still done at the root folder of this repository using the provided `make.bat`:
|
||||
```sh
|
||||
make.bat html
|
||||
```
|
||||
|
||||
Alternatively, you can build with this command instead:
|
||||
```sh
|
||||
sphinx-build -b html ./ _build
|
||||
```
|
||||
|
||||
Note that during the first build, various installation prompts may appear and ask to install LaTeX plugins.
|
||||
Make sure you don't miss them, especially if they open behind other windows, else the build may appear to hang until you confirm these prompts.
|
||||
|
||||
You could also install a normal `make` toolchain (for example via MinGW) and build the docs using the normal `make html`.
|
||||
|
||||
### Building with Sphinx and virtualenv
|
||||
|
||||
If you want your Sphinx installation scoped to the project, you can install it using virtualenv.
|
||||
Execute this from the root folder of this repository:
|
||||
|
||||
```sh
|
||||
virtualenv --system-site-packages env/
|
||||
. env/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Then do `make html` like above.
|
||||
|
||||
## License
|
||||
|
||||
At the exception of the `classes/` folder, all the content of this repository is licensed under the Creative Commons Attribution 3.0 Unported license ([CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)) and is to be attributed to "Juan Linietsky, Ariel Manzur and the Godot community".
|
||||
See [LICENSE.txt](/LICENSE.txt) for details.
|
||||
|
||||
The files in the `classes/` folder are derived from [Godot's main source repository](https://github.com/godotengine/godot) and are distributed under the MIT license, with the same authors as above.
|
371
_extensions/gdscript.py
Normal file
371
_extensions/gdscript.py
Normal file
@ -0,0 +1,371 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
pygments.lexers.gdscript
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Lexer for GDScript.
|
||||
|
||||
:copyright: Copyright 2xxx by The Godot Engine Community
|
||||
:license: MIT.
|
||||
|
||||
modified by Daniel J. Ramirez <djrmuv@gmail.com> based on the original python.py pygment
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
from pygments.lexer import (
|
||||
RegexLexer,
|
||||
include,
|
||||
bygroups,
|
||||
default,
|
||||
words,
|
||||
combined,
|
||||
)
|
||||
from pygments.token import (
|
||||
Text,
|
||||
Comment,
|
||||
Operator,
|
||||
Keyword,
|
||||
Name,
|
||||
String,
|
||||
Number,
|
||||
Punctuation,
|
||||
)
|
||||
|
||||
__all__ = ["GDScriptLexer"]
|
||||
|
||||
line_re = re.compile(".*?\n")
|
||||
|
||||
|
||||
class GDScriptLexer(RegexLexer):
|
||||
"""
|
||||
For `GDScript source code <https://www.godotengine.org>`_.
|
||||
"""
|
||||
|
||||
name = "GDScript"
|
||||
aliases = ["gdscript", "gd"]
|
||||
filenames = ["*.gd"]
|
||||
mimetypes = ["text/x-gdscript", "application/x-gdscript"]
|
||||
|
||||
def innerstring_rules(ttype):
|
||||
return [
|
||||
# the old style '%s' % (...) string formatting
|
||||
(
|
||||
r"%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?"
|
||||
"[hlL]?[E-GXc-giorsux%]",
|
||||
String.Interpol,
|
||||
),
|
||||
# backslashes, quotes and formatting signs must be parsed one at a time
|
||||
(r'[^\\\'"%\n]+', ttype),
|
||||
(r'[\'"\\]', ttype),
|
||||
# unhandled string formatting sign
|
||||
(r"%", ttype),
|
||||
# newlines are an error (use "nl" state)
|
||||
]
|
||||
|
||||
tokens = {
|
||||
"root": [
|
||||
(r"\n", Text),
|
||||
(
|
||||
r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
||||
bygroups(Text, String.Affix, String.Doc),
|
||||
),
|
||||
(
|
||||
r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
||||
bygroups(Text, String.Affix, String.Doc),
|
||||
),
|
||||
(r"[^\S\n]+", Text),
|
||||
(r"#.*$", Comment.Single),
|
||||
(r"[]{}:(),;[]", Punctuation),
|
||||
(r"\\\n", Text),
|
||||
(r"\\", Text),
|
||||
(r"(in|and|or|not)\b", Operator.Word),
|
||||
(
|
||||
r"!=|==|<<|>>|&&|\+=|-=|\*=|/=|%=|&=|\|=|\|\||[-~+/*%=<>&^.!|$]",
|
||||
Operator,
|
||||
),
|
||||
include("keywords"),
|
||||
(r"(func)((?:\s|\\\s)+)", bygroups(Keyword, Text), "funcname"),
|
||||
(r"(class)((?:\s|\\\s)+)", bygroups(Keyword, Text), "classname"),
|
||||
include("builtins"),
|
||||
(
|
||||
'([rR]|[uUbB][rR]|[rR][uUbB])(""")',
|
||||
bygroups(String.Affix, String.Double),
|
||||
"tdqs",
|
||||
),
|
||||
(
|
||||
"([rR]|[uUbB][rR]|[rR][uUbB])(''')",
|
||||
bygroups(String.Affix, String.Single),
|
||||
"tsqs",
|
||||
),
|
||||
(
|
||||
'([rR]|[uUbB][rR]|[rR][uUbB])(")',
|
||||
bygroups(String.Affix, String.Double),
|
||||
"dqs",
|
||||
),
|
||||
(
|
||||
"([rR]|[uUbB][rR]|[rR][uUbB])(')",
|
||||
bygroups(String.Affix, String.Single),
|
||||
"sqs",
|
||||
),
|
||||
(
|
||||
'([uUbB]?)(""")',
|
||||
bygroups(String.Affix, String.Double),
|
||||
combined("stringescape", "tdqs"),
|
||||
),
|
||||
(
|
||||
"([uUbB]?)(''')",
|
||||
bygroups(String.Affix, String.Single),
|
||||
combined("stringescape", "tsqs"),
|
||||
),
|
||||
(
|
||||
'([uUbB]?)(")',
|
||||
bygroups(String.Affix, String.Double),
|
||||
combined("stringescape", "dqs"),
|
||||
),
|
||||
(
|
||||
"([uUbB]?)(')",
|
||||
bygroups(String.Affix, String.Single),
|
||||
combined("stringescape", "sqs"),
|
||||
),
|
||||
include("name"),
|
||||
include("numbers"),
|
||||
],
|
||||
"keywords": [
|
||||
(
|
||||
words(
|
||||
(
|
||||
"and",
|
||||
"in",
|
||||
"not",
|
||||
"or",
|
||||
"as",
|
||||
"breakpoint",
|
||||
"class",
|
||||
"class_name",
|
||||
"extends",
|
||||
"is",
|
||||
"func",
|
||||
"setget",
|
||||
"signal",
|
||||
"tool",
|
||||
"const",
|
||||
"enum",
|
||||
"export",
|
||||
"onready",
|
||||
"static",
|
||||
"var",
|
||||
"break",
|
||||
"continue",
|
||||
"if",
|
||||
"elif",
|
||||
"else",
|
||||
"for",
|
||||
"pass",
|
||||
"return",
|
||||
"match",
|
||||
"while",
|
||||
"remote",
|
||||
"master",
|
||||
"puppet",
|
||||
"remotesync",
|
||||
"mastersync",
|
||||
"puppetsync",
|
||||
),
|
||||
suffix=r"\b",
|
||||
),
|
||||
Keyword,
|
||||
),
|
||||
],
|
||||
"builtins": [
|
||||
(
|
||||
words(
|
||||
(
|
||||
"Color8",
|
||||
"ColorN",
|
||||
"abs",
|
||||
"acos",
|
||||
"asin",
|
||||
"assert",
|
||||
"atan",
|
||||
"atan2",
|
||||
"bytes2var",
|
||||
"cartesian2polar",
|
||||
"ceil",
|
||||
"char",
|
||||
"clamp",
|
||||
"convert",
|
||||
"cos",
|
||||
"cosh",
|
||||
"db2linear",
|
||||
"decimals",
|
||||
"dectime",
|
||||
"deep_equal",
|
||||
"deg2rad",
|
||||
"dict2inst",
|
||||
"ease",
|
||||
"exp",
|
||||
"floor",
|
||||
"fmod",
|
||||
"fposmod",
|
||||
"funcref",
|
||||
"get_stack",
|
||||
"hash",
|
||||
"inst2dict",
|
||||
"instance_from_id",
|
||||
"inverse_lerp",
|
||||
"is_equal_approx",
|
||||
"is_inf",
|
||||
"is_instance_valid",
|
||||
"is_nan",
|
||||
"is_zero_approx",
|
||||
"len",
|
||||
"lerp",
|
||||
"lerp_angle",
|
||||
"linear2db",
|
||||
"load",
|
||||
"log",
|
||||
"max",
|
||||
"min",
|
||||
"move_toward",
|
||||
"nearest_po2",
|
||||
"ord",
|
||||
"parse_json",
|
||||
"polar2cartesian",
|
||||
"posmod",
|
||||
"pow",
|
||||
"preload",
|
||||
"print",
|
||||
"print_debug",
|
||||
"print_stack",
|
||||
"printerr",
|
||||
"printraw",
|
||||
"prints",
|
||||
"printt",
|
||||
"push_error",
|
||||
"push_warning",
|
||||
"rad2deg",
|
||||
"rand_range",
|
||||
"rand_seed",
|
||||
"randf",
|
||||
"randi",
|
||||
"randomize",
|
||||
"range",
|
||||
"range_lerp",
|
||||
"round",
|
||||
"seed",
|
||||
"sign",
|
||||
"sin",
|
||||
"sinh",
|
||||
"smoothstep",
|
||||
"sqrt",
|
||||
"step_decimals",
|
||||
"stepify",
|
||||
"str",
|
||||
"str2var",
|
||||
"tan",
|
||||
"tanh",
|
||||
"to_json",
|
||||
"type_exists",
|
||||
"typeof",
|
||||
"validate_json",
|
||||
"var2bytes",
|
||||
"var2str",
|
||||
"weakref",
|
||||
"wrapf",
|
||||
"wrapi",
|
||||
"yield",
|
||||
),
|
||||
prefix=r"(?<!\.)",
|
||||
suffix=r"\b",
|
||||
),
|
||||
Name.Builtin,
|
||||
),
|
||||
(r"((?<!\.)(self|false|true)|(PI|TAU|NAN|INF)" r")\b", Name.Builtin.Pseudo),
|
||||
(
|
||||
words(
|
||||
(
|
||||
"bool",
|
||||
"int",
|
||||
"float",
|
||||
"String",
|
||||
"NodePath",
|
||||
"Vector2",
|
||||
"Rect2",
|
||||
"Transform2D",
|
||||
"Vector3",
|
||||
"Rect3",
|
||||
"Plane",
|
||||
"Quat",
|
||||
"Basis",
|
||||
"Transform",
|
||||
"Color",
|
||||
"RID",
|
||||
"Object",
|
||||
"NodePath",
|
||||
"Dictionary",
|
||||
"Array",
|
||||
"PoolByteArray",
|
||||
"PoolIntArray",
|
||||
"PoolRealArray",
|
||||
"PoolStringArray",
|
||||
"PoolVector2Array",
|
||||
"PoolVector3Array",
|
||||
"PoolColorArray",
|
||||
"null",
|
||||
),
|
||||
prefix=r"(?<!\.)",
|
||||
suffix=r"\b",
|
||||
),
|
||||
Name.Builtin.Type,
|
||||
),
|
||||
],
|
||||
"numbers": [
|
||||
(r"(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?", Number.Float),
|
||||
(r"\d+[eE][+-]?[0-9]+j?", Number.Float),
|
||||
(r"0x[a-fA-F0-9]+", Number.Hex),
|
||||
(r"0b[01]+", Number.Bin),
|
||||
(r"\d+j?", Number.Integer),
|
||||
],
|
||||
"name": [(r"[a-zA-Z_]\w*", Name)],
|
||||
"funcname": [(r"[a-zA-Z_]\w*", Name.Function, "#pop"), default("#pop")],
|
||||
"classname": [(r"[a-zA-Z_]\w*", Name.Class, "#pop")],
|
||||
"stringescape": [
|
||||
(
|
||||
r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
||||
r"U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})",
|
||||
String.Escape,
|
||||
)
|
||||
],
|
||||
"strings-single": innerstring_rules(String.Single),
|
||||
"strings-double": innerstring_rules(String.Double),
|
||||
"dqs": [
|
||||
(r'"', String.Double, "#pop"),
|
||||
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
||||
include("strings-double"),
|
||||
],
|
||||
"sqs": [
|
||||
(r"'", String.Single, "#pop"),
|
||||
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
||||
include("strings-single"),
|
||||
],
|
||||
"tdqs": [
|
||||
(r'"""', String.Double, "#pop"),
|
||||
include("strings-double"),
|
||||
(r"\n", String.Double),
|
||||
],
|
||||
"tsqs": [
|
||||
(r"'''", String.Single, "#pop"),
|
||||
include("strings-single"),
|
||||
(r"\n", String.Single),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def setup(sphinx):
|
||||
sphinx.add_lexer("gdscript", GDScriptLexer)
|
||||
|
||||
return {
|
||||
"parallel_read_safe": True,
|
||||
"parallel_write_safe": True,
|
||||
}
|
120
_extensions/godot_descriptions.py
Normal file
120
_extensions/godot_descriptions.py
Normal file
@ -0,0 +1,120 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
godot_descriptions
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sphinx extension to automatically generate HTML meta description tags
|
||||
for all pages. Also comes with some special support for Godot class docs.
|
||||
|
||||
:copyright: Copyright 2021 by The Godot Engine Community
|
||||
:license: MIT.
|
||||
|
||||
based on the work of Takayuki Shimizukawa on OpenGraph support for Sphinx,
|
||||
see: https://github.com/sphinx-contrib/ogp
|
||||
"""
|
||||
|
||||
import re
|
||||
from docutils import nodes
|
||||
from sphinx import addnodes
|
||||
|
||||
|
||||
class DescriptionGenerator:
|
||||
def __init__(self, document, pagename="", n_sections_max=3, max_length=220):
|
||||
self.document = document
|
||||
self.text_list = []
|
||||
self.max_length = max_length
|
||||
self.current_length = 0
|
||||
self.n_sections = 0
|
||||
self.n_sections_max = n_sections_max
|
||||
self.pagename = pagename
|
||||
self.is_class = pagename.startswith("classes/")
|
||||
self.stop_word_reached = False
|
||||
|
||||
def dispatch_visit(self, node):
|
||||
if (
|
||||
self.stop_word_reached
|
||||
or self.current_length > self.max_length
|
||||
or self.n_sections > self.n_sections_max
|
||||
):
|
||||
return
|
||||
|
||||
if isinstance(node, addnodes.compact_paragraph) and node.get("toctree"):
|
||||
raise nodes.SkipChildren
|
||||
|
||||
add = True
|
||||
|
||||
if isinstance(node, nodes.paragraph):
|
||||
text = node.astext()
|
||||
|
||||
if self.is_class:
|
||||
# Skip OOP hierarchy info for description
|
||||
if (
|
||||
text.startswith("Inherits:")
|
||||
or text.startswith("Inherited By:")
|
||||
or text.strip() == "Example:"
|
||||
):
|
||||
add = False
|
||||
|
||||
# If we're in a class doc and reached the first table,
|
||||
# stop adding to the description
|
||||
if text.strip() == "Properties":
|
||||
self.stop_word_reached = True
|
||||
add = False
|
||||
|
||||
if add:
|
||||
self.text_list.append(text)
|
||||
self.current_length = self.current_length + len(text)
|
||||
|
||||
if add and isinstance(node, nodes.section):
|
||||
self.n_sections += 1
|
||||
|
||||
def dispatch_departure(self, node):
|
||||
pass
|
||||
|
||||
def format_description(self, desc):
|
||||
# Replace newlines with spaces
|
||||
desc = re.sub("\r|\n", " ", desc)
|
||||
|
||||
# Replace multiple spaces with single spaces
|
||||
desc = re.sub("\\s+", " ", desc)
|
||||
|
||||
# Escape double quotes for HTML
|
||||
desc = re.sub('"', """, desc)
|
||||
|
||||
return desc
|
||||
|
||||
def create_description(self, cutoff_suffix="..."):
|
||||
text = " ".join(self.text_list)
|
||||
|
||||
text = self.format_description(text)
|
||||
|
||||
# Cut to self.max_length, add cutoff_suffix at end
|
||||
if len(text) > self.max_length:
|
||||
text = text[: self.max_length - len(cutoff_suffix)].strip() + cutoff_suffix
|
||||
|
||||
return text
|
||||
|
||||
|
||||
def generate_description(app, pagename, templatename, context, doctree):
|
||||
if not doctree:
|
||||
return
|
||||
|
||||
generator = DescriptionGenerator(doctree, pagename)
|
||||
doctree.walkabout(generator)
|
||||
|
||||
description = (
|
||||
'<meta name="description" content="' + generator.create_description() + '">\n'
|
||||
)
|
||||
|
||||
context["metatags"] += description
|
||||
|
||||
|
||||
def setup(app):
|
||||
# Hook into Sphinx for all pages to
|
||||
# generate meta description tag and add to meta tag list
|
||||
app.connect("html-page-context", generate_description)
|
||||
|
||||
return {
|
||||
"parallel_read_safe": True,
|
||||
"parallel_write_safe": True,
|
||||
}
|
1029
_static/css/custom.css
Normal file
1029
_static/css/custom.css
Normal file
File diff suppressed because it is too large
Load Diff
213
_static/js/custom.js
Normal file
213
_static/js/custom.js
Normal file
@ -0,0 +1,213 @@
|
||||
// Handle page scroll and adjust sidebar accordingly.
|
||||
|
||||
// Each page has two scrolls: the main scroll, which is moving the content of the page;
|
||||
// and the sidebar scroll, which is moving the navigation in the sidebar.
|
||||
// We want the logo to gradually disappear as the main content is scrolled, giving
|
||||
// more room to the navigation on the left. This means adjusting the height
|
||||
// available to the navigation on the fly. There is also a banner below the navigation
|
||||
// that must be dealt with simultaneously.
|
||||
const registerOnScrollEvent = (function(){
|
||||
// Configuration.
|
||||
|
||||
// The number of pixels the user must scroll by before the logo is completely hidden.
|
||||
const scrollTopPixels = 234;
|
||||
// The target margin to be applied to the navigation bar when the logo is hidden.
|
||||
const menuTopMargin = 90;
|
||||
// The max-height offset when the logo is completely visible.
|
||||
const menuHeightOffset_default = 338;
|
||||
// The max-height offset when the logo is completely hidden.
|
||||
const menuHeightOffset_fixed = 102;
|
||||
// The distance between the two max-height offset values above; used for intermediate values.
|
||||
const menuHeightOffset_diff = (menuHeightOffset_default - menuHeightOffset_fixed);
|
||||
|
||||
// Media query handler.
|
||||
return function(mediaQuery) {
|
||||
// We only apply this logic to the "desktop" resolution (defined by a media query at the bottom).
|
||||
// This handler is executed when the result of the query evaluation changes, which means that
|
||||
// the page has moved between "desktop" and "mobile" states.
|
||||
|
||||
// When entering the "desktop" state, we register scroll events and adjust elements on the page.
|
||||
// When entering the "mobile" state, we clean up any registered events and restore elements on the page
|
||||
// to their initial state.
|
||||
|
||||
const $window = $(window);
|
||||
const $sidebar = $('.wy-side-scroll');
|
||||
const $search = $sidebar.children('.wy-side-nav-search');
|
||||
const $menu = $sidebar.children('.wy-menu-vertical');
|
||||
const $ethical = $sidebar.children('.ethical-rtd');
|
||||
|
||||
// This padding is needed to correctly adjust the height of the scrollable area in the sidebar.
|
||||
// It has to have the same height as the ethical block, if there is one.
|
||||
let $menuPadding = $menu.children('.wy-menu-ethical-padding');
|
||||
if ($menuPadding.length == 0) {
|
||||
$menuPadding = $('<div class="wy-menu-ethical-padding"></div>');
|
||||
$menu.append($menuPadding);
|
||||
}
|
||||
|
||||
if (mediaQuery.matches) {
|
||||
// Entering the "desktop" state.
|
||||
|
||||
// The main scroll event handler.
|
||||
// Executed as the page is scrolled and once immediatelly as the page enters this state.
|
||||
const handleMainScroll = (currentScroll) => {
|
||||
if (currentScroll >= scrollTopPixels) {
|
||||
// After the page is scrolled below the threshold, we fix everything in place.
|
||||
$search.css('margin-top', `-${scrollTopPixels}px`);
|
||||
$menu.css('margin-top', `${menuTopMargin}px`);
|
||||
$menu.css('max-height', `calc(100% - ${menuHeightOffset_fixed}px)`);
|
||||
}
|
||||
else {
|
||||
// Between the top of the page and the threshold we calculate intermediate values
|
||||
// to guarantee a smooth transition.
|
||||
$search.css('margin-top', `-${currentScroll}px`);
|
||||
$menu.css('margin-top', `${menuTopMargin + (scrollTopPixels - currentScroll)}px`);
|
||||
|
||||
if (currentScroll > 0) {
|
||||
const scrolledPercent = (scrollTopPixels - currentScroll) / scrollTopPixels;
|
||||
const offsetValue = menuHeightOffset_fixed + menuHeightOffset_diff * scrolledPercent;
|
||||
$menu.css('max-height', `calc(100% - ${offsetValue}px)`);
|
||||
} else {
|
||||
$menu.css('max-height', `calc(100% - ${menuHeightOffset_default}px)`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// The sidebar scroll event handler.
|
||||
// Executed as the sidebar is scrolled as well as after the main scroll. This is needed
|
||||
// because the main scroll can affect the scrollable area of the sidebar.
|
||||
const handleSidebarScroll = () => {
|
||||
const menuElement = $menu.get(0);
|
||||
const menuScrollTop = $menu.scrollTop();
|
||||
const menuScrollBottom = menuElement.scrollHeight - (menuScrollTop + menuElement.offsetHeight);
|
||||
|
||||
// As the navigation is scrolled we add a shadow to the top bar hanging over it.
|
||||
if (menuScrollTop > 0) {
|
||||
$search.addClass('fixed-and-scrolled');
|
||||
} else {
|
||||
$search.removeClass('fixed-and-scrolled');
|
||||
}
|
||||
|
||||
// Near the bottom we start moving the sidebar banner into view.
|
||||
if (menuScrollBottom < ethicalOffsetBottom) {
|
||||
$ethical.css('display', 'block');
|
||||
$ethical.css('margin-top', `-${ethicalOffsetBottom - menuScrollBottom}px`);
|
||||
} else {
|
||||
$ethical.css('display', 'none');
|
||||
$ethical.css('margin-top', '0px');
|
||||
}
|
||||
};
|
||||
|
||||
$search.addClass('fixed');
|
||||
$ethical.addClass('fixed');
|
||||
|
||||
// Adjust the inner height of navigation so that the banner can be overlaid there later.
|
||||
const ethicalOffsetBottom = $ethical.height() || 0;
|
||||
if (ethicalOffsetBottom) {
|
||||
$menuPadding.css('height', `${ethicalOffsetBottom}px`);
|
||||
} else {
|
||||
$menuPadding.css('height', `0px`);
|
||||
}
|
||||
|
||||
$window.scroll(function() {
|
||||
handleMainScroll(window.scrollY);
|
||||
handleSidebarScroll();
|
||||
});
|
||||
|
||||
$menu.scroll(function() {
|
||||
handleSidebarScroll();
|
||||
});
|
||||
|
||||
handleMainScroll(window.scrollY);
|
||||
handleSidebarScroll();
|
||||
} else {
|
||||
// Entering the "mobile" state.
|
||||
|
||||
$window.unbind('scroll');
|
||||
$menu.unbind('scroll');
|
||||
|
||||
$search.removeClass('fixed');
|
||||
$ethical.removeClass('fixed');
|
||||
|
||||
$search.css('margin-top', `0px`);
|
||||
$menu.css('margin-top', `0px`);
|
||||
$menu.css('max-height', 'initial');
|
||||
$menuPadding.css('height', `0px`);
|
||||
$ethical.css('margin-top', '0px');
|
||||
$ethical.css('display', 'block');
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
// Subscribe to DOM changes in the sidebar container, because there is a
|
||||
// banner that gets added at a later point, that we might not catch otherwise.
|
||||
const registerSidebarObserver = (function(){
|
||||
return function(callback) {
|
||||
const sidebarContainer = document.querySelector('.wy-side-scroll');
|
||||
|
||||
let sidebarEthical = null;
|
||||
const registerEthicalObserver = () => {
|
||||
if (sidebarEthical) {
|
||||
// Do it only once.
|
||||
return;
|
||||
}
|
||||
|
||||
sidebarEthical = sidebarContainer.querySelector('.ethical-rtd');
|
||||
if (!sidebarEthical) {
|
||||
// Do it only after we have the element there.
|
||||
return;
|
||||
}
|
||||
|
||||
// This observer watches over the ethical block in sidebar, and all of its subtree.
|
||||
const ethicalObserverConfig = { childList: true, subtree: true };
|
||||
const ethicalObserverCallback = (mutationsList, observer) => {
|
||||
for (let mutation of mutationsList) {
|
||||
if (mutation.type !== 'childList') {
|
||||
continue;
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const ethicalObserver = new MutationObserver(ethicalObserverCallback);
|
||||
ethicalObserver.observe(sidebarEthical, ethicalObserverConfig);
|
||||
};
|
||||
registerEthicalObserver();
|
||||
|
||||
// This observer watches over direct children of the main sidebar container.
|
||||
const observerConfig = { childList: true };
|
||||
const observerCallback = (mutationsList, observer) => {
|
||||
for (let mutation of mutationsList) {
|
||||
if (mutation.type !== 'childList') {
|
||||
continue;
|
||||
}
|
||||
|
||||
callback();
|
||||
registerEthicalObserver();
|
||||
}
|
||||
};
|
||||
|
||||
const observer = new MutationObserver(observerCallback);
|
||||
observer.observe(sidebarContainer, observerConfig);
|
||||
};
|
||||
})();
|
||||
|
||||
$(document).ready(() => {
|
||||
const mediaQuery = window.matchMedia('only screen and (min-width: 769px)');
|
||||
|
||||
registerOnScrollEvent(mediaQuery);
|
||||
mediaQuery.addListener(registerOnScrollEvent);
|
||||
|
||||
registerSidebarObserver(() => {
|
||||
registerOnScrollEvent(mediaQuery);
|
||||
});
|
||||
|
||||
// Load instant.page to prefetch pages upon hovering. This makes navigation feel
|
||||
// snappier. The script is dynamically appended as Read the Docs doesn't have
|
||||
// a way to add scripts with a "module" attribute.
|
||||
const instantPageScript = document.createElement('script');
|
||||
instantPageScript.toggleAttribute('module');
|
||||
/*! instant.page v5.1.0 - (C) 2019-2020 Alexandre Dieulot - https://instant.page/license */
|
||||
instantPageScript.innerText = 'let t,e;const n=new Set,o=document.createElement("link"),i=o.relList&&o.relList.supports&&o.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype,s="instantAllowQueryString"in document.body.dataset,a="instantAllowExternalLinks"in document.body.dataset,r="instantWhitelist"in document.body.dataset,c="instantMousedownShortcut"in document.body.dataset,d=1111;let l=65,u=!1,f=!1,m=!1;if("instantIntensity"in document.body.dataset){const t=document.body.dataset.instantIntensity;if("mousedown"==t.substr(0,"mousedown".length))u=!0,"mousedown-only"==t&&(f=!0);else if("viewport"==t.substr(0,"viewport".length))navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g"))||("viewport"==t?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(m=!0):"viewport-all"==t&&(m=!0));else{const e=parseInt(t);isNaN(e)||(l=e)}}if(i){const n={capture:!0,passive:!0};if(f||document.addEventListener("touchstart",function(t){e=performance.now();const n=t.target.closest("a");if(!h(n))return;v(n.href)},n),u?c||document.addEventListener("mousedown",function(t){const e=t.target.closest("a");if(!h(e))return;v(e.href)},n):document.addEventListener("mouseover",function(n){if(performance.now()-e<d)return;const o=n.target.closest("a");if(!h(o))return;o.addEventListener("mouseout",p,{passive:!0}),t=setTimeout(()=>{v(o.href),t=void 0},l)},n),c&&document.addEventListener("mousedown",function(t){if(performance.now()-e<d)return;const n=t.target.closest("a");if(t.which>1||t.metaKey||t.ctrlKey)return;if(!n)return;n.addEventListener("click",function(t){1337!=t.detail&&t.preventDefault()},{capture:!0,passive:!1,once:!0});const o=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});n.dispatchEvent(o)},n),m){let t;(t=window.requestIdleCallback?t=>{requestIdleCallback(t,{timeout:1500})}:t=>{t()})(()=>{const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const n=e.target;t.unobserve(n),v(n.href)}})});document.querySelectorAll("a").forEach(e=>{h(e)&&t.observe(e)})})}}function p(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||t&&(clearTimeout(t),t=void 0)}function h(t){if(t&&t.href&&(!r||"instant"in t.dataset)&&(a||t.origin==location.origin||"instant"in t.dataset)&&["http:","https:"].includes(t.protocol)&&("http:"!=t.protocol||"https:"!=location.protocol)&&(s||!t.search||"instant"in t.dataset)&&!(t.hash&&t.pathname+t.search==location.pathname+location.search||"noInstant"in t.dataset))return!0}function v(t){if(n.has(t))return;const e=document.createElement("link");e.rel="prefetch",e.href=t,document.head.appendChild(e),n.add(t)}';
|
||||
document.head.appendChild(instantPageScript);
|
||||
});
|
7
_templates/breadcrumbs.html
Normal file
7
_templates/breadcrumbs.html
Normal file
@ -0,0 +1,7 @@
|
||||
{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
|
||||
|
||||
{% block breadcrumbs_aside %}
|
||||
{% if not meta or meta.get('github_url') != 'hide' %}
|
||||
{{ super() }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
19
_templates/layout.html
Normal file
19
_templates/layout.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends "!layout.html" -%}
|
||||
{% block linktags -%}
|
||||
<meta name="theme-color" content="#3d8fcc">
|
||||
{% if godot_inject_language_links -%}
|
||||
{% for alternate_lang in godot_docs_supported_languages -%}
|
||||
{# Convert to ISO 639-1 format, e.g. zh_CN -> zh-cn -#}
|
||||
{% set alternate_lang_href = alternate_lang.lower().replace("_", "-") -%}
|
||||
<link rel="alternate" hreflang="{{ alternate_lang_href }}" href="{{ godot_docs_basepath }}{{ alternate_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
|
||||
{% endfor -%}
|
||||
<link rel="alternate" hreflang="x-default" href="{{ godot_docs_basepath }}{{ godot_default_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
|
||||
|
||||
<link rel="canonical" href="{{ godot_docs_basepath }}{{ lang_attr }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
|
||||
{% endif -%}
|
||||
{{ super() }}
|
||||
{% endblock -%}
|
||||
|
||||
{% block htmltitle -%}
|
||||
<title>{{ godot_title_prefix }}{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||
{% endblock -%}
|
1
_tools/codespell-ignore-lines.txt
Normal file
1
_tools/codespell-ignore-lines.txt
Normal file
@ -0,0 +1 @@
|
||||
| te | Telugu |
|
6
_tools/codespell-ignore.txt
Normal file
6
_tools/codespell-ignore.txt
Normal file
@ -0,0 +1,6 @@
|
||||
doubleclick
|
||||
dof
|
||||
lod
|
||||
que
|
||||
raison
|
||||
uint
|
42
_tools/format.sh
Executable file
42
_tools/format.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Loops through all text files tracked by Git.
|
||||
git grep -zIl '' |
|
||||
while IFS= read -rd '' f; do
|
||||
# Exclude csproj and hdr files.
|
||||
if [[ "$f" == *"csproj" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"hdr" ]]; then
|
||||
continue
|
||||
fi
|
||||
# Ensures that files are UTF-8 formatted.
|
||||
recode UTF-8 "$f" 2> /dev/null
|
||||
# Ensures that files have LF line endings.
|
||||
dos2unix "$f" 2> /dev/null
|
||||
# Ensures that files do not contain a BOM.
|
||||
sed -i '1s/^\xEF\xBB\xBF//' "$f"
|
||||
# Ensures that files end with newline characters.
|
||||
tail -c1 < "$f" | read -r _ || echo >> "$f";
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
FILESIZE="$(stat -c%s patch.patch)"
|
||||
MAXSIZE=5
|
||||
|
||||
# If no patch has been generated all is OK, clean up, and exit.
|
||||
if (( FILESIZE < MAXSIZE )); then
|
||||
printf "Files in this commit comply with the formatting rules.\n"
|
||||
rm -f patch.patch
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A patch has been created, notify the user, clean up, and exit.
|
||||
printf "\n*** The following differences were found between the code "
|
||||
printf "and the formatting rules:\n\n"
|
||||
cat patch.patch
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
rm -f patch.patch
|
||||
exit 1
|
40
_tools/list-unused-images.sh
Normal file
40
_tools/list-unused-images.sh
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
check_git_history=false
|
||||
|
||||
rm -f tmp-unused-images
|
||||
rm -f tmp-unused-images-history
|
||||
|
||||
# List images which might be unused.
|
||||
# Exceptions are ignored, and for .svg files we also look for potential .png
|
||||
# files with the same base name, as they might be sources.
|
||||
|
||||
exceptions="docs_logo.png tween_cheatsheet.png"
|
||||
|
||||
files=$(find -name "_build" -prune -o \( -name "*.png" -o -name "*.jpg" -o -name "*.svg" -o -name "*.gif" \) -print | sort)
|
||||
|
||||
for path in $files; do
|
||||
file=$(basename $path)
|
||||
if echo "$exceptions" | grep -q "$file"; then
|
||||
continue
|
||||
fi
|
||||
ext=${file##*.}
|
||||
base=${file%.*}
|
||||
found=$(rg -l ":: .*[ /]$file")
|
||||
if [ -z "$found" -a "$ext" == "svg" ]; then
|
||||
# May be source file.
|
||||
found=$(rg -l ":: .*[ /]$base.png")
|
||||
fi
|
||||
if [ -z "$found" ]; then
|
||||
echo "$path" >> tmp-unused-images
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [ "$check_git_history" = true ]; then
|
||||
for file in $(cat tmp-unused-images); do
|
||||
echo "File: $file"
|
||||
git log --diff-filter=A --follow $file
|
||||
echo
|
||||
done > tmp-unused-images-history
|
||||
fi
|
150
about/complying_with_licenses.rst
Normal file
150
about/complying_with_licenses.rst
Normal file
@ -0,0 +1,150 @@
|
||||
.. _doc_complying_with_licenses:
|
||||
|
||||
Complying with licenses
|
||||
=======================
|
||||
|
||||
What are licenses?
|
||||
------------------
|
||||
|
||||
Godot is created and distributed under the `MIT License <https://opensource.org/licenses/MIT>`_.
|
||||
It doesn't have a sole owner either, as every contributor that submits code to
|
||||
the project does it under this same license and keeps ownership of the
|
||||
contribution.
|
||||
|
||||
The license is the legal requirement for you (or your company) to use and
|
||||
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.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
In the case of the MIT license, the only requirement is to include the license
|
||||
text somewhere in your game or derivative project.
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
|
||||
.. note::
|
||||
|
||||
Your games do not need to be under the same license. You are free to release
|
||||
your Godot projects under any license and to create commercial games with
|
||||
the engine.
|
||||
|
||||
Inclusion
|
||||
---------
|
||||
|
||||
The license does not specify how it has to be included, so anything is valid as
|
||||
long as it can be displayed under some condition. These are the most common
|
||||
approaches (only need to implement one of them, not all).
|
||||
|
||||
Credits screen
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Include the above license text somewhere in the credits screen. It can be at the
|
||||
bottom after showing the rest of the credits. Most large studios use this
|
||||
approach with open source licenses.
|
||||
|
||||
Licenses screen
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Some games have a special menu (often in the settings) to display licenses.
|
||||
|
||||
Output log
|
||||
^^^^^^^^^^
|
||||
|
||||
Just printing the licensing text using the :ref:`print() <class_@GDScript_method_print>`
|
||||
function may be enough on platforms where a global output log is readable.
|
||||
This is the case on desktop platforms, Android and HTML5 (but not iOS and UWP).
|
||||
|
||||
Accompanying file
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
If the game is distributed on desktop platforms, a file containing the license
|
||||
can be added to the software that is installed to the user PC.
|
||||
|
||||
Printed manual
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
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
|
||||
in your game documentation or credits would be an acceptable way to satisfy
|
||||
the license terms.
|
||||
|
||||
Third-party licenses
|
||||
--------------------
|
||||
|
||||
Godot itself contains software written by
|
||||
`third parties <https://github.com/godotengine/godot/blob/master/COPYRIGHT.txt>`_.
|
||||
Most of it does not require license inclusion, but some do.
|
||||
Make sure to do it if these are compiled in your Godot export template. If
|
||||
you're using the official export templates, all libraries are enabled. This
|
||||
means you need to provide attribution for all the libraries listed below.
|
||||
|
||||
Here's a list of libraries requiring attribution:
|
||||
|
||||
FreeType
|
||||
^^^^^^^^
|
||||
|
||||
Godot uses `FreeType <https://www.freetype.org/>`_ to render fonts. Its license
|
||||
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.
|
||||
|
||||
ENet
|
||||
^^^^
|
||||
|
||||
Godot includes the `ENet <http://enet.bespin.org/>`_ library to handle
|
||||
high-level multiplayer. ENet has similar licensing terms as Godot:
|
||||
|
||||
|
||||
Copyright (c) 2002-2020 Lee Salzman
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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
|
||||
^^^^^^^
|
||||
|
||||
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:
|
||||
|
||||
Copyright The Mbed TLS Contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
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.
|
221
about/docs_changelog.rst
Normal file
221
about/docs_changelog.rst
Normal 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`
|
474
about/faq.rst
Normal file
474
about/faq.rst
Normal file
@ -0,0 +1,474 @@
|
||||
.. meta::
|
||||
:keywords: FAQ
|
||||
|
||||
.. _doc_faq:
|
||||
|
||||
Frequently asked questions
|
||||
==========================
|
||||
|
||||
What can I do with Godot? How much does it cost? What are the license terms?
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Godot is `Free and Open-Source Software <https://en.wikipedia.org/wiki/Free_and_open-source_software>`_ available under the `OSI-approved <https://opensource.org/licenses/MIT>`_ MIT license. This means it is free as in "free speech" as well as in "free beer."
|
||||
|
||||
In short:
|
||||
|
||||
* You are free to download and use Godot for any purpose: personal, non-profit, commercial, or otherwise.
|
||||
* You are free to modify, distribute, redistribute, and remix Godot to your heart's content, for any reason, both non-commercially and commercially.
|
||||
|
||||
All the contents of this accompanying documentation are published under
|
||||
the permissive Creative Commons Attribution 3.0 (`CC-BY 3.0 <https://creativecommons.org/licenses/by/3.0/>`_) license, with attribution
|
||||
to "Juan Linietsky, Ariel Manzur and the Godot Engine community."
|
||||
|
||||
Logos and icons are generally under the same Creative Commons license. Note
|
||||
that some third-party libraries included with Godot's source code may have
|
||||
different licenses.
|
||||
|
||||
For full details, look at the `COPYRIGHT.txt <https://github.com/godotengine/godot/blob/master/COPYRIGHT.txt>`_ as well
|
||||
as the `LICENSE.txt <https://github.com/godotengine/godot/blob/master/LICENSE.txt>`_ and `LOGO_LICENSE.txt <https://github.com/godotengine/godot/blob/master/LOGO_LICENSE.md>`_ files
|
||||
in the Godot repository.
|
||||
|
||||
Also, see `the license page on the Godot website <https://godotengine.org/license>`_.
|
||||
|
||||
Which platforms are supported by Godot?
|
||||
---------------------------------------
|
||||
|
||||
**For the editor:**
|
||||
|
||||
* Windows
|
||||
* macOS
|
||||
* X11 (Linux, \*BSD)
|
||||
|
||||
**For exporting your games:**
|
||||
|
||||
* Windows (and UWP)
|
||||
* macOS
|
||||
* X11 (Linux, \*BSD)
|
||||
* Android
|
||||
* iOS
|
||||
* Web
|
||||
|
||||
Both 32- and 64-bit binaries are supported where it makes sense, with 64
|
||||
being the default.
|
||||
|
||||
Some users also report building and using Godot successfully on ARM-based
|
||||
systems with Linux, like the Raspberry Pi.
|
||||
|
||||
Additionally, there is some unofficial third-party work being done on building
|
||||
for some consoles. However, none of this is included in the default build
|
||||
scripts or export templates at this time.
|
||||
|
||||
For more on this, see the sections on :ref:`exporting <toc-learn-workflow-export>`
|
||||
and :ref:`compiling Godot yourself <toc-devel-compiling>`.
|
||||
|
||||
Which programming languages are supported in Godot?
|
||||
---------------------------------------------------
|
||||
|
||||
The officially supported languages for Godot are GDScript, Visual Scripting,
|
||||
C#, and C++. See the subcategories for each language in the
|
||||
:ref:`scripting <toc-learn-scripting>` section.
|
||||
|
||||
If you are just starting out with either Godot or game development in general,
|
||||
GDScript is the recommended language to learn and use since it is native to Godot.
|
||||
While scripting languages tend to be less performant than lower-level languages in
|
||||
the long run, for prototyping, developing Minimum Viable Products (MVPs), and
|
||||
focusing on Time-To-Market (TTM), GDScript will provide a fast, friendly, and capable
|
||||
way of developing your games.
|
||||
|
||||
Note that C# support is still relatively new, and as such, you may encounter some
|
||||
issues along the way. Our friendly and hard-working development community is always
|
||||
ready to tackle new problems as they arise, but since this is an open-source project,
|
||||
we recommend that you first do some due diligence yourself. Searching through
|
||||
discussions on `open issues <https://github.com/godotengine/godot/issues>`_ is a
|
||||
great way to start your troubleshooting.
|
||||
|
||||
As for new languages, support is possible via third parties using the GDNative /
|
||||
NativeScript / PluginScript facilities. (See the question about plugins below.)
|
||||
Work is currently underway, for example, on unofficial bindings for Godot
|
||||
to `Python <https://github.com/touilleMan/godot-python>`_ and `Nim <https://github.com/pragmagic/godot-nim>`_.
|
||||
|
||||
.. _doc_faq_what_is_gdscript:
|
||||
|
||||
What is GDScript and why should I use it?
|
||||
-----------------------------------------
|
||||
|
||||
GDScript is Godot's integrated scripting language. It was built from the ground
|
||||
up to maximize Godot's potential in the least amount of code, affording both novice
|
||||
and expert developers alike to capitalize on Godot's strengths as fast as possible.
|
||||
If you've ever written anything in a language like Python before then you'll feel
|
||||
right at home. For examples, history, and a complete overview of the power GDScript
|
||||
offers you, check out the :ref:`GDScript scripting guide <doc_gdscript>`.
|
||||
|
||||
There are several reasons to use GDScript--especially when you are prototyping, in
|
||||
alpha/beta stages of your project, or are not creating the next AAA title--but the
|
||||
most salient reason is the overall **reduction of complexity**.
|
||||
|
||||
The original intent of creating a tightly integrated, custom scripting language for
|
||||
Godot was two-fold: first, it reduces the amount of time necessary to get up and running
|
||||
with Godot, giving developers a rapid way of exposing themselves to the engine with a
|
||||
focus on productivity; second, it reduces the overall burden of maintenance, attenuates
|
||||
the dimensionality of issues, and allows the developers of the engine to focus on squashing
|
||||
bugs and improving features related to the engine core--rather than spending a lot of time
|
||||
trying to get a small set of incremental features working across a large set of languages.
|
||||
|
||||
Since Godot is an open-source project, it was imperative from the start to prioritize a
|
||||
more integrated and seamless experience over attracting additional users by supporting
|
||||
more familiar programming languages--especially when supporting those more familiar
|
||||
languages would result in a worse experience. We understand if you would rather use
|
||||
another language in Godot (see the list of supported options above). That being said, if
|
||||
you haven't given GDScript a try, try it for **three days**. Just like Godot,
|
||||
once you see how powerful it is and rapid your development becomes, we think GDScript
|
||||
will grow on you.
|
||||
|
||||
More information about getting comfortable with GDScript or dynamically typed
|
||||
languages can be found in the :ref:`doc_gdscript_more_efficiently` tutorial.
|
||||
|
||||
What were the motivations behind creating GDScript?
|
||||
---------------------------------------------------
|
||||
|
||||
In the early days, the engine used the `Lua <https://www.lua.org>`__
|
||||
scripting language. Lua is fast, but creating bindings to an object
|
||||
oriented system (by using fallbacks) was complex and slow and took an
|
||||
enormous amount of code. After some experiments with
|
||||
`Python <https://www.python.org>`__, it also proved difficult to embed.
|
||||
|
||||
The main reasons for creating a custom scripting language for Godot were:
|
||||
|
||||
1. Poor threading support in most script VMs, and Godot uses threads
|
||||
(Lua, Python, Squirrel, JavaScript, ActionScript, etc.).
|
||||
2. Poor class-extending support in most script VMs, and adapting to
|
||||
the way Godot works is highly inefficient (Lua, Python, JavaScript).
|
||||
3. Many existing languages have horrible interfaces for binding to C++, resulting in large amount of
|
||||
code, bugs, bottlenecks, and general inefficiency (Lua, Python,
|
||||
Squirrel, JavaScript, etc.) We wanted to focus on a great engine, not a great amount of integrations.
|
||||
4. No native vector types (vector3, matrix4, etc.), resulting in highly
|
||||
reduced performance when using custom types (Lua, Python, Squirrel,
|
||||
JavaScript, ActionScript, etc.).
|
||||
5. Garbage collector results in stalls or unnecessarily large memory
|
||||
usage (Lua, Python, JavaScript, ActionScript, etc.).
|
||||
6. Difficulty to integrate with the code editor for providing code
|
||||
completion, live editing, etc. (all of them). This is well-supported
|
||||
by GDScript.
|
||||
|
||||
GDScript was designed to curtail the issues above, and more.
|
||||
|
||||
What type of 3D model formats does Godot support?
|
||||
-------------------------------------------------
|
||||
|
||||
Godot supports Collada via the `OpenCollada <https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools>`_ exporter (Maya, 3DSMax).
|
||||
If you are using Blender, take a look at our own `Better Collada Exporter <https://godotengine.org/download>`_.
|
||||
|
||||
As of Godot 3.0, glTF is supported.
|
||||
|
||||
FBX is supported via the Open Asset Import library. However, FBX is proprietary
|
||||
so we recommend using other formats listed above, if suitable for your workflow.
|
||||
|
||||
Will [insert closed SDK such as FMOD, GameWorks, etc.] be supported in Godot?
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
The aim of Godot is to create a free and open-source MIT-licensed engine that
|
||||
is modular and extendable. There are no plans for the core engine development
|
||||
community to support any third-party, closed-source/proprietary SDKs, as integrating
|
||||
with these would go against Godot's ethos.
|
||||
|
||||
That said, because Godot is open-source and modular, nothing prevents you or
|
||||
anyone else interested in adding those libraries as a module and shipping your
|
||||
game with them--as either open- or closed-source.
|
||||
|
||||
To see how support for your SDK of choice could still be provided, look at the
|
||||
Plugins question below.
|
||||
|
||||
If you know of a third-party SDK that is not supported by Godot but that offers
|
||||
free and open-source integration, consider starting the integration work yourself.
|
||||
Godot is not owned by one person; it belongs to the community, and it grows along
|
||||
with ambitious community contributors like you.
|
||||
|
||||
Why does Godot use Vulkan or OpenGL instead of Direct3D?
|
||||
--------------------------------------------------------
|
||||
|
||||
Godot aims for cross-platform compatibility and open standards first and
|
||||
foremost. OpenGL and Vulkan are the technologies that are both open and
|
||||
available (nearly) on all platforms. Thanks to this design decision, a project
|
||||
developed with Godot on Windows will run out of the box on Linux, macOS, and
|
||||
more.
|
||||
|
||||
Since Godot only has a few people working on its renderer, we would prefer
|
||||
having fewer rendering backends to maintain. On top of that, using a single API
|
||||
on all platforms allows for greater consistency with fewer platform-specific
|
||||
issues.
|
||||
|
||||
In the long term, we may develop a Direct3D 12 renderer for Godot (mainly for
|
||||
the Xbox's purposes), but Vulkan and OpenGL will remain the default rendering
|
||||
backends on all platforms, including Windows.
|
||||
|
||||
Why does Godot aim to keep its core feature set small?
|
||||
------------------------------------------------------
|
||||
|
||||
Godot intentionally does not include features that can be implemented by add-ons
|
||||
unless they are used very often. One example of this would be advanced
|
||||
artificial intelligence functionality.
|
||||
|
||||
There are several reasons for this:
|
||||
|
||||
- **Code maintenance and surface for bugs.** Every time we accept new code in
|
||||
the Godot repository, existing contributors often take the reponsibility of
|
||||
maintaining it. Some contributors don't always stick around after getting
|
||||
their code merged, which can make it difficult for us to maintain the code in
|
||||
question. This can lead to poorly maintained features with bugs that are never
|
||||
fixed. On top of that, the "API surface" that needs to be tested and checked
|
||||
for regressions keeps increasing over time.
|
||||
|
||||
- **Ease of contribution.** By keeping the codebase small and tidy, it can remain
|
||||
fast and easy to compile from source. This makes it easier for new
|
||||
contributors to get started with Godot, without requiring them to purchase
|
||||
high-end hardware.
|
||||
|
||||
- **Keeping the binary size small for the editor.** Not everyone has a fast Internet
|
||||
connection. Ensuring that everyone can download the Godot editor, extract it
|
||||
and run it in less than 5 minutes makes Godot more accessible to developers in
|
||||
all countries.
|
||||
|
||||
- **Keeping the binary size small for export templates.** This directly impacts the
|
||||
size of projects exported with Godot. On mobile and web platforms, keeping
|
||||
file sizes low is primordial to ensure fast installation and loading on
|
||||
underpowered devices. Again, there are many countries where high-speed
|
||||
Internet is not readily available. To add to this, strict data usage caps are
|
||||
often in effect in those countries.
|
||||
|
||||
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
|
||||
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.)
|
||||
|
||||
How should assets be created to handle multiple resolutions and aspect ratios?
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This question pops up often and it's probably thanks to the misunderstanding
|
||||
created by Apple when they originally doubled the resolution of their devices.
|
||||
It made people think that having the same assets in different resolutions was a
|
||||
good idea, so many continued towards that path. That originally worked to a
|
||||
point and only for Apple devices, but then several Android and Apple devices
|
||||
with different resolutions and aspect ratios were created, with a very wide
|
||||
range of sizes and DPIs.
|
||||
|
||||
The most common and proper way to achieve this is to, instead, use a single
|
||||
base resolution for the game and only handle different screen aspect ratios.
|
||||
This is mostly needed for 2D, as in 3D it's just a matter of Camera XFov or YFov.
|
||||
|
||||
1. Choose a single base resolution for your game. Even if there are
|
||||
devices that go up to 2K and devices that go down to 400p, regular
|
||||
hardware scaling in your device will take care of this at little or
|
||||
no performance cost. Most common choices are either near 1080p
|
||||
(1920x1080) or 720p (1280x720). Keep in mind the higher the
|
||||
resolution, the larger your assets, the more memory they will take
|
||||
and the longer the time it will take for loading.
|
||||
|
||||
2. Use the stretch options in Godot; 2D stretching while keeping aspect
|
||||
ratios works best. Check the :ref:`doc_multiple_resolutions` tutorial
|
||||
on how to achieve this.
|
||||
|
||||
3. Determine a minimum resolution and then decide if you want your game
|
||||
to stretch vertically or horizontally for different aspect ratios, or
|
||||
if there is one aspect ratio and you want black bars to appear
|
||||
instead. This is also explained in :ref:`doc_multiple_resolutions`.
|
||||
|
||||
4. For user interfaces, use the :ref:`anchoring <doc_size_and_anchors>`
|
||||
to determine where controls should stay and move. If UIs are more
|
||||
complex, consider learning about Containers.
|
||||
|
||||
And that's it! Your game should work in multiple resolutions.
|
||||
|
||||
If there is a desire to make your game also work on ancient
|
||||
devices with tiny screens (fewer than 300 pixels in width), you can use
|
||||
the export option to shrink images, and set that build to be used for
|
||||
certain screen sizes in the App Store or Google Play.
|
||||
|
||||
How can I extend Godot?
|
||||
-----------------------
|
||||
|
||||
For extending Godot, like creating Godot Editor plugins or adding support
|
||||
for additional languages, take a look at :ref:`EditorPlugins <doc_making_plugins>`
|
||||
and tool scripts.
|
||||
|
||||
Also, see the official blog posts on these topics:
|
||||
|
||||
* `A look at the GDNative architecture <https://godotengine.org/article/look-gdnative-architecture>`_
|
||||
* `GDNative is here! <https://godotengine.org/article/dlscript-here>`_
|
||||
|
||||
You can also take a look at the GDScript implementation, the Godot modules,
|
||||
as well as the `unofficial Python support <https://github.com/touilleMan/godot-python>`_ for Godot.
|
||||
This would be a good starting point to see how another third-party library
|
||||
integrates with Godot.
|
||||
|
||||
When is the next release of Godot out?
|
||||
--------------------------------------
|
||||
|
||||
When it's ready! See :ref:`doc_release_policy_when_is_next_release_out` for more
|
||||
information.
|
||||
|
||||
I would like to contribute! How can I get started?
|
||||
--------------------------------------------------
|
||||
|
||||
Awesome! As an open-source project, Godot thrives off of the innovation and
|
||||
ambition of developers like you.
|
||||
|
||||
The first place to get started is in the `issues <https://github.com/godotengine/godot/issues>`_.
|
||||
Find an issue that resonates with you, then proceed to the `How to Contribute <https://github.com/godotengine/godot/blob/master/CONTRIBUTING.md#contributing-pull-requests>`_
|
||||
guide to learn how to fork, modify, and submit a Pull Request (PR) with your changes.
|
||||
|
||||
I have a great idea for Godot. How can I share it?
|
||||
--------------------------------------------------
|
||||
|
||||
It might be tempting to want to bring ideas to Godot, like ones that
|
||||
result in massive core changes, some sort of mimicry of what another
|
||||
game engine does, or alternative workflows that you'd like built into
|
||||
the editor. These are great, and we are thankful to have such motivated
|
||||
people want to contribute, but Godot's focus is and always will be the
|
||||
core functionality as outlined in the `Roadmap <https://github.com/godotengine/godot-roadmap/blob/master/ROADMAP.md>`_,
|
||||
`squashing bugs and addressing issues <https://github.com/godotengine/godot/issues>`_,
|
||||
and conversations between Godot community members.
|
||||
|
||||
Most developers in the Godot community will be more interested to learn
|
||||
about things like:
|
||||
|
||||
- Your experience using the software and the problems you have (we
|
||||
care about this much more than ideas on how to improve it).
|
||||
- The features you would like to see implemented because you need them
|
||||
for your project.
|
||||
- The concepts that were difficult to understand while learning the software.
|
||||
- The parts of your workflow you would like to see optimized.
|
||||
- Parts where you missed clear tutorials or where the documentation wasn't clear.
|
||||
|
||||
Please don't feel like your ideas for Godot are unwelcome. Instead,
|
||||
try to reformulate them as a problem first, so developers and the community
|
||||
have a functional foundation to ground your ideas on.
|
||||
|
||||
A good way to approach sharing your ideas and problems with the community
|
||||
is as a set of user stories. Explain what you are trying to do, what behavior
|
||||
you expect to happen, and then what behavior actually happened. Framing problems
|
||||
and ideas this way will help the whole community stay focused on improving
|
||||
developer experiences as a whole.
|
||||
|
||||
Bonus points for bringing screenshots, concrete numbers, test cases, or example
|
||||
projects (if applicable).
|
||||
|
||||
.. _doc_faq_non_game_applications:
|
||||
|
||||
Is it possible to use Godot to create non-game applications?
|
||||
------------------------------------------------------------
|
||||
|
||||
Yes! Godot features an extensive built-in UI system, and its small distribution
|
||||
size can make it a suitable alternative to frameworks like Electron or Qt.
|
||||
|
||||
When creating a non-game application, make sure to enable
|
||||
:ref:`low-processor mode <class_ProjectSettings_property_application/run/low_processor_mode>`
|
||||
in the Project Settings to decrease CPU and GPU usage.
|
||||
|
||||
That said, we wouldn't recommend using Godot to create a *mobile* application
|
||||
since low-processor mode isn't supported on mobile platforms yet.
|
||||
|
||||
Check out `Material Maker <https://github.com/RodZill4/material-maker>`__ and
|
||||
`Pixelorama <https://github.com/Orama-Interactive/Pixelorama>`__ for examples of
|
||||
open source applications made with Godot.
|
||||
|
||||
.. _doc_faq_use_godot_as_library:
|
||||
|
||||
Is it possible to use Godot as a library?
|
||||
-----------------------------------------
|
||||
|
||||
Godot is meant to be used with its editor. We recommend you give it a try, as it
|
||||
will most likely save you time in the long term. There are no plans to make
|
||||
Godot usable as a library, as it would make the rest of the engine more
|
||||
convoluted and difficult to use for casual users.
|
||||
|
||||
If you want to use a rendering library, look into using an established rendering
|
||||
engine instead. Keep in mind rendering engines usually have smaller communities
|
||||
compared to Godot. This will make it more difficult to find answers to your
|
||||
questions.
|
||||
|
||||
What user interface toolkit does Godot use?
|
||||
-------------------------------------------
|
||||
|
||||
Godot does not use a standard :abbr:`GUI (Graphical User Interface)` toolkit
|
||||
like GTK, Qt or wxWidgets. Instead, Godot uses its own user interface toolkit,
|
||||
rendered using OpenGL ES or Vulkan. This toolkit is exposed in the form of
|
||||
Control nodes, which are used to render the editor (which is written in C++).
|
||||
These Control nodes can also be used in projects from any scripting language
|
||||
supported by Godot.
|
||||
|
||||
This custom toolkit makes it possible to benefit from hardware acceleration and
|
||||
have a consistent appearance across all platforms. On top of that, it doesn't
|
||||
have to deal with the LGPL licensing caveats that come with GTK or Qt. Lastly,
|
||||
this means Godot is "eating its own dog food" since the editor itself is one of
|
||||
the most complex users of Godot's UI system.
|
||||
|
||||
This custom UI toolkit :ref:`can't be used as a library <doc_faq_use_godot_as_library>`,
|
||||
but you can still
|
||||
:ref:`use Godot to create non-game applications by using the editor <doc_faq_non_game_applications>`.
|
||||
|
||||
.. _doc_faq_why_not_stl:
|
||||
|
||||
Why does Godot not use STL (Standard Template Library)?
|
||||
-------------------------------------------------------
|
||||
|
||||
Like many other libraries (Qt as an example), Godot does not make use of
|
||||
STL. We believe STL is a great general purpose library, but we had special
|
||||
requirements for Godot.
|
||||
|
||||
* STL templates create very large symbols, which results in huge debug binaries. We use few templates with very short names instead.
|
||||
* Most of our containers cater to special needs, like Vector, which uses copy on write and we use to pass data around, or the RID system, which requires O(1) access time for performance. Likewise, our hash map implementations are designed to integrate seamlessly with internal engine types.
|
||||
* Our containers have memory tracking built-in, which helps better track memory usage.
|
||||
* For large arrays, we use pooled memory, which can be mapped to either a preallocated buffer or virtual memory.
|
||||
* We use our custom String type, as the one provided by STL is too basic and lacks proper internationalization support.
|
||||
|
||||
Why does Godot not use exceptions?
|
||||
----------------------------------
|
||||
|
||||
We believe games should not crash, no matter what. If an unexpected
|
||||
situation happens, Godot will print an error (which can be traced even to
|
||||
script), but then it will try to recover as gracefully as possible and keep
|
||||
going.
|
||||
|
||||
Additionally, exceptions significantly increase binary size for the
|
||||
executable.
|
||||
|
||||
Why does Godot not enforce RTTI?
|
||||
--------------------------------
|
||||
|
||||
Godot provides its own type-casting system, which can optionally use RTTI
|
||||
internally. Disabling RTTI in Godot means considerably smaller binary sizes can
|
||||
be achieved, at a little performance cost.
|
||||
|
||||
Why does Godot not force users to implement DoD (Data oriented Design)?
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
While Godot internally for a lot of the heavy performance tasks attempts
|
||||
to use cache coherency as well as possible, we believe most users don't
|
||||
really need to be forced to use DoD practices.
|
||||
|
||||
DoD is mostly a cache coherency optimization that can only gain you
|
||||
significant performance improvements when dealing with dozens of
|
||||
thousands of objects (which are processed every frame with little
|
||||
modification). As in, if you are moving a few hundred sprites or enemies
|
||||
per frame, DoD won't help you, and you should consider a different approach
|
||||
to optimization.
|
||||
|
||||
The vast majority of games do not need this and Godot provides handy helpers
|
||||
to do the job for most cases when you do.
|
||||
|
||||
If a game that really needs to process such large amount of objects is
|
||||
needed, our recommendation is to use C++ and GDNative for the high
|
||||
performance parts and GDScript (or C#) for the rest of the game.
|
||||
|
||||
How can I support Godot development or contribute?
|
||||
--------------------------------------------------
|
||||
|
||||
See :ref:`doc_ways_to_contribute`.
|
||||
|
||||
Who is working on Godot? How can I contact you?
|
||||
-----------------------------------------------
|
||||
|
||||
See the corresponding page on the `Godot website <https://godotengine.org/contact>`_.
|
BIN
about/img/eol.png
Normal file
BIN
about/img/eol.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 435 B |
BIN
about/img/partial.png
Normal file
BIN
about/img/partial.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 435 B |
BIN
about/img/supported.png
Normal file
BIN
about/img/supported.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 435 B |
BIN
about/img/unstable.png
Normal file
BIN
about/img/unstable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 374 B |
18
about/index.rst
Normal file
18
about/index.rst
Normal file
@ -0,0 +1,18 @@
|
||||
About
|
||||
=====
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:name: toc-about
|
||||
|
||||
introduction
|
||||
faq
|
||||
troubleshooting
|
||||
list_of_features
|
||||
docs_changelog
|
||||
release_policy
|
||||
complying_with_licenses
|
||||
|
||||
.. history
|
||||
.. authors
|
||||
.. license
|
110
about/introduction.rst
Normal file
110
about/introduction.rst
Normal file
@ -0,0 +1,110 @@
|
||||
.. _doc_about_intro:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
::
|
||||
|
||||
func _ready():
|
||||
$Label.text = "Hello world!"
|
||||
|
||||
Welcome to the official documentation of Godot Engine, the free and open source
|
||||
community-driven 2D and 3D game engine! Behind this mouthful, you will find a
|
||||
powerful yet user-friendly tool that you can use to develop any kind of game,
|
||||
for any platform and with no usage restriction whatsoever.
|
||||
|
||||
This page gives a broad presentation of the engine and of the contents
|
||||
of this documentation, so that you know where to start if you are a beginner or
|
||||
where to look if you need info on a specific feature.
|
||||
|
||||
Before you start
|
||||
----------------
|
||||
|
||||
The :ref:`Tutorials and resources <doc_community_tutorials>` page lists
|
||||
video tutorials contributed by the community. If you prefer video to text,
|
||||
those may be worth a look.
|
||||
|
||||
In case you have trouble with one of the tutorials or your project,
|
||||
you can find help on the various :ref:`Community channels <doc_community_channels>`,
|
||||
especially the Godot Discord community, Q&A, and IRC.
|
||||
|
||||
About Godot Engine
|
||||
------------------
|
||||
|
||||
A game engine is a complex tool, and it is therefore difficult to present Godot
|
||||
in a few words. Here's a quick synopsis, which you are free to reuse
|
||||
if you need a quick writeup about Godot Engine.
|
||||
|
||||
Godot Engine is a feature-packed, cross-platform game engine to create 2D
|
||||
and 3D games from a unified interface. It provides a comprehensive set of
|
||||
common tools, so users can focus on making games without having to
|
||||
reinvent the wheel. Games can be exported in one click to a number of
|
||||
platforms, including the major desktop platforms (Linux, macOS, Windows)
|
||||
as well as mobile (Android, iOS) and web-based (HTML5) platforms.
|
||||
|
||||
Godot is completely free and open source under the permissive MIT
|
||||
license. No strings attached, no royalties, nothing. Users' games are
|
||||
theirs, down to the last line of engine code. Godot's development is fully
|
||||
independent and community-driven, empowering users to help shape their
|
||||
engine to match their expectations. It is supported by the `Software
|
||||
Freedom Conservancy <https://sfconservancy.org>`_ not-for-profit.
|
||||
|
||||
For a more in-depth view of the engine, you are encouraged to read this
|
||||
documentation further, especially the :ref:`Step by step
|
||||
<toc-learn-step_by_step>` tutorial.
|
||||
|
||||
About the documentation
|
||||
-----------------------
|
||||
|
||||
This documentation is continuously written, corrected, edited, and revamped by
|
||||
members of the Godot Engine community. It is edited via text files in the
|
||||
`reStructuredText <http://www.sphinx-doc.org/en/stable/rest.html>`_ markup
|
||||
language and then compiled into a static website/offline document using the
|
||||
open source `Sphinx <http://www.sphinx-doc.org>`_ and `ReadTheDocs
|
||||
<https://readthedocs.org/>`_ tools.
|
||||
|
||||
.. note:: You can contribute to Godot's documentation by opening issue tickets
|
||||
or sending patches via pull requests on its GitHub
|
||||
`source repository <https://github.com/godotengine/godot-docs>`_, or
|
||||
translating it into your language on `Hosted Weblate
|
||||
<https://hosted.weblate.org/projects/godot-engine/godot-docs/>`_.
|
||||
|
||||
All the contents are under the permissive Creative Commons Attribution 3.0
|
||||
(`CC-BY 3.0 <https://creativecommons.org/licenses/by/3.0/>`_) license, with
|
||||
attribution to "Juan Linietsky, Ariel Manzur and the Godot Engine community".
|
||||
|
||||
Organization of the documentation
|
||||
---------------------------------
|
||||
|
||||
This documentation is organized in five sections with an impressively
|
||||
unbalanced distribution of contents – but the way it is split up should be
|
||||
relatively intuitive:
|
||||
|
||||
- The :ref:`sec-general` section contains this introduction as well as
|
||||
information about the engine, its history, its licensing, authors, etc. It
|
||||
also contains the :ref:`doc_faq`.
|
||||
- The :ref:`sec-learn` section is the *raison d'être* of this
|
||||
documentation, as it contains all the necessary information on using the
|
||||
engine to make games. It starts with the :ref:`Step by step
|
||||
<toc-learn-step_by_step>` tutorial which should be the entry point for all
|
||||
new users.
|
||||
- The :ref:`sec-tutorials` section can be read as needed,
|
||||
in any order. It contains feature-specific tutorials and documentation.
|
||||
- The :ref:`sec-devel` section is intended for advanced users and contributors
|
||||
to the engine development, with information on compiling the engine,
|
||||
developing C++ modules or editor plugins.
|
||||
- The :ref:`sec-community` section gives information related to contributing to
|
||||
engine development and the life of its community, e.g. how to report bugs,
|
||||
help with the documentation, etc. It also points to various community channels
|
||||
like IRC and Discord and contains a list of recommended third-party tutorials
|
||||
outside of this documentation.
|
||||
- Finally, the :ref:`sec-class-ref` is the documentation of the Godot API,
|
||||
which is also available directly within the engine's script editor. It is
|
||||
generated automatically from a file in the main source repository, therefore
|
||||
the generated files of the documentation are not meant to be modified. See
|
||||
:ref:`doc_updating_the_class_reference` for details.
|
||||
|
||||
In addition to this documentation you may also want to take a look at the
|
||||
various `Godot demo projects <https://github.com/godotengine/godot-demo-projects>`_.
|
||||
|
||||
Have fun reading and making games with Godot Engine!
|
607
about/list_of_features.rst
Normal file
607
about/list_of_features.rst
Normal file
@ -0,0 +1,607 @@
|
||||
.. _doc_list_of_features:
|
||||
|
||||
List of features
|
||||
================
|
||||
|
||||
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>`__
|
||||
are available in the latest development version (4.0).
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
Platforms
|
||||
^^^^^^^^^
|
||||
|
||||
**Can run both the editor and exported projects:**
|
||||
|
||||
- Windows 7 and later (64-bit and 32-bit).
|
||||
- macOS 10.12 and later (64-bit, x86 and ARM).
|
||||
- Linux (64-bit and 32-bit, x86 and ARM).
|
||||
|
||||
- Binaries are statically linked and can run on any distribution if compiled
|
||||
on an old enough base distribution.
|
||||
- Official binaries are compiled on Ubuntu 14.04.
|
||||
|
||||
- HTML5 via WebAssembly (Firefox, Chrome, Edge, Opera).
|
||||
|
||||
**Runs exported projects:**
|
||||
|
||||
- Android 4.4 and later.
|
||||
- iOS 10.0 and later.
|
||||
- :ref:`Consoles <doc_consoles>`.
|
||||
- :ref:`Headless Linux and macOS servers <doc_exporting_for_dedicated_servers>`.
|
||||
|
||||
Godot aims to be as platform-independent as possible and can be ported to new
|
||||
platforms with relative ease.
|
||||
|
||||
Editor
|
||||
^^^^^^
|
||||
|
||||
**Features:**
|
||||
|
||||
- Scene tree editor.
|
||||
- Script editor.
|
||||
- Support for :ref:`external script editors <doc_external_editor>` such as
|
||||
Visual Studio Code or Vim.
|
||||
- GDScript :ref:`debugger <doc_debugger_panel>`.
|
||||
|
||||
- No support for debugging in threads yet.
|
||||
- Performance monitoring tools.
|
||||
- Live script reloading.
|
||||
- Live scene editing.
|
||||
|
||||
- Changes will reflect in the editor and will be kept after closing the running project.
|
||||
|
||||
- Remote inspector.
|
||||
|
||||
- Changes won't reflect in the editor and won't be kept after closing the running project.
|
||||
|
||||
- Live camera replication.
|
||||
|
||||
- Move the in-editor camera and see the result in the running project.
|
||||
|
||||
- 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.
|
||||
|
||||
2D graphics
|
||||
^^^^^^^^^^^
|
||||
|
||||
**Two renderers available:**
|
||||
|
||||
- OpenGL ES 3.0 renderer (uses OpenGL 3.3 on desktop platforms).
|
||||
|
||||
- High-end visuals. Recommended on desktop platforms.
|
||||
|
||||
- OpenGL ES 2.0 renderer (uses OpenGL 2.1 on desktop platforms).
|
||||
|
||||
- Recommended on mobile and Web platforms.
|
||||
|
||||
**Features:**
|
||||
|
||||
- Sprite, polygon and line rendering.
|
||||
|
||||
- High-level tools to draw lines and polygons such as Polygon2D and Line2D.
|
||||
|
||||
- AnimatedSprite as a helper for creating animated sprites.
|
||||
- Parallax layers.
|
||||
|
||||
- Pseudo-3D support by automatically duplicating a layer several times.
|
||||
|
||||
- 2D lighting with normal maps.
|
||||
|
||||
- Hard or soft shadows.
|
||||
|
||||
- Font rendering using bitmaps (BitmapFont) or rasterization using FreeType (DynamicFont).
|
||||
|
||||
- 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.
|
||||
- DynamicFont supports optional font outlines with adjustable width and color.
|
||||
- Support for font oversampling to keep fonts sharp at higher resolutions.
|
||||
|
||||
- GPU-based particles with support for custom particle shaders.
|
||||
- CPU-based particles.
|
||||
|
||||
2D tools
|
||||
^^^^^^^^
|
||||
|
||||
- 2D camera with built-in smoothing and drag margins.
|
||||
- Path2D node to represent a path in 2D space.
|
||||
|
||||
- Can be drawn in the editor or generated procedurally.
|
||||
- PathFollow2D node to make nodes follow a Path2D.
|
||||
|
||||
- 2D geometry helper class.
|
||||
- Line2D node to draw textured 2D lines.
|
||||
|
||||
2D physics
|
||||
^^^^^^^^^^
|
||||
|
||||
**Physics bodies:**
|
||||
|
||||
- Static bodies.
|
||||
- Rigid bodies.
|
||||
- Kinematic bodies.
|
||||
- Joints.
|
||||
- Areas to detect bodies entering or leaving it.
|
||||
|
||||
**Collision detection:**
|
||||
|
||||
- Built-in shapes: line, box, circle, capsule.
|
||||
- Collision polygons (can be drawn manually or generated from a sprite in the editor).
|
||||
|
||||
3D graphics
|
||||
^^^^^^^^^^^
|
||||
|
||||
**Two renderers available:**
|
||||
|
||||
- OpenGL ES 3.0 renderer (uses OpenGL 3.3 on desktop platforms).
|
||||
|
||||
- High-end visuals. Recommended on desktop platforms.
|
||||
- HDR rendering with sRGB.
|
||||
|
||||
- OpenGL ES 2.0 renderer (uses OpenGL 2.1 on desktop platforms).
|
||||
|
||||
- Recommended on mobile and Web platforms.
|
||||
- LDR rendering for greater compatibility.
|
||||
- Not all features are available. Features available only when using
|
||||
the OpenGL ES 3.0 renderer are marked *GLES3* below.
|
||||
|
||||
**Camera:**
|
||||
|
||||
- Perspective, orthographic and frustum-offset cameras.
|
||||
|
||||
**Physically-based rendering:**
|
||||
|
||||
- Follows the Disney PBR model.
|
||||
- Uses a roughness-metallic workflow with support for ORM textures.
|
||||
- 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).
|
||||
- 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.
|
||||
|
||||
**Real-time lighting:**
|
||||
|
||||
- Directional lights (sun/moon). Up to 4 per scene.
|
||||
- Omnidirectional lights.
|
||||
- Spot lights with adjustable cone angle and attenuation.
|
||||
|
||||
**Shadow mapping:**
|
||||
|
||||
- *DirectionalLight:* Orthogonal (fastest), PSSM 2-split and 4-split.
|
||||
Supports blending between splits.
|
||||
- *OmniLight:* Dual paraboloid (fast) or cubemap (slower but more accurate).
|
||||
Supports colored projector textures in the form of panoramas.
|
||||
- *SpotLight:* Single texture.
|
||||
|
||||
**Global illumination with indirect lighting:**
|
||||
|
||||
- Baked lightmaps (fast, but can't be updated at run-time).
|
||||
|
||||
- Supports baking indirect light only or baking both direct and indirect lighting.
|
||||
The bake mode can be adjusted on a per-light basis to allow for hybrid light
|
||||
baking setups.
|
||||
- Supports lighting dynamic objects using an automatic octree-based system.
|
||||
No manual probe placement is required.
|
||||
- Lightmaps are baked on the CPU.
|
||||
|
||||
- *GLES3:* GI probes (slower, semi-real-time). Supports reflections.
|
||||
|
||||
**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.
|
||||
- Reflection techniques can be mixed together for greater accuracy or scalability.
|
||||
|
||||
**Sky:**
|
||||
|
||||
- Panorama sky (using an HDRI).
|
||||
- Procedural sky.
|
||||
|
||||
**Fog:**
|
||||
|
||||
- Depth fog with an adjustable attenuation curve.
|
||||
- Height fog (floor or ceiling) with adjustable attenuation.
|
||||
- Support for automatic depth fog color depending on the camera direction
|
||||
(to match the sun color).
|
||||
- Optional transmittance to make lights more visible in the fog.
|
||||
|
||||
**Particles:**
|
||||
|
||||
- *GLES3:* GPU-based particles with support for custom particle shaders.
|
||||
- CPU-based particles.
|
||||
|
||||
**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.
|
||||
|
||||
**Texture filtering:**
|
||||
|
||||
- Nearest, bilinear, trilinear or anisotropic filtering.
|
||||
|
||||
**Texture compression:**
|
||||
|
||||
- *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.
|
||||
|
||||
3D tools
|
||||
^^^^^^^^
|
||||
|
||||
- Built-in meshes: cube, cylinder/cone, (hemi)sphere, prism, plane, quad.
|
||||
- Tools for :ref:`procedural geometry generation <doc_procedural_geometry>`.
|
||||
- :ref:`Constructive solid geometry <doc_csg_tools>` (intended for prototyping).
|
||||
- Path3D node to represent a path in 3D space.
|
||||
|
||||
- Can be drawn in the editor or generated procedurally.
|
||||
- PathFollow3D node to make nodes follow a Path3D.
|
||||
|
||||
- 3D geometry helper class.
|
||||
|
||||
3D physics
|
||||
^^^^^^^^^^
|
||||
|
||||
**Physics bodies:**
|
||||
|
||||
- Static bodies.
|
||||
- Rigid bodies.
|
||||
- Kinematic bodies.
|
||||
- Vehicle bodies (intended for arcade physics, not simulation).
|
||||
- Joints.
|
||||
- Soft bodies.
|
||||
- Ragdolls.
|
||||
- Areas to detect bodies entering or leaving it.
|
||||
|
||||
**Collision detection:**
|
||||
|
||||
- Built-in shapes: cuboid, sphere, capsule, cylinder.
|
||||
- Generate triangle collision shapes for any mesh from the editor.
|
||||
- Generate one or several convex collision shapes for any mesh from the editor.
|
||||
|
||||
Shaders
|
||||
^^^^^^^
|
||||
|
||||
- *2D:* Custom vertex, fragment, and light shaders.
|
||||
- *3D:* Custom vertex, fragment, light, and sky shaders.
|
||||
- Text-based shaders using a :ref:`shader language inspired by GLSL <doc_shading_language>`.
|
||||
- Visual shader editor.
|
||||
|
||||
- Support for visual shader plugins.
|
||||
|
||||
Scripting
|
||||
^^^^^^^^^
|
||||
|
||||
**General:**
|
||||
|
||||
- Object-oriented design pattern with scripts extending nodes.
|
||||
- Signals and groups for communicating between scripts.
|
||||
- Support for :ref:`cross-language scripting <doc_cross_language_scripting>`.
|
||||
- Many 2D and 3D linear algebra data types such as vectors and transforms.
|
||||
|
||||
:ref:`GDScript: <toc-learn-scripting-gdscript>`
|
||||
|
||||
- :ref:`High-level interpreted language <doc_gdscript>` with
|
||||
:ref:`optional static typing <doc_gdscript_static_typing>`.
|
||||
- Syntax inspired by Python.
|
||||
- Syntax highlighting is provided on GitHub.
|
||||
- :ref:`Use threads <doc_using_multiple_threads>` to perform asynchronous actions
|
||||
or make use of multiple processor cores.
|
||||
|
||||
:ref:`C#: <toc-learn-scripting-C#>`
|
||||
|
||||
- Packaged in a separate binary to keep file sizes and dependencies down.
|
||||
- Uses Mono 6.x.
|
||||
|
||||
- Full support for the C# 7.0 syntax and features.
|
||||
|
||||
- Supports all platforms.
|
||||
- Using an external editor is recommended to benefit from IDE functionality.
|
||||
|
||||
:ref:`VisualScript: <toc-learn-scripting-visual_script>`
|
||||
|
||||
- :ref:`Graph-based visual scripting language <doc_what_is_visual_script>`.
|
||||
- Works best when used for specific purposes (such as level-specific logic)
|
||||
rather than as a language to create entire projects.
|
||||
|
||||
**GDNative (C, C++, Rust, D, ...):**
|
||||
|
||||
- When you need it, link to native libraries for higher performance and third-party integrations.
|
||||
|
||||
- For scripting game logic, GDScript or C# are recommended if their
|
||||
performance is suitable.
|
||||
|
||||
- Official bindings for C and C++.
|
||||
|
||||
- Use any build system and language features you wish.
|
||||
|
||||
- Maintained D, Kotlin, Python, Nim, and Rust bindings provided by the community.
|
||||
|
||||
Audio
|
||||
^^^^^
|
||||
|
||||
**Features:**
|
||||
|
||||
- Mono, stereo, 5.1 and 7.1 output.
|
||||
- Non-positional and positional playback in 2D and 3D.
|
||||
|
||||
- Optional Doppler effect in 2D and 3D.
|
||||
|
||||
- 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.
|
||||
- Audio input to record microphones with real-time access using the AudioEffectCapture class.
|
||||
- MIDI input.
|
||||
|
||||
- No support for MIDI output yet.
|
||||
|
||||
**APIs used:**
|
||||
|
||||
- *Windows:* WASAPI.
|
||||
- *macOS:* CoreAudio.
|
||||
- *Linux:* PulseAudio or ALSA.
|
||||
|
||||
Import
|
||||
^^^^^^
|
||||
|
||||
- Support for :ref:`custom import plugins <doc_import_plugins>`.
|
||||
|
||||
**Formats:**
|
||||
|
||||
- *Images:* See :ref:`doc_import_images`.
|
||||
- *Audio:*
|
||||
|
||||
- WAV with optional IMA-ADPCM compression.
|
||||
- Ogg Vorbis.
|
||||
- MP3.
|
||||
|
||||
- *3D scenes:*
|
||||
|
||||
- glTF 2.0 *(recommended)*.
|
||||
- `ESCN <https://github.com/godotengine/godot-blender-exporter>`__
|
||||
(direct export from Blender).
|
||||
- FBX (experimental, static meshes only).
|
||||
- Collada (.dae).
|
||||
- Wavefront OBJ (static scenes only, can be loaded directly as a mesh).
|
||||
|
||||
Input
|
||||
^^^^^
|
||||
|
||||
- Input mapping system using hardcoded input events or remappable input actions.
|
||||
|
||||
- Axis values can be mapped to two different actions with a configurable deadzone.
|
||||
- Use the same code to support both keyboards and gamepads.
|
||||
|
||||
- Keyboard input.
|
||||
|
||||
- Keys can be mapped in "physical" mode to be independent of the keyboard layout.
|
||||
|
||||
- Mouse input.
|
||||
|
||||
- The mouse cursor can be visible, hidden, captured or confined within the window.
|
||||
- When captured, raw input will be used on Windows and Linux to
|
||||
sidestep the OS' mouse acceleration settings.
|
||||
|
||||
- Gamepad input (up to 8 simultaneous controllers).
|
||||
- Pen/tablet input with pressure support.
|
||||
- Gamepad, keyboard and mouse input support are also available on Android.
|
||||
|
||||
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.
|
||||
|
||||
Networking
|
||||
^^^^^^^^^^
|
||||
|
||||
- Low-level TCP networking using StreamPeer and TCP_Server.
|
||||
- Low-level UDP networking using PacketPeer and UDPServer.
|
||||
- Low-level HTTP requests using HTTPClient.
|
||||
- High-level HTTP requests using HTTPRequest.
|
||||
|
||||
- Supports HTTPS out of the box using bundled certificates.
|
||||
|
||||
- High-level multiplayer API using UDP and ENet.
|
||||
|
||||
- Automatic replication using remote procedure calls (RPCs).
|
||||
- Supports unreliable, reliable and ordered transfers.
|
||||
|
||||
- WebSocket client and server, available on all platforms.
|
||||
- WebRTC client and server, available on all platforms.
|
||||
- Support for UPnP to sidestep the requirement to forward ports when hosting
|
||||
a server behind a NAT.
|
||||
|
||||
Internationalization
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Full support for Unicode including emoji.
|
||||
- Store localization strings using :ref:`CSV <doc_internationalizing_games>`
|
||||
or :ref:`gettext <doc_localization_using_gettext>`.
|
||||
- Use localized strings in your project automatically in GUI elements or by
|
||||
using the ``tr()`` function.
|
||||
- Support for right-to-left typesetting and text shaping planned in Godot 4.0.
|
||||
|
||||
Windowing and OS integration
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Move, resize, minimize, and maximize the window spawned by the project.
|
||||
- Change the window title and icon.
|
||||
- Request attention (will cause the title bar to blink on most platforms).
|
||||
- Fullscreen mode.
|
||||
|
||||
- Doesn't use exclusive fullscreen, so the screen resolution can't be changed this way.
|
||||
Use a Viewport with a different resolution instead.
|
||||
|
||||
- Borderless window (fullscreen or non-fullscreen).
|
||||
- Ability to keep the window always on top.
|
||||
- Transparent window with per-pixel transparency.
|
||||
- Global menu integration on macOS.
|
||||
- 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.
|
||||
|
||||
Mobile
|
||||
^^^^^^
|
||||
|
||||
- In-app purchases on Android and iOS.
|
||||
- Support for advertisements using third-party modules.
|
||||
- Support for subview embedding on Android.
|
||||
|
||||
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
|
||||
^^^^^^^^^^
|
||||
|
||||
Godot's GUI is built using the same Control nodes used to make games in Godot.
|
||||
The editor UI can easily be extended in many ways using add-ons.
|
||||
|
||||
**Nodes:**
|
||||
|
||||
- Buttons.
|
||||
- Checkboxes, check buttons, radio buttons.
|
||||
- Text entry using LineEdit (single line) and TextEdit (multiple lines).
|
||||
- Dropdown menus using PopupMenu and OptionButton.
|
||||
- Scrollbars.
|
||||
- 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, ...).
|
||||
- Controls can be rotated and scaled.
|
||||
|
||||
**Sizing:**
|
||||
|
||||
- Anchors to keep GUI elements in a specific corner, edge or centered.
|
||||
- Containers to place GUI elements automatically following certain rules.
|
||||
|
||||
- :ref:`Stack <class_BoxContainer>` layouts.
|
||||
- :ref:`Grid <class_GridContainer>` layouts.
|
||||
- :ref:`Margin <class_MarginContainer>` and :ref:`centered <class_CenterContainer>`
|
||||
layouts.
|
||||
- :ref:`Draggable splitter <class_SplitContainer>` layouts.
|
||||
|
||||
- Scale to multiple resolutions using the ``2d`` or ``viewport`` stretch modes.
|
||||
- Support any aspect ratio using anchors and the ``expand`` stretch aspect.
|
||||
|
||||
**Theming:**
|
||||
|
||||
- Built-in theme editor.
|
||||
|
||||
- Generate a theme based on the current editor theme settings.
|
||||
|
||||
- Procedural vector-based theming using :ref:`class_StyleBoxFlat`.
|
||||
|
||||
- Supports rounded/beveled corners, drop shadows and per-border widths.
|
||||
|
||||
- Texture-based theming using :ref:`class_StyleBoxTexture`.
|
||||
|
||||
Godot's small distribution size can make it a suitable alternative to frameworks
|
||||
like Electron or Qt.
|
||||
|
||||
Animation
|
||||
^^^^^^^^^
|
||||
|
||||
- Direct kinematics and inverse kinematics.
|
||||
- Support for animating any property with customizable interpolation.
|
||||
- Support for calling methods in animation tracks.
|
||||
- Support for playing sounds in animation tracks.
|
||||
- Support for Bézier curves in animation.
|
||||
|
||||
File formats
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Scenes and resources can be saved in :ref:`text-based <doc_tscn_file_format>` or binary formats.
|
||||
|
||||
- Text-based formats are human-readable and more friendly to version control.
|
||||
- Binary formats are faster to save/load for large scenes/resources.
|
||||
|
||||
- Read and write text or binary files using :ref:`class_File`.
|
||||
|
||||
- Can optionally be compressed or encrypted.
|
||||
|
||||
- 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, ...
|
||||
|
||||
- Read XML files using :ref:`class_XMLParser`.
|
||||
- Pack game data into a PCK file (custom format optimized for fast seeking),
|
||||
into a ZIP archive, or directly into the executable for single-file distribution.
|
||||
- :ref:`Export additional PCK files<doc_exporting_pcks>` that can be read
|
||||
by the engine to support mods and DLCs.
|
||||
|
||||
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.
|
||||
|
||||
- Export and deploy projects using continuous integration platforms.
|
||||
- `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
|
||||
into the engine binary.
|
||||
- Engine and editor written in C++03.
|
||||
|
||||
- Can be :ref:`compiled <doc_introduction_to_the_buildsystem>` using GCC,
|
||||
Clang and MSVC. MinGW is also supported.
|
||||
- Friendly towards packagers. In most cases, system libraries can be used
|
||||
instead of the ones provided by Godot. The build system doesn't download anything.
|
||||
Builds can be fully reproducible.
|
||||
- Godot 4.0 will be written in C++17.
|
||||
|
||||
- Licensed under the permissive MIT license.
|
||||
|
||||
- Open developement process with :ref:`contributions welcome <doc_ways_to_contribute>`.
|
||||
|
||||
.. seealso::
|
||||
|
||||
The `Godot proposals repository <https://github.com/godotengine/godot-proposals>`__
|
||||
lists features that have been requested by the community and may be implemented
|
||||
in future Godot releases.
|
149
about/release_policy.rst
Normal file
149
about/release_policy.rst
Normal 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 | ~2022 (see below) | |unstable| *Current focus of development (unstable).* |
|
||||
+-------------+----------------------+--------------------------------------------------------------------------+
|
||||
| Godot 3.5 | Q2 2022 | |supported| *Beta.* Receives new features as well as bug fixes while |
|
||||
| | | under development. |
|
||||
+-------------+----------------------+--------------------------------------------------------------------------+
|
||||
| Godot 3.4 | November 2021 | |supported| Receives fixes for bugs, security and platform support |
|
||||
| | | issues, as well as backwards-compatible usability enhancements. |
|
||||
+-------------+----------------------+--------------------------------------------------------------------------+
|
||||
| Godot 3.3 | April 2021 | |partial| Receives fixes for security and platform support issues only. |
|
||||
+-------------+----------------------+--------------------------------------------------------------------------+
|
||||
| Godot 3.2 | January 2020 | |eol| No longer supported as fully superseded by the compatible 3.3 |
|
||||
| | | release (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 have
|
||||
historically had one major or minor release per year, with several maintenance
|
||||
updates between each.
|
||||
|
||||
Starting with Godot 3.3, we aim to accelerate our development cycles for minor
|
||||
releases, so you can expect a new minor release every 3 to 6 months.
|
||||
|
||||
Maintenance (patch) releases will be 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, we can only say that we aim for a **2022**
|
||||
release, but any closer estimate is likely to be hard to uphold. Alpha builds
|
||||
will be published as soon as the main features for Godot 4.0 are finalized.
|
108
about/troubleshooting.rst
Normal file
108
about/troubleshooting.rst
Normal file
@ -0,0 +1,108 @@
|
||||
.. _doc_troubleshooting:
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
This page lists common issues encountered when using Godot and possible solutions.
|
||||
|
||||
.. seealso::
|
||||
|
||||
See :ref:`doc_using_the_web_editor` for caveats specific to the HTML5 version
|
||||
of the Godot editor.
|
||||
|
||||
Everything I do in the editor or project manager appears delayed by one frame.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This is a `known bug <https://github.com/godotengine/godot/issues/23069>`__ on
|
||||
Intel graphics drivers on Windows. Updating to the latest graphics driver
|
||||
version *provided by Intel* should fix the issue.
|
||||
|
||||
You should use the graphics driver provided by Intel rather than the one
|
||||
provided by your desktop or laptop's manufacturer because their version is often
|
||||
outdated.
|
||||
|
||||
The grid disappears and meshes turn black when I rotate the 3D camera in the editor.
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
This is a `known bug <https://github.com/godotengine/godot/issues/30330>`__ on
|
||||
Intel graphics drivers on Windows.
|
||||
|
||||
The only workaround, for now, is to switch to the GLES2 renderer. You can switch
|
||||
the renderer in the top-right corner of the editor or the Project Settings.
|
||||
|
||||
If you use a computer allowing you to switch your graphics card, like NVIDIA
|
||||
Optimus, you can use the dedicated graphics card to run Godot.
|
||||
|
||||
The editor or project takes a very long time to start.
|
||||
------------------------------------------------------
|
||||
|
||||
This is a `known bug <https://github.com/godotengine/godot/issues/20566>`__ on
|
||||
Windows when you have specific USB peripherals connected. In particular,
|
||||
Corsair's iCUE software seems to cause the bug. Try updating your USB
|
||||
peripherals' drivers to their latest version. If the bug persists, you need to
|
||||
disconnect the faulty peripherals before opening the editor. You can then
|
||||
connect the peripheral again.
|
||||
|
||||
Editor tooltips in the Inspector and Node docks blink when they're displayed.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This is a `known issue <https://github.com/godotengine/godot/issues/32990>`__
|
||||
caused by the third-party Stardock Fences application on Windows.
|
||||
The only known workaround is to disable Stardock Fences while using Godot.
|
||||
|
||||
The Godot editor appears frozen after clicking the system console.
|
||||
------------------------------------------------------------------
|
||||
|
||||
When running Godot on Windows with the system console enabled, you can
|
||||
accidentally enable *selection mode* by clicking inside the command window. This
|
||||
Windows-specific behavior pauses the application to let you select text inside
|
||||
the system console. Godot cannot override this system-specific behavior.
|
||||
|
||||
To solve this, select the system console window and press Enter to leave
|
||||
selection mode.
|
||||
|
||||
Some text such as "NO DC" appears in the top-left corner of the project manager and editor window.
|
||||
--------------------------------------------------------------------------------------------------
|
||||
|
||||
This is caused by the NVIDIA graphics driver injecting an overlay to display information.
|
||||
|
||||
To disable this overlay on Windows, restore your graphics driver settings to the
|
||||
default values in the NVIDIA Control Panel.
|
||||
|
||||
To disable this overlay on Linux, open ``nvidia-settings``, go to **X Screen 0 >
|
||||
OpenGL Settings** then uncheck **Enable Graphics API Visual Indicator**.
|
||||
|
||||
The project window appears blurry, unlike the editor.
|
||||
-----------------------------------------------------
|
||||
|
||||
Unlike the editor, the project isn't marked as DPI-aware by default. This is
|
||||
done to improve performance, especially on integrated graphics, where rendering
|
||||
3D scenes in hiDPI is slow.
|
||||
|
||||
To resolve this, open **Project > Project Settings** and enable **Display >
|
||||
Window > Dpi > Allow Hidpi**. On top of that, make sure your project is
|
||||
configured to support :ref:`multiple resolutions <doc_multiple_resolutions>`.
|
||||
|
||||
The project window doesn't appear centered when I run the project.
|
||||
------------------------------------------------------------------
|
||||
|
||||
This is a `known bug <https://github.com/godotengine/godot/issues/13017>`__. To
|
||||
resolve this, open **Project > Project Settings** and enable **Display > Window
|
||||
> Dpi > Allow Hidpi**. On top of that, make sure your project is configured to
|
||||
support :ref:`multiple resolutions <doc_multiple_resolutions>`.
|
||||
|
||||
The project works when run from the editor, but fails to load some files when running from an exported copy.
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
|
||||
This is usually caused by forgetting to specify a filter for non-resource files
|
||||
in the Export dialog. By default, Godot will only include actual *resources*
|
||||
into the PCK file. Some files commonly used, such as JSON files, are not
|
||||
considered resources. For example, if you load ``test.json`` in the exported
|
||||
project, you need to specify ``*.json`` in the non-resource export filter. See
|
||||
:ref:`doc_exporting_projects_export_mode` for more information.
|
||||
|
||||
On Windows, this can also be due to :ref:`case sensitivity
|
||||
<doc_project_organization_case_sensitivity>` issues. If you reference a resource
|
||||
in your script with a different case than on the filesystem, loading will fail
|
||||
once you export the project. This is because the virtual PCK filesystem is
|
||||
case-sensitive, while Windows's filesystem is case-insensitive by default.
|
1657
classes/class_@gdscript.rst
Normal file
1657
classes/class_@gdscript.rst
Normal file
File diff suppressed because it is too large
Load Diff
2474
classes/class_@globalscope.rst
Normal file
2474
classes/class_@globalscope.rst
Normal file
File diff suppressed because it is too large
Load Diff
329
classes/class_aabb.rst
Normal file
329
classes/class_aabb.rst
Normal file
@ -0,0 +1,329 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AABB.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../tutorials/math/index`
|
||||
|
||||
- :doc:`../tutorials/math/vector_math`
|
||||
|
||||
- :doc:`../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_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_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.)`
|
182
classes/class_acceptdialog.rst
Normal file
182
classes/class_acceptdialog.rst
Normal file
@ -0,0 +1,182 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AcceptDialog.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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!"`` *(parent override)* |
|
||||
+-----------------------------+-------------------------------------------------------------------------+----------------------------------+
|
||||
|
||||
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.)`
|
132
classes/class_aescontext.rst
Normal file
132
classes/class_aescontext.rst
Normal file
@ -0,0 +1,132 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AESContext.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
247
classes/class_animatedsprite.rst
Normal file
247
classes/class_animatedsprite.rst
Normal file
@ -0,0 +1,247 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimatedSprite.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _class_AnimatedSprite:
|
||||
|
||||
AnimatedSprite
|
||||
==============
|
||||
|
||||
**Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||||
|
||||
Sprite node that can use multiple 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.
|
||||
|
||||
**Note:** You can associate a set of normal maps by creating additional :ref:`SpriteFrames<class_SpriteFrames>` resources with a ``_normal`` suffix. For example, having 2 :ref:`SpriteFrames<class_SpriteFrames>` resources ``run`` and ``run_normal`` will make it so the ``run`` animation uses the normal map.
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`../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
|
||||
-------
|
||||
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite_method_is_playing>` **(** **)** |const| |
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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 ``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).
|
||||
|
||||
----
|
||||
|
||||
.. _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`` |
|
||||
+-----------+-----------+
|
||||
|
||||
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_is_playing:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if an animation is currently being played.
|
||||
|
||||
----
|
||||
|
||||
.. _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.)`
|
153
classes/class_animatedsprite3d.rst
Normal file
153
classes/class_animatedsprite3d.rst
Normal file
@ -0,0 +1,153 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimatedSprite3D.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
191
classes/class_animatedtexture.rst
Normal file
191
classes/class_animatedtexture.rst
Normal file
@ -0,0 +1,191 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimatedTexture.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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`` *(parent override)* |
|
||||
+---------------------------+--------------------------------------------------------------------+---------------------------+
|
||||
| :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.)`
|
788
classes/class_animation.rst
Normal file
788
classes/class_animation.rst
Normal file
@ -0,0 +1,788 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the Animation.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
284
classes/class_animationnode.rst
Normal file
284
classes/class_animationnode.rst
Normal file
@ -0,0 +1,284 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNode.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`String<class_String>` | :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** **(** **)**
|
||||
|
||||
Called 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|
|
||||
|
||||
Gets the text caption for this node (used by some editors).
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNode_method_get_child_by_name:
|
||||
|
||||
- :ref:`Object<class_Object>` **get_child_by_name** **(** :ref:`String<class_String>` name **)** |virtual|
|
||||
|
||||
Gets a child node by index (used by editors inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`).
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNode_method_get_child_nodes:
|
||||
|
||||
- :ref:`Dictionary<class_Dictionary>` **get_child_nodes** **(** **)** |virtual|
|
||||
|
||||
Gets all children nodes in order as a ``name: node`` dictionary. Only useful when inheriting :ref:`AnimationRootNode<class_AnimationRootNode>`.
|
||||
|
||||
----
|
||||
|
||||
.. _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|
|
||||
|
||||
Gets the default 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_list:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_parameter_list** **(** **)** |virtual|
|
||||
|
||||
Gets the property information for parameter. 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:`String<class_String>` **has_filter** **(** **)** |virtual|
|
||||
|
||||
Returns ``true`` whether you want the blend tree editor to 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 ``true`` whether a given path is filtered.
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNode_method_process:
|
||||
|
||||
- void **process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual|
|
||||
|
||||
User-defined callback called when a custom 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 storage, 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.)`
|
52
classes/class_animationnodeadd2.rst
Normal file
52
classes/class_animationnodeadd2.rst
Normal file
@ -0,0 +1,52 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeAdd2.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
62
classes/class_animationnodeadd3.rst
Normal file
62
classes/class_animationnodeadd3.rst
Normal file
@ -0,0 +1,62 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeAdd3.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
56
classes/class_animationnodeanimation.rst
Normal file
56
classes/class_animationnodeanimation.rst
Normal file
@ -0,0 +1,56 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeAnimation.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
56
classes/class_animationnodeblend2.rst
Normal file
56
classes/class_animationnodeblend2.rst
Normal file
@ -0,0 +1,56 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeBlend2.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
60
classes/class_animationnodeblend3.rst
Normal file
60
classes/class_animationnodeblend3.rst
Normal file
@ -0,0 +1,60 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeBlend3.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
188
classes/class_animationnodeblendspace1d.rst
Normal file
188
classes/class_animationnodeblendspace1d.rst
Normal file
@ -0,0 +1,188 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeBlendSpace1D.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
310
classes/class_animationnodeblendspace2d.rst
Normal file
310
classes/class_animationnodeblendspace2d.rst
Normal file
@ -0,0 +1,310 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeBlendSpace2D.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
175
classes/class_animationnodeblendtree.rst
Normal file
175
classes/class_animationnodeblendtree.rst
Normal file
@ -0,0 +1,175 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeBlendTree.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 mix, blend2, blend3, one shot, etc. This is one of the most commonly used roots.
|
||||
|
||||
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.)`
|
169
classes/class_animationnodeoneshot.rst
Normal file
169
classes/class_animationnodeoneshot.rst
Normal file
@ -0,0 +1,169 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeOneShot.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
27
classes/class_animationnodeoutput.rst
Normal file
27
classes/class_animationnodeoutput.rst
Normal file
@ -0,0 +1,27 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeOutput.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
271
classes/class_animationnodestatemachine.rst
Normal file
271
classes/class_animationnodestatemachine.rst
Normal file
@ -0,0 +1,271 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeStateMachine.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
126
classes/class_animationnodestatemachineplayback.rst
Normal file
126
classes/class_animationnodestatemachineplayback.rst
Normal file
@ -0,0 +1,126 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeStateMachinePlayback.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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`` *(parent override)* |
|
||||
+-------------------------+-------------------------+------------------------------+
|
||||
|
||||
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.)`
|
169
classes/class_animationnodestatemachinetransition.rst
Normal file
169
classes/class_animationnodestatemachinetransition.rst
Normal file
@ -0,0 +1,169 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeStateMachineTransition.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 `https://docs.godotengine.org/en/3.4/tutorials/animation/animation_tree.html#controlling-from-code <https://docs.godotengine.org/en/3.4/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.)`
|
30
classes/class_animationnodetimescale.rst
Normal file
30
classes/class_animationnodetimescale.rst
Normal file
@ -0,0 +1,30 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeTimeScale.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
40
classes/class_animationnodetimeseek.rst
Normal file
40
classes/class_animationnodetimeseek.rst
Normal file
@ -0,0 +1,40 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeTimeSeek.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
112
classes/class_animationnodetransition.rst
Normal file
112
classes/class_animationnodetransition.rst
Normal file
@ -0,0 +1,112 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationNodeTransition.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
554
classes/class_animationplayer.rst
Normal file
554
classes/class_animationplayer.rst
Normal file
@ -0,0 +1,554 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationPlayer.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../tutorials/animation/index`
|
||||
|
||||
- :doc:`../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 key ``name`` or ``null`` if not found.
|
||||
|
||||
----
|
||||
|
||||
.. _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.
|
||||
|
||||
----
|
||||
|
||||
.. _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.)`
|
20
classes/class_animationrootnode.rst
Normal file
20
classes/class_animationrootnode.rst
Normal file
@ -0,0 +1,20 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationRootNode.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
18
classes/class_animationtrackeditplugin.rst
Normal file
18
classes/class_animationtrackeditplugin.rst
Normal file
@ -0,0 +1,18 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationTrackEditPlugin.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
181
classes/class_animationtree.rst
Normal file
181
classes/class_animationtree.rst
Normal file
@ -0,0 +1,181 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationTree.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
771
classes/class_animationtreeplayer.rst
Normal file
771
classes/class_animationtreeplayer.rst
Normal file
@ -0,0 +1,771 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AnimationTreePlayer.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
516
classes/class_area.rst
Normal file
516
classes/class_area.rst
Normal file
@ -0,0 +1,516 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the Area.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
448
classes/class_area2d.rst
Normal file
448
classes/class_area2d.rst
Normal file
@ -0,0 +1,448 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the Area2D.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
529
classes/class_array.rst
Normal file
529
classes/class_array.rst
Normal file
@ -0,0 +1,529 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the Array.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 **)** |
|
||||
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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. 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_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.
|
||||
|
||||
----
|
||||
|
||||
.. _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.
|
||||
|
||||
----
|
||||
|
||||
.. _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.)`
|
386
classes/class_arraymesh.rst
Normal file
386
classes/class_arraymesh.rst
Normal file
@ -0,0 +1,386 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ArrayMesh.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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** --- Default value used for index_array_len 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.)`
|
116
classes/class_arvranchor.rst
Normal file
116
classes/class_arvranchor.rst
Normal file
@ -0,0 +1,116 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRAnchor.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
30
classes/class_arvrcamera.rst
Normal file
30
classes/class_arvrcamera.rst
Normal file
@ -0,0 +1,30 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRCamera.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
183
classes/class_arvrcontroller.rst
Normal file
183
classes/class_arvrcontroller.rst
Normal file
@ -0,0 +1,183 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRController.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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`` with precision ``.01``. 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.)`
|
257
classes/class_arvrinterface.rst
Normal file
257
classes/class_arvrinterface.rst
Normal file
@ -0,0 +1,257 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRInterface.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
23
classes/class_arvrinterfacegdnative.rst
Normal file
23
classes/class_arvrinterfacegdnative.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRInterfaceGDNative.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
60
classes/class_arvrorigin.rst
Normal file
60
classes/class_arvrorigin.rst
Normal file
@ -0,0 +1,60 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVROrigin.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
191
classes/class_arvrpositionaltracker.rst
Normal file
191
classes/class_arvrpositionaltracker.rst
Normal file
@ -0,0 +1,191 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRPositionalTracker.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
336
classes/class_arvrserver.rst
Normal file
336
classes/class_arvrserver.rst
Normal file
@ -0,0 +1,336 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the ARVRServer.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
144
classes/class_aspectratiocontainer.rst
Normal file
144
classes/class_aspectratiocontainer.rst
Normal file
@ -0,0 +1,144 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AspectRatioContainer.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.
|
||||
|
||||
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.)`
|
362
classes/class_astar.rst
Normal file
362
classes/class_astar.rst
Normal file
@ -0,0 +1,362 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AStar.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 1 or larger.
|
||||
|
||||
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.)`
|
343
classes/class_astar2d.rst
Normal file
343
classes/class_astar2d.rst
Normal file
@ -0,0 +1,343 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AStar2D.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 **)** |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:`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 1 or larger.
|
||||
|
||||
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 **)** |const|
|
||||
|
||||
Returns whether there is a connection/segment between the given points.
|
||||
|
||||
----
|
||||
|
||||
.. _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 **)**
|
||||
|
||||
Deletes the segment between the given points.
|
||||
|
||||
----
|
||||
|
||||
.. _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.)`
|
105
classes/class_atlastexture.rst
Normal file
105
classes/class_atlastexture.rst
Normal file
@ -0,0 +1,105 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AtlasTexture.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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`` *(parent override)* |
|
||||
+-------------------------------+-------------------------------------------------------------+---------------------------+
|
||||
| :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.)`
|
23
classes/class_audiobuslayout.rst
Normal file
23
classes/class_audiobuslayout.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioBusLayout.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
30
classes/class_audioeffect.rst
Normal file
30
classes/class_audioeffect.rst
Normal file
@ -0,0 +1,30 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffect.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
49
classes/class_audioeffectamplify.rst
Normal file
49
classes/class_audioeffectamplify.rst
Normal file
@ -0,0 +1,49 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectAmplify.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
23
classes/class_audioeffectbandlimitfilter.rst
Normal file
23
classes/class_audioeffectbandlimitfilter.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectBandLimitFilter.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
23
classes/class_audioeffectbandpassfilter.rst
Normal file
23
classes/class_audioeffectbandpassfilter.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectBandPassFilter.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
127
classes/class_audioeffectcapture.rst
Normal file
127
classes/class_audioeffectcapture.rst
Normal file
@ -0,0 +1,127 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectCapture.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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 a microphone, implement application defined effects, or to transmit audio over the network.
|
||||
|
||||
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.)`
|
593
classes/class_audioeffectchorus.rst
Normal file
593
classes/class_audioeffectchorus.rst
Normal file
@ -0,0 +1,593 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectChorus.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
167
classes/class_audioeffectcompressor.rst
Normal file
167
classes/class_audioeffectcompressor.rst
Normal file
@ -0,0 +1,167 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectCompressor.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
265
classes/class_audioeffectdelay.rst
Normal file
265
classes/class_audioeffectdelay.rst
Normal file
@ -0,0 +1,265 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectDelay.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
155
classes/class_audioeffectdistortion.rst
Normal file
155
classes/class_audioeffectdistortion.rst
Normal file
@ -0,0 +1,155 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectDistortion.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
63
classes/class_audioeffecteq.rst
Normal file
63
classes/class_audioeffecteq.rst
Normal file
@ -0,0 +1,63 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectEQ.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
47
classes/class_audioeffecteq10.rst
Normal file
47
classes/class_audioeffecteq10.rst
Normal file
@ -0,0 +1,47 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectEQ10.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
69
classes/class_audioeffecteq21.rst
Normal file
69
classes/class_audioeffecteq21.rst
Normal file
@ -0,0 +1,69 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectEQ21.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
39
classes/class_audioeffecteq6.rst
Normal file
39
classes/class_audioeffecteq6.rst
Normal file
@ -0,0 +1,39 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectEQ6.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
129
classes/class_audioeffectfilter.rst
Normal file
129
classes/class_audioeffectfilter.rst
Normal file
@ -0,0 +1,129 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectFilter.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
23
classes/class_audioeffecthighpassfilter.rst
Normal file
23
classes/class_audioeffecthighpassfilter.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectHighPassFilter.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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.)`
|
23
classes/class_audioeffecthighshelffilter.rst
Normal file
23
classes/class_audioeffecthighshelffilter.rst
Normal file
@ -0,0 +1,23 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the AudioEffectHighShelfFilter.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
.. _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:`../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.)`
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user